-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from airtai/25-rework-agent-configurations
Rework agent configs and classes
- Loading branch information
Showing
12 changed files
with
152 additions
and
127 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
...team/workflow/agent_configs/context_leakage_black_box/context_leakage_black_box_config.py
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
...am/workflow/agent_configs/context_leakage_classifier/context_leakage_classifier_config.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from .context_leakage_black_box.context_leakage_black_box import ( | ||
ContextLeakagePromptGeneratorAgent, | ||
) | ||
from .context_leakage_classifier.context_leakage_classifier import ( | ||
ContextLeakageClassifierAgent, | ||
) | ||
|
||
__all__ = [ | ||
"ContextLeakagePromptGeneratorAgent", | ||
"ContextLeakageClassifierAgent", | ||
] |
Empty file.
17 changes: 17 additions & 0 deletions
17
context_leakage_team/workflow/agents/context_leakage_black_box/context_leakage_black_box.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from pathlib import Path | ||
from typing import Any | ||
|
||
from autogen.agentchat import ConversableAgent | ||
|
||
|
||
class ContextLeakagePromptGeneratorAgent(ConversableAgent): # type: ignore[misc] | ||
SYSTEM_MESSAGE = (Path(__file__).parent / "system_message.md").read_text() | ||
|
||
def __init__(self, **kwargs: Any): | ||
"""Initialize ContextLeakagePromptGeneratorAgent.""" | ||
super().__init__( | ||
name="Prompt_Generator_Agent", | ||
description="Generates prompts to leak context from the tested LLM.", | ||
system_message=self.SYSTEM_MESSAGE, | ||
**kwargs, | ||
) |
File renamed without changes.
Empty file.
25 changes: 25 additions & 0 deletions
25
...ext_leakage_team/workflow/agents/context_leakage_classifier/context_leakage_classifier.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from pathlib import Path | ||
from typing import Any | ||
|
||
from autogen.agentchat import ConversableAgent | ||
|
||
|
||
class ContextLeakageClassifierAgent(ConversableAgent): # type: ignore[misc] | ||
SYSTEM_MESSAGE = (Path(__file__).parent / "system_message.md").read_text() | ||
|
||
def __init__( | ||
self, | ||
confidential_part: str, | ||
non_confidential_part: str, | ||
**kwargs: Any, | ||
): | ||
"""Initialize ContextLeakageClassifierAgent.""" | ||
super().__init__( | ||
name="Context_Leakage_Classifier", | ||
description="Detect and classify context leakage in the model's response.", | ||
system_message=self.SYSTEM_MESSAGE.format( | ||
confidential_part=confidential_part, | ||
not_confidential_part=non_confidential_part, | ||
), | ||
**kwargs, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters