Skip to content

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

Final touches

penguinebdec73d83acb
diff --git a/deepteam/red_teamer/red_teamer.py b/deepteam/red_teamer/red_teamer.py
index 7d90dad4..e610c14e 100644
--- a/deepteam/red_teamer/red_teamer.py
+++ b/deepteam/red_teamer/red_teamer.py
@@ -9,6 +9,7 @@ import inspect
from rich import box
from enum import Enum
from rich.console import Console
+import webbrowser
from deepeval.models import DeepEvalBaseLLM
@@ -706,4 +707,9 @@ class RedTeamer:
endpoint=Endpoints.RISK_ASSESSMENT_ENDPOINT,
body=body,
)
- print(data, link, "@@@")
+
+ console.print(
+ "[rgb(5,245,141)]✓[/rgb(5,245,141)] Done 🎉! View risk assessment on Confident AI:"
+ f"[link={link}]{link}[/link]"
+ )
+ webbrowser.open(link)
diff --git a/kk.py b/kk.py
index c62a4d97..994bab52 100644
--- a/kk.py
+++ b/kk.py
@@ -4,17 +4,17 @@ from deepteam.attacks.single_turn import Roleplay
import os
-# async def your_callback(input: str) -> str:
-# return "I'm sorry but I can't answer this: " + input
+async def your_callback(input: str) -> str:
+ return "I'm sorry but I can't answer this: " + input
-# print(os.environ.get("CONFIDENT_API_KEY"))
+print(os.environ.get("CONFIDENT_API_KEY"))
-# risk_assessment = red_team(
-# attacks=[Roleplay()],
-# vulnerabilities=[Bias(), BOLA()],
-# model_callback=your_callback,
-# )
+risk_assessment = red_team(
+ attacks=[Roleplay()],
+ vulnerabilities=[Bias(), BOLA()],
+ model_callback=your_callback,
+)
from deepteam.vulnerabilities.constants import (
VULNERABILITY_NAMES,