config.py 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. """
  2. 项目配置
  3. 定义项目的运行配置。
  4. """
  5. from agent.core.runner import KnowledgeConfig, RunConfig
  6. # ===== Agent 运行配置 =====
  7. RUN_CONFIG = RunConfig(
  8. # 模型配置
  9. model="qwen3.5-plus",
  10. temperature=0.3,
  11. max_iterations=1000,
  12. # 启用 thinking 模式
  13. extra_llm_params={"extra_body": {"enable_thinking": True}},
  14. # Agent 预设(对应 presets.json 中的 "main")
  15. agent_type="main",
  16. # 额外工具:需求库检索(在 core 工具组基础上追加)
  17. tools=["requirement_search", "search_category_tree", "extract_requirements_from_table"],
  18. # 工具分组:core(基础能力)+ knowledge(ask_knowledge / upload_knowledge)
  19. tool_groups=["core", "knowledge", "category"],
  20. # 任务名称
  21. name="图像还原执行",
  22. # 知识管理配置
  23. knowledge=KnowledgeConfig(
  24. # 压缩时提取
  25. enable_extraction=False,
  26. reflect_prompt="",
  27. # agent 运行完成后提取
  28. enable_completion_extraction=True,
  29. completion_reflect_prompt="",
  30. # 知识注入
  31. enable_injection=False,
  32. # 默认字段
  33. owner="sunlit.howard@gmail.com",
  34. default_tags={"project": "production_restore", "domain": "ai_image"},
  35. default_scopes=["org:cybertogether"],
  36. default_search_types=["strategy"],
  37. default_search_owner="sunlit.howard@gmail.com"
  38. )
  39. )
  40. # ===== 任务配置 =====
  41. INPUT_DIR = "examples/production_restore/input" # 输入目录(pipeline.json、analysis.json 等)
  42. OUTPUT_DIR = "examples/production_restore/output_origin" # 输出目录
  43. FEATURES_DIR = "examples/production_restore/features" # 素材目录
  44. # ===== 基础设施配置 =====
  45. SKILLS_DIR = "./skills"
  46. TRACE_STORE_PATH = ".trace"
  47. DEBUG = True
  48. LOG_LEVEL = "INFO"
  49. LOG_FILE = None # 设置为文件路径可以同时输出到文件
  50. # ===== 浏览器配置 =====
  51. # 可选值: "cloud" (云浏览器) 或 "local" (本地浏览器) 或 "container" (容器浏览器,支持预配置账户)
  52. BROWSER_TYPE = "local"
  53. HEADLESS = False
  54. # ===== IM 配置 =====
  55. IM_ENABLED = False # 是否启动 IM Client
  56. IM_CONTACT_ID = "agent_restore" # Agent 在 IM 系统中的身份 ID
  57. IM_SERVER_URL = "ws://43.106.118.91:8105" # IM Server WebSocket 地址
  58. IM_WINDOW_MODE = True # 窗口模式(True=每次运行消息隔离,推荐)
  59. IM_NOTIFY_INTERVAL = 10.0 # 新消息检查间隔(秒)
  60. # ===== Knowledge Manager 配置 =====
  61. KNOWLEDGE_MANAGER_ENABLED = False # 是否启动 Knowledge Manager(作为后台 IM Client)
  62. KNOWLEDGE_MANAGER_CONTACT_ID = "knowledge_manager" # Knowledge Manager 的 IM 身份 ID
  63. KNOWLEDGE_MANAGER_ENABLE_DB_COMMIT = False # 是否允许入库(False=只缓存,True=可入库)