Skip to content

Commit 5c379e9

Browse files
committed
Update model
1 parent fb10650 commit 5c379e9

File tree

4 files changed

+10
-17
lines changed

4 files changed

+10
-17
lines changed

examples/customer_support/src/agent/customer_support.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
}
3333
]
3434

35-
3635
# Flight tools
3736
def search_flights(
3837
departure_airport: str,

examples/research/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ dependencies = [
1212
"httpx>=0.28.1",
1313
"markdownify>=1.1.0",
1414
"langchain-anthropic>=0.3.10",
15+
"langchain-openai>=0.3.11",
1516
"langchain-mcp-adapters>=0.0.5",
1617
"langgraph>=0.3.21",
1718
"langgraph-swarm>=0.0.7",

examples/research/src/agent/agent.ipynb

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"outputs": [],
1212
"source": [
13-
"! pip install langchain-mcp-adapters langgraph \"langchain[anthropic]\" langgraph-swarm httpx markdownify"
13+
"! pip install langchain-mcp-adapters langgraph \"langchain[anthropic]\" \"langchain[openai]\" langgraph-swarm httpx markdownify"
1414
]
1515
},
1616
{
@@ -32,7 +32,7 @@
3232
},
3333
{
3434
"cell_type": "code",
35-
"execution_count": 3,
35+
"execution_count": null,
3636
"metadata": {},
3737
"outputs": [],
3838
"source": [
@@ -43,12 +43,16 @@
4343
"from langgraph.prebuilt import create_react_agent\n",
4444
"from langgraph_swarm import create_handoff_tool, create_swarm\n",
4545
"\n",
46-
"# LLM\n",
46+
"# Reasoning model (Anthropic)\n",
4747
"model = init_chat_model(model=\"claude-3-7-sonnet-latest\", \n",
4848
" model_provider=\"anthropic\", \n",
4949
" max_tokens=20_000, \n",
5050
" thinking={\"type\": \"enabled\", \"budget_tokens\": 16_000})\n",
5151
"\n",
52+
"# Chat model (OpenAI)\n",
53+
"model = init_chat_model(model=\"gpt-4o\", \n",
54+
" model_provider=\"openai\")\n",
55+
"\n",
5256
"# Handoff tools\n",
5357
"transfer_to_planner_agent = create_handoff_tool(\n",
5458
" agent_name=\"planner_agent\",\n",
@@ -231,13 +235,6 @@
231235
"source": [
232236
"result"
233237
]
234-
},
235-
{
236-
"cell_type": "code",
237-
"execution_count": null,
238-
"metadata": {},
239-
"outputs": [],
240-
"source": []
241238
}
242239
],
243240
"metadata": {

examples/research/src/agent/agent.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

22
from langchain.chat_models import init_chat_model
3-
43
from langgraph.prebuilt import create_react_agent
54
from langgraph_swarm import create_handoff_tool, create_swarm
65

@@ -9,10 +8,8 @@
98
from swarm_researcher.utils import fetch_doc
109

1110
# LLM
12-
model = init_chat_model(model="claude-3-7-sonnet-latest",
13-
model_provider="anthropic",
14-
max_tokens=20_000,
15-
thinking={"type": "enabled", "budget_tokens": 16_000})
11+
model = init_chat_model(model="gpt-4o",
12+
model_provider="openai")
1613

1714
# Handoff tools
1815
transfer_to_planner_agent = create_handoff_tool(
@@ -29,7 +26,6 @@
2926
num_urls = 3
3027
planner_prompt_formatted = planner_prompt.format(llms_txt=llms_txt, num_urls=num_urls)
3128

32-
3329
# Planner agent
3430
planner_agent = create_react_agent(model,
3531
prompt=planner_prompt_formatted,

0 commit comments

Comments
 (0)