Skip to content

Commit b10bef6

Browse files
committed
Also try with Gemini
1 parent a921cef commit b10bef6

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

test-openai-agent-anthropic/main.py renamed to test-openai-agent-anthropic-gemini/main.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,26 @@ def calculate(expression: str):
3838
"provide an explanation for how you arrived at it. "
3939
)
4040

41+
4142
claude_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

4346
math_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.

0 commit comments

Comments
 (0)