config.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. """
  2. 项目配置
  3. """
  4. from agent.core.runner import KnowledgeConfig, RunConfig
  5. # ===== 主 Agent 配置(Coordinator,负责分发调研方向 + 汇总策略)=====
  6. # 是否开启子 Agent 真并发调研(极大榨取网络 IO 速度)
  7. PARALLEL_TOOL_EXECUTION = True
  8. COORDINATOR_RUN_CONFIG = RunConfig(
  9. model="qwen-plus",
  10. temperature=0.3,
  11. max_iterations=800,
  12. parallel_tool_execution=PARALLEL_TOOL_EXECUTION,
  13. extra_llm_params={},
  14. agent_type="coordinator",
  15. name="工序调研协调器",
  16. knowledge=KnowledgeConfig(
  17. enable_extraction=False,
  18. enable_completion_extraction=False,
  19. enable_injection=False,
  20. owner="sunlit.howard@gmail.com",
  21. )
  22. )
  23. # ===== 输出目录 =====
  24. OUTPUT_DIR = "examples/process_research/output" # 每个需求输出到 output/{N}/
  25. # ===== 基础设施配置 =====
  26. SKILLS_DIR = "./skills"
  27. TRACE_STORE_PATH = ".trace"
  28. DEBUG = True
  29. LOG_LEVEL = "INFO"
  30. LOG_FILE = None
  31. # ===== 浏览器配置 =====
  32. # 当 PARALLEL_TOOL_EXECUTION=True 时,强烈建议使用 cloud(云浏览器)或 headless,否则本地会出现抢鼠标冲突!
  33. BROWSER_TYPE = "local" if not PARALLEL_TOOL_EXECUTION else "cloud"
  34. HEADLESS = False
  35. # ===== IM 配置 =====
  36. IM_ENABLED = True
  37. IM_CONTACT_ID = "agent_research"
  38. IM_SERVER_URL = "ws://43.106.118.91:8105"
  39. IM_WINDOW_MODE = True
  40. IM_NOTIFY_INTERVAL = 10.0
  41. # ===== 远端 Research Agent 配置 =====
  42. # 此 pipeline 的 researcher 子 Agent 需要写文件到本地 output_dir,
  43. # 因此必须使用本地模式(USE_REMOTE_RESEARCH = False)。
  44. # 远端模式(True)仅适用于不需要写本地文件的单体 Agent 场景。
  45. USE_REMOTE_RESEARCH = False
  46. # 线上 KnowHub 地址(也可通过 .env 的 KNOWHUB_API 变量覆盖)
  47. # subagent._run_remote_agent 运行时会读取 KNOWHUB_API 环境变量
  48. # 这里显式设置以便 config 层可见
  49. import os as _os
  50. _os.environ.setdefault("KNOWHUB_API", "http://43.106.118.91:9999")