From 177e4ce814cc4d612370241b4b4fb35166742862 Mon Sep 17 00:00:00 2001 From: hupe1980 Date: Sun, 14 Apr 2024 09:54:22 +0200 Subject: [PATCH] Refactor --- README.md | 2 +- aisploit/{redteam => red_team}/__init__.py | 0 aisploit/{redteam => red_team}/job.py | 0 aisploit/{redteam => red_team}/report.py | 0 aisploit/{redteam => red_team}/task.py | 0 aisploit/target/langchain.py | 2 +- examples/gandalf.ipynb | 2 +- tests/{redteam => red_team}/test_report.py | 2 +- 8 files changed, 4 insertions(+), 4 deletions(-) rename aisploit/{redteam => red_team}/__init__.py (100%) rename aisploit/{redteam => red_team}/job.py (100%) rename aisploit/{redteam => red_team}/report.py (100%) rename aisploit/{redteam => red_team}/task.py (100%) rename tests/{redteam => red_team}/test_report.py (95%) diff --git a/README.md b/README.md index f5cd5a8..950414f 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ from typing import Any import textwrap from aisploit.core import BaseCallbackHandler, BasePromptValue, Score, Response from aisploit.model import ChatOpenAI -from aisploit.redteam import RedTeamJob, RedTeamClassifierTask +from aisploit.red_team import RedTeamJob, RedTeamClassifierTask from aisploit.target import target from aisploit.demo import GandalfBot, GandalfLevel, GandalfScorer diff --git a/aisploit/redteam/__init__.py b/aisploit/red_team/__init__.py similarity index 100% rename from aisploit/redteam/__init__.py rename to aisploit/red_team/__init__.py diff --git a/aisploit/redteam/job.py b/aisploit/red_team/job.py similarity index 100% rename from aisploit/redteam/job.py rename to aisploit/red_team/job.py diff --git a/aisploit/redteam/report.py b/aisploit/red_team/report.py similarity index 100% rename from aisploit/redteam/report.py rename to aisploit/red_team/report.py diff --git a/aisploit/redteam/task.py b/aisploit/red_team/task.py similarity index 100% rename from aisploit/redteam/task.py rename to aisploit/red_team/task.py diff --git a/aisploit/target/langchain.py b/aisploit/target/langchain.py index b19e6a0..f99fbed 100644 --- a/aisploit/target/langchain.py +++ b/aisploit/target/langchain.py @@ -19,4 +19,4 @@ def send_prompt(self, prompt: BasePromptValue) -> Response: parser = StrOutputParser() return Response(content=parser.invoke(response)) - raise ValueError(f"Unsupported cache value {type(response)}") + raise ValueError(f"Unsupported response value {type(response)}") diff --git a/examples/gandalf.ipynb b/examples/gandalf.ipynb index a52c974..4250f9b 100644 --- a/examples/gandalf.ipynb +++ b/examples/gandalf.ipynb @@ -22,7 +22,7 @@ "from dotenv import load_dotenv\n", "from aisploit.core import BaseCallbackHandler, BasePromptValue, Score, Response\n", "from aisploit.model import ChatOpenAI\n", - "from aisploit.redteam import RedTeamJob, RedTeamClassifierTask\n", + "from aisploit.red_team import RedTeamJob, RedTeamClassifierTask\n", "from aisploit.target import target\n", "from aisploit.demo import GandalfBot, GandalfLevel, GandalfScorer\n", "\n", diff --git a/tests/redteam/test_report.py b/tests/red_team/test_report.py similarity index 95% rename from tests/redteam/test_report.py rename to tests/red_team/test_report.py index a10b310..4303764 100644 --- a/tests/redteam/test_report.py +++ b/tests/red_team/test_report.py @@ -1,7 +1,7 @@ import pytest from aisploit.core import BaseReport, Score -from aisploit.redteam import RedTeamReport, RedTeamReportEntry +from aisploit.red_team import RedTeamReport, RedTeamReportEntry @pytest.fixture