Files
FiDA_Python/src/server/agent/state.py
2026-03-12 13:13:52 +08:00

12 lines
446 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import operator
from typing import Annotated, Sequence, TypedDict, Union, Optional
from langchain_core.messages import BaseMessage
class AgentState(TypedDict):
# messages 存储完整的对话历史operator.add 表示新消息是追加而不是覆盖
messages: Annotated[Sequence[BaseMessage], operator.add]
# next 存储 Supervisor 决定的下一步是谁
next: str
require_suggestion: bool # 是否需要建议按钮