Skip to content

DeepTeam is a framework to red team LLMs and AI agents.

lint

A-Vamshi1b43db1ebcf4
diff --git a/deepteam/cli/main.py b/deepteam/cli/main.py
index 463c98aa..310fa63f 100644
--- a/deepteam/cli/main.py
+++ b/deepteam/cli/main.py
@@ -193,13 +193,15 @@ def _load_config(path: str):
with open(path, "r") as f:
return yaml.safe_load(f)
-
+
def _show_version(value: bool):
from deepteam._version import __version__
+
if value:
typer.echo(f"deepteam version {__version__}")
raise typer.Exit()
-
+
+
@app.callback()
def main(
version: bool = typer.Option(
@@ -214,13 +216,17 @@ def main(
"""
DeepTeam CLI for red teaming LLMs.
"""
- pass
+ pass
+
@app.command("login")
def login():
- typer.echo(f"This feature is currently in beta. For more details, please contact [email protected]")
+ typer.echo(
+ f"This feature is currently in beta. For more details, please contact [email protected]"
+ )
raise typer.Exit()
+
@app.command("run")
def run(
config_file: str,
@@ -343,13 +349,16 @@ def run(
target_model = load_model(target_model_spec)
if system_config.get("run_async", True):
+
async def model_callback(input: str, turns=None) -> str:
response = await target_model.a_generate(input)
# Ensure we return a string, handle different response types
if isinstance(response, tuple):
return str(response[0]) if response else "Empty response"
return str(response)
+
else:
+
def model_callback(input: str, turns=None) -> str:
response = target_model.generate(input)
# Ensure we return a string, handle different response types
diff --git a/deepteam/test_case/__init__.py b/deepteam/test_case/__init__.py
index c9047cb7..a37d9a8d 100644
--- a/deepteam/test_case/__init__.py
+++ b/deepteam/test_case/__init__.py
@@ -3,4 +3,4 @@ from .test_case import RTTestCase, RTTurn
__all__ = [
"RTTestCase",
"RTTurn",
-]
\ No newline at end of file
+]
diff --git a/tests/test_core/test_attacks/test_all.py b/tests/test_core/test_attacks/test_all.py
index 9a9d0d82..6b855bc1 100644
--- a/tests/test_core/test_attacks/test_all.py
+++ b/tests/test_core/test_attacks/test_all.py
@@ -4,7 +4,7 @@ from deepteam.attacks.single_turn import *
from deepteam.attacks.multi_turn import *
-async def model_callback(input: str, turns = None) -> str:
+async def model_callback(input: str, turns=None) -> str:
return input