23 lines
648 B
Python
23 lines
648 B
Python
"""图状态定义(作业 1)。
|
|||
|
|
|
||
|
|
最小状态只包含脚手架所需的五个字段;作业 3 会扩充领域状态
|
||
|
|
(阶段、事故字段、人员字段、澄清计数、本轮 patch 等)。
|
||
|
|
所有字段必须可序列化,不得保存 HTTP client、数据库连接等资源。
|
||
|
|
"""
|
||
|
|
|
||
|
|
from typing import TypedDict
|
||
|
|
|
||
|
|
|
||
|
|
class AgentState(TypedDict):
|
||
|
|
"""一次对话轮次在图中流动的状态。
|
||
|
|
|
||
|
|
``turn_count`` 由同一 ``thread_id`` 的 checkpoint 承载,
|
||
|
|
节点每轮只负责 +1,不负责跨会话记忆。
|
||
|
|
"""
|
||
|
|
|
||
|
|
session_id: str
|
||
|
|
turn_count: int
|
||
|
|
input_text: str
|
||
|
|
response_text: str
|
||
|
|
stage_code: str
|