config.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. # 压缩时提取(消息量超阈值触发压缩时,用完整 history 反思)
  21. enable_extraction=False,
  22. reflect_prompt="", # 自定义反思 prompt;空则使用默认,见 agent/core/prompts/knowledge.py:REFLECT_PROMPT
  23. # agent运行完成后提取(不代表任务完成,agent 可能中途退出等待人工评估)
  24. enable_completion_extraction=False,
  25. completion_reflect_prompt="", # 自定义复盘 prompt;空则使用默认,见 agent/core/prompts/knowledge.py:COMPLETION_REFLECT_PROMPT
  26. # 知识注入(agent切换当前工作的goal时,自动注入相关知识)
  27. enable_injection=False,
  28. # 默认字段(保存/搜索时自动注入)
  29. owner="sunlit.howard@gmail.com", # 所有者(空则尝试从 git config user.email 获取,再空则用 agent:{agent_id})
  30. default_tags={"project": "research", "domain": "ai_agent"}, # 默认 tags(会与工具调用参数合并)
  31. default_scopes=["org:cybertogether"], # 默认 scopes
  32. default_search_types=["strategy"], # 默认搜索类型过滤
  33. default_search_owner="sunlit.howard@gmail.com" # 默认搜索 owner 过滤(空则不过滤)
  34. )
  35. )
  36. # ===== 任务配置 =====
  37. INPUT_DIR = "examples/research/huahua" # 输入素材目录
  38. OUTPUT_DIR = "examples/research/outputs/huahua_3" # 输出目录 ID,输出保存在 examples/plan/outputs/{OUTPUT_DIR}/
  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