diff --git a/README.md b/README.md index 665b572..bbcf0ab 100644 --- a/README.md +++ b/README.md @@ -132,36 +132,41 @@ Create a `.env` file with your API credentials: ```python import asyncio +import os from jailbreak_toolbox.models.implementations.openai_model import OpenAIModel from jailbreak_toolbox.attacks.blackbox.implementations.evosynth import EvosynthAttack, EvosynthConfig -from jailbreak_toolbox.judges.implementations import LLMJudge +from dotenv import load_dotenv +load_dotenv() async def main(): # Initialize models (using router platform like OpenRouter or BoyueRichData) target_model = OpenAIModel( model_name="gpt-4o", - api_key="your_key", - base_url="https://openrouter.ai/api/v1" # or your router's endpoint + api_key=os.getenv("OPENAI_API_KEY"), + base_url=os.getenv("OPENAI_BASE_URL") # or your router's endpoint ) judge_model = OpenAIModel( model_name="gpt-4o", - api_key="your_key", - base_url="https://openrouter.ai/api/v1" + api_key=os.getenv("OPENAI_API_KEY"), + base_url=os.getenv("OPENAI_BASE_URL") ) # Configure attack config = EvosynthConfig( max_iterations=15, success_threshold=5, - pipeline="full_pipeline" + pipeline="full_pipeline", + openai_api_key=os.getenv("OPENAI_API_KEY"), + base_url=os.getenv("OPENAI_BASE_URL"), + attack_model_base="deepseek-chat", + langfuse_host=None ) # Create judge and attack - judge = LLMJudge(judge_model=judge_model) attack = EvosynthAttack( target_model=target_model, - judge=judge, - config=config + judge=judge_model, + config=config, ) # Execute attack (async)