small refactor of the structure
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
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]
|
||||
discord_user_id: int | None # set by the Discord bot, None for REST API calls
|
||||
Reference in New Issue
Block a user