config.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. # 任务名称
  17. name="图像还原执行",
  18. # 知识管理配置
  19. knowledge=KnowledgeConfig(
  20. # 压缩时提取
  21. enable_extraction=False,
  22. reflect_prompt="",
  23. # agent 运行完成后提取
  24. enable_completion_extraction=True,
  25. completion_reflect_prompt="",
  26. # 知识注入
  27. enable_injection=False,
  28. # 默认字段
  29. owner="sunlit.howard@gmail.com",
  30. default_tags={"project": "production_restore", "domain": "ai_image"},
  31. default_scopes=["org:cybertogether"],
  32. default_search_types=["strategy"],
  33. default_search_owner="sunlit.howard@gmail.com"
  34. )
  35. )
  36. # ===== 任务配置 =====
  37. INPUT_DIR = "examples/production_restore/input" # 输入目录(pipeline.json、analysis.json、research.json)
  38. OUTPUT_DIR = "examples/production_restore/output_feature" # 输出目录
  39. # ===== 基础设施配置 =====
  40. SKILLS_DIR = "./skills"
  41. TRACE_STORE_PATH = ".trace"
  42. DEBUG = True
  43. LOG_LEVEL = "INFO"
  44. LOG_FILE = None # 设置为文件路径可以同时输出到文件
  45. # ===== 浏览器配置 =====
  46. # 可选值: "cloud" (云浏览器) 或 "local" (本地浏览器) 或 "container" (容器浏览器,支持预配置账户)
  47. BROWSER_TYPE = "local"
  48. HEADLESS = False
  49. # ===== IM 配置 =====
  50. IM_ENABLED = False # 是否启动 IM Client
  51. IM_CONTACT_ID = "agent_restore" # Agent 在 IM 系统中的身份 ID
  52. IM_SERVER_URL = "ws://43.106.118.91:8105" # IM Server WebSocket 地址
  53. IM_WINDOW_MODE = True # 窗口模式(True=每次运行消息隔离,推荐)
  54. IM_NOTIFY_INTERVAL = 10.0 # 新消息检查间隔(秒)
  55. # ===== Knowledge Manager 配置 =====
  56. KNOWLEDGE_MANAGER_ENABLED = False # 是否启动 Knowledge Manager(作为后台 IM Client)
  57. KNOWLEDGE_MANAGER_CONTACT_ID = "knowledge_manager" # Knowledge Manager 的 IM 身份 ID
  58. KNOWLEDGE_MANAGER_ENABLE_DB_COMMIT = False # 是否允许入库(False=只缓存,True=可入库)