File tree Expand file tree Collapse file tree 4 files changed +10
-17
lines changed
customer_support/src/agent Expand file tree Collapse file tree 4 files changed +10
-17
lines changed Original file line number Diff line number Diff line change 3232 }
3333]
3434
35-
3635# Flight tools
3736def search_flights (
3837 departure_airport : str ,
Original file line number Diff line number Diff 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" ,
Original file line number Diff line number Diff line change 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 {
3232 },
3333 {
3434 "cell_type" : " code" ,
35- "execution_count" : 3 ,
35+ "execution_count" : null ,
3636 "metadata" : {},
3737 "outputs" : [],
3838 "source" : [
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 " ,
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" : {
Original file line number Diff line number Diff line change 11
22from langchain .chat_models import init_chat_model
3-
43from langgraph .prebuilt import create_react_agent
54from langgraph_swarm import create_handoff_tool , create_swarm
65
98from 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
1815transfer_to_planner_agent = create_handoff_tool (
2926num_urls = 3
3027planner_prompt_formatted = planner_prompt .format (llms_txt = llms_txt , num_urls = num_urls )
3128
32-
3329# Planner agent
3430planner_agent = create_react_agent (model ,
3531 prompt = planner_prompt_formatted ,
You can’t perform that action at this time.
0 commit comments