| """ | |
| Shared state schema for the multi-agent debate. | |
| Uses LangGraph's Annotated pattern with operator.add | |
| so that each agent's messages are appended to the history. | |
| """ | |
| import operator | |
| from typing import Annotated, TypedDict | |
| from langchain_core.messages import BaseMessage | |
| class DebateState(TypedDict): | |
| """ | |
| State that flows through the LangGraph debate workflow. | |
| Attributes: | |
| messages: Conversation history (appended by each agent). | |
| user_request: The original user query. | |
| current_round: Current debate round (1-based, max 4). | |
| decision_reached: Whether the moderator has reached a final decision. | |
| final_decision: The extracted final decision text (if any). | |
| """ | |
| messages: Annotated[list[BaseMessage], operator.add] | |
| user_request: str | |
| location: str | |
| current_round: int | |
| decision_reached: bool | |
| final_decision: str | |