config.py 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. """
  2. 项目配置
  3. 定义项目的运行配置。
  4. """
  5. from agent.core.runner import KnowledgeConfig, RunConfig
  6. # ===== Agent 运行配置 =====
  7. RUN_CONFIG = RunConfig(
  8. # 模型配置
  9. model="anthropic/claude-sonnet-4.6",
  10. # model="google/gemini-3-flash-preview",
  11. temperature=0.3,
  12. max_iterations=200,
  13. # 任务名称
  14. name="选题点整体推导任务",
  15. # 知识管理配置
  16. knowledge=KnowledgeConfig(
  17. # 压缩时提取(消息量超阈值触发压缩时,用完整 history 反思)
  18. enable_extraction=False,
  19. reflect_prompt="", # 自定义反思 prompt;空则使用默认,见 agent/core/prompts/knowledge.py:REFLECT_PROMPT
  20. # agent运行完成后提取(不代表任务完成,agent 可能中途退出等待人工评估)
  21. enable_completion_extraction=False,
  22. completion_reflect_prompt="", # 自定义复盘 prompt;空则使用默认,见 agent/core/prompts/knowledge.py:COMPLETION_REFLECT_PROMPT
  23. # 知识注入(agent切换当前工作的goal时,自动注入相关知识)
  24. enable_injection=False,
  25. # 默认字段(保存/搜索时自动注入)
  26. owner="", # 所有者(空则尝试从 git config user.email 获取,再空则用 agent:{agent_id})
  27. default_tags={"project": "how_derivation", "domain": "ai_agent"}, # 默认 tags(会与工具调用参数合并)
  28. default_scopes=["org:cybertogether"], # 默认 scopes
  29. default_search_types=[], # 默认搜索类型过滤
  30. default_search_owner="" # 默认搜索 owner 过滤(空则不过滤,支持多个owner用逗号分隔,如 "user1@example.com,user2@example.com")
  31. )
  32. )
  33. # ===== 基础设施配置 =====
  34. SKILLS_DIR = "./skills"
  35. TRACE_STORE_PATH = ".trace"
  36. DEBUG = True
  37. LOG_LEVEL = "INFO"
  38. LOG_FILE = None # 设置为文件路径可以同时输出到文件
  39. # ===== 浏览器配置 =====
  40. # 可选值: "cloud" (云浏览器) 或 "local" (本地浏览器)
  41. BROWSER_TYPE = "local"
  42. HEADLESS = False