4b43c5d3e4
agent/ state.py: AgentState TypedDict(20字段含意图/压缩/会话/撤销) nodes.py: 17个节点函数(生成/修改/验证/纠错/意图分类/压缩/撤销/重置) graph.py: 17节点状态图,8意图路由分发 验证服务 validation_service/ main.py: FastAPI服务,lxml XSD验证 + 结构化检查(字段引用/SQL/尺寸) 数据 data/ sample_templates/: 4个JRXML示例模板 corrections/: 3个错误修正案例 脚本 scripts/ init_kb.py: Chroma知识库初始化
34 lines
766 B
Python
34 lines
766 B
Python
"""LangGraph JRXML 生成代理工作流的状态定义。"""
|
|
|
|
from typing import TypedDict, List
|
|
|
|
|
|
class AgentState(TypedDict, total=False):
|
|
# 核心工作流字段
|
|
conversation_history: List[dict]
|
|
current_jrxml: str
|
|
user_input: str
|
|
status: str
|
|
error_msg: str
|
|
natural_explanation: str
|
|
retry_count: int
|
|
user_modification_request: str
|
|
final_jrxml: str
|
|
stage: str
|
|
retrieved_context: str
|
|
|
|
# 需求1:智能上下文压缩
|
|
full_conversation_history: List[dict]
|
|
compressed_history: str
|
|
current_token_count: int
|
|
|
|
# 需求2:多会话持久化
|
|
session_id: str
|
|
session_name: str
|
|
created_at: str
|
|
updated_at: str
|
|
|
|
# 需求3:意图识别
|
|
intent: str
|
|
history_states: List[dict]
|