Implement LangGraph integration: refactor agent-tool interaction, add graph compilation, and enhance state management
Build and Push Agent API / build (push) Successful in 22s
Build and Push Agent API / build (push) Successful in 22s
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
"""
|
||||
LangGraph agent state — defines the shape of the state object that flows
|
||||
through every node in the agent graph.
|
||||
"""
|
||||
|
||||
from typing import Annotated, TypedDict
|
||||
|
||||
from langgraph.graph.message import add_messages
|
||||
|
||||
|
||||
class AgentState(TypedDict):
|
||||
"""
|
||||
The single source of truth that travels through every node in the graph.
|
||||
|
||||
`messages` uses LangGraph's `add_messages` reducer, which:
|
||||
- Appends new messages to the list.
|
||||
- Replaces messages with the same ID (useful for tool-call results).
|
||||
"""
|
||||
|
||||
messages: Annotated[list, add_messages]
|
||||
Reference in New Issue
Block a user