script_state.py 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. """
  2. Script Workflow State Definitions.
  3. Defines the state structure for the Script workflow.
  4. """
  5. from typing import TypedDict, List, Dict, Any, Optional
  6. class ScriptState(TypedDict, total=False):
  7. """脚本理解工作流状态"""
  8. # ========== 输入数据 ==========
  9. text: Dict[str, Any] # {title, body}
  10. images: List[str] # 图片路径列表
  11. topic_selection_understanding: Optional[Dict[str, Any]] # 选题理解结果
  12. content_weight: Optional[Dict[str, Any]] # 内容权重结果
  13. inspiration_points: Optional[List[Dict[str, Any]]] # 灵感点列表
  14. purpose_points: Optional[List[Dict[str, Any]]] # 目的点列表
  15. key_points: Optional[List[Dict[str, Any]]] # 关键点列表
  16. # ========== 段落划分结果 ==========
  17. section_division: Optional[Dict[str, Any]] # 段落划分结果
  18. 内容品类: str # 内容品类
  19. 段落列表: List[Dict[str, Any]] # 段落列表
  20. # ========== SubstanceExtractionAgent 输出(实质提取)==========
  21. concrete_elements: List[Dict[str, Any]] # 具体元素列表
  22. concrete_concepts: List[Dict[str, Any]] # 具象概念列表
  23. implicit_concepts: List[Dict[str, Any]] # 隐含概念列表
  24. abstract_concepts: List[Dict[str, Any]] # 抽象概念列表
  25. substance_elements: List[Dict[str, Any]] # 合并后的实质元素
  26. substance_analyzed_result: List[Dict[str, Any]] # Step 3: 共性分析结果
  27. substance_scored_result: Dict[str, Any] # Step 4: 评分结果
  28. substance_filtered_ids: List[int] # Step 5: 筛选的元素ID
  29. substance_categorized_result: Dict[str, Any] # Step 6: 分类结果
  30. substance_final_elements: List[Dict[str, Any]] # 实质元素最终结果
  31. # ========== FormExtractionAgent 输出(形式提取)==========
  32. concrete_concept_forms: List[Dict[str, Any]] # 具象概念形式
  33. concrete_element_forms: List[Dict[str, Any]] # 具体元素形式
  34. overall_forms: List[Dict[str, Any]] # 整体形式
  35. form_elements: List[Dict[str, Any]] # 合并后的形式元素
  36. form_analyzed_result: List[Dict[str, Any]] # Step 4: 共性分析结果
  37. form_scored_result: Dict[str, Any] # Step 5: 支撑判断结果
  38. form_weighted_result: Dict[str, Any] # Step 6: 权重计算结果
  39. form_filtered_ids: List[int] # Step 7: 筛选的元素ID
  40. form_categorized_result: Dict[str, Any] # Step 8: 分类结果
  41. form_final_elements: List[Dict[str, Any]] # 形式元素最终结果
  42. # ========== 分离后的元素列表 ==========
  43. 实质列表: List[Dict[str, Any]] # 实质元素列表
  44. 形式列表: List[Dict[str, Any]] # 形式元素列表
  45. 帖子倾向判断: Optional[Dict[str, Any]] # 帖子倾向判断
  46. # ========== 最终输出 ==========
  47. final_result: Dict[str, Any] # 最终的结果