feat: upgrade LangGraph to 1.x and migrate deprecated APIs
- Bump langgraph from 0.4 to 1.0+, langgraph-supervisor from 0.0.12 to 0.0.30+ - Bump langchain-core, langchain-anthropic, langchain-openai to 1.x - Add langchain>=1.0 dependency for new create_agent location - Migrate create_react_agent -> create_agent (prompt -> system_prompt) - Fix create_supervisor positional arg to named agents= parameter - Replace AsyncMock checkpointer with InMemorySaver in tests (v1 type validation) - Update version references in README, ARCHITECTURE, eng-review-plan
This commit is contained in:
@@ -5,7 +5,7 @@ from __future__ import annotations
|
||||
import logging
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from langgraph.prebuilt import create_react_agent
|
||||
from langchain.agents import create_agent
|
||||
from langgraph_supervisor import create_supervisor
|
||||
|
||||
from app.agents import get_tools_by_names
|
||||
@@ -59,11 +59,11 @@ def build_agent_nodes(
|
||||
f"Permission level: {agent_config.permission}."
|
||||
)
|
||||
|
||||
agent_node = create_react_agent(
|
||||
agent_node = create_agent(
|
||||
model=llm,
|
||||
tools=tools,
|
||||
name=agent_config.name,
|
||||
prompt=system_prompt,
|
||||
system_prompt=system_prompt,
|
||||
)
|
||||
agent_nodes.append(agent_node)
|
||||
|
||||
@@ -88,7 +88,7 @@ def build_graph(
|
||||
prompt = SUPERVISOR_PROMPT.format(agent_descriptions=agent_descriptions)
|
||||
|
||||
workflow = create_supervisor(
|
||||
agent_nodes,
|
||||
agents=agent_nodes,
|
||||
model=llm,
|
||||
prompt=prompt,
|
||||
output_mode="full_history",
|
||||
|
||||
Reference in New Issue
Block a user