Skip to content

Commit

Permalink
Agent Tic Tac Toe
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpreetbedi committed Feb 25, 2025
1 parent 572fda0 commit 0dd974e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
13 changes: 9 additions & 4 deletions cookbook/examples/apps/tic_tac_toe/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,16 @@ def get_model_for_provider(provider: str, model_name: str):
elif provider == "google":
return Gemini(id=model_name)
elif provider == "anthropic":
if model_name == "claude-3-5-sonnet-20241022":
return Claude(id=model_name, max_tokens=8192)
elif model_name == "claude-3-7-sonnet-20250219":
if model_name == "claude-3-5-sonnet":
return Claude(id="claude-3-5-sonnet-20241022", max_tokens=8192)
elif model_name == "claude-3-7-sonnet":
return Claude(
id=model_name,
id="claude-3-7-sonnet-20250219",
max_tokens=8192,
)
elif model_name == "claude-3-7-sonnet-thinking":
return Claude(
id="claude-3-7-sonnet-20250219",
max_tokens=8192,
thinking={"type": "enabled", "budget_tokens": 4096},
)
Expand Down
7 changes: 4 additions & 3 deletions cookbook/examples/apps/tic_tac_toe/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ def main():
model_options = {
"gpt-4o": "openai:gpt-4o",
"o3-mini": "openai:o3-mini",
"claude-3.5": "anthropic:claude-3-5-sonnet-20241022",
"claude-3.7": "anthropic:claude-3-7-sonnet-20250219",
"claude-3.5": "anthropic:claude-3-5-sonnet",
"claude-3.7": "anthropic:claude-3-7-sonnet",
"claude-3.7-thinking": "anthropic:claude-3-7-sonnet-thinking",
"gemini-flash": "google:gemini-2.0-flash",
"gemini-pro": "google:gemini-2.0-pro-exp-02-05",
"llama-3.3": "groq:llama-3.3-70b-versatile",
Expand All @@ -58,7 +59,7 @@ def main():
selected_p_x = st.selectbox(
"Select Player X",
list(model_options.keys()),
index=list(model_options.keys()).index("claude-3.7"),
index=list(model_options.keys()).index("claude-3.7-thinking"),
key="model_p1",
)
selected_p_o = st.selectbox(
Expand Down

0 comments on commit 0dd974e

Please sign in to comment.