diff --git a/config.yaml b/config.yaml new file mode 100644 index 00000000..e49fe016 --- /dev/null +++ b/config.yaml @@ -0,0 +1,23 @@ +model_list: + - model_name: claude-3-7 + litellm_params: + model: claude-3-7-sonnet-20250219 + api_key: "os.environ/ANTHROPIC_API_KEY" # does os.getenv("ANTHROPIC_API_KEY") + base_url: 'https://api.anthropic.com' + - model_name: gpt-4o + litellm_params: + model: gpt-4o + api_key: "os.environ/OPENAI_API_KEY" + api_base: https://api.openai.com/v1 + - model_name: qwen2.5:14b + litellm_params: + model: ollama/qwen2.5:14b + api_base: http://localhost:8000 + api_key: "os.environ/OLLAMA" + +litellm_settings: # module level litellm settings - https://github.com/BerriAI/litellm/blob/main/litellm/__init__.py + drop_params: True + # set_verbose: True + +general_settings: + port: 4000 \ No newline at end of file diff --git a/examples/agent_patterns/claude.py b/examples/agent_patterns/claude.py new file mode 100644 index 00000000..2c9826b9 --- /dev/null +++ b/examples/agent_patterns/claude.py @@ -0,0 +1,25 @@ +from openai import AsyncOpenAI +from agents import OpenAIChatCompletionsModel,Agent,Runner +from agents.model_settings import ModelSettings +from agents import set_default_openai_client, set_tracing_disabled +import os + +external_client = AsyncOpenAI( + base_url = 'https://api.anthropic.com/v1', + api_key=os.getenv('ANTHROPIC_API_KEY', None) +) + +set_default_openai_client(external_client) +set_tracing_disabled(True) + +agent = Agent( + name="Assistant", + instructions="You are a helpful assistant", + model=OpenAIChatCompletionsModel( + model="claude-3-5-sonnet-20240620", + openai_client=external_client, + ) +) + +result = Runner.run_sync(agent, "Write a haiku about recursion in programming.") +print(result.final_output)