File tree Expand file tree Collapse file tree 4 files changed +13
-3
lines changed
test-openai-agent-anthropic-gemini Expand file tree Collapse file tree 4 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -38,16 +38,26 @@ def calculate(expression: str):
3838 "provide an explanation for how you arrived at it. "
3939)
4040
41+
4142claude_client = AsyncOpenAI (base_url = "https://api.anthropic.com/v1/" , api_key = os .environ .get ("ANTHROPIC_API_KEY" ))
43+ gemini_client = AsyncOpenAI (base_url = "https://generativelanguage.googleapis.com/v1beta/openai" , api_key = os .getenv ("GEMINI_API_KEY" ))
44+
4245
4346math_agent = Agent (
4447 name = "MathAgent" ,
4548 instructions = INSTRUCTIONS ,
4649 tools = [calculate ],
47- model = OpenAIChatCompletionsModel (
48- model = "claude-3-7-sonnet-20250219" ,
49- openai_client = claude_client ,
50+ # Use Claude
51+ # model=OpenAIChatCompletionsModel(
52+ # model="claude-3-7-sonnet-20250219",
53+ # openai_client=claude_client,
54+ # ),
55+ # Use Gemini
56+ model = OpenAIChatCompletionsModel (
57+ model = "gemini-2.0-flash" ,
58+ openai_client = gemini_client
5059 ),
60+ # Use OpenAI
5161 # model="gpt-4o",
5262)
5363
File renamed without changes.
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments