| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- """
- 运行配置 — 自动化投放 Agent 系统
- """
- from pathlib import Path
- from agent.core.runner import RunConfig, KnowledgeConfig
- # ===== 工具白名单 =====
- # 只暴露业务工具,避免 LLM 误调 IM/知识库/浏览器等非业务工具
- ANALYSIS_TOOLS = [
- # 预算出价
- "account_evaluate",
- "budget_calculate_from_data",
- # 数据查询
- "data_query",
- "data_aggregate",
- "get_ad_current_status",
- # 广告 API(只读)
- "account_get_info",
- "ad_get_list",
- "ad_get_report",
- "creative_get_report",
- "asset_get_list",
- "audience_get_list",
- # 人群定向
- "audience_build_targeting",
- "audience_recommend_targeting",
- # 监控
- "monitor_check_metrics",
- ]
- EXECUTION_TOOLS = ANALYSIS_TOOLS + [
- # 执行类工具(仅执行 Agent 使用)
- "execute_adjustment_plan",
- "bid_adjustment_execute",
- "ad_create",
- "ad_update",
- "ad_batch_update_status",
- "creative_create",
- "creative_update",
- "monitor_circuit_break",
- ]
- # ===== 分析 Agent 配置(默认,只输出方案不执行) =====
- RUN_CONFIG = RunConfig(
- model="qwen/qwen3.5-plus-02-15",
- temperature=0.3,
- max_iterations=50,
- name="自动化投放系统",
- tools=ANALYSIS_TOOLS,
- skills=["planning", "ad_domain", "budget_strategy"],
- extra_llm_params={"extra_body": {"enable_thinking": True}},
- knowledge=KnowledgeConfig(
- enable_extraction=False,
- enable_completion_extraction=False,
- enable_injection=False,
- owner="ad_placement_team",
- ),
- )
- # ===== 执行 Agent 配置 =====
- EXECUTE_CONFIG = RunConfig(
- model="qwen/qwen3.5-plus-02-15",
- temperature=0.1, # 执行Agent更低温度,减少随机性
- max_iterations=30,
- name="投放执行系统",
- tools=EXECUTION_TOOLS,
- skills=["planning", "ad_domain", "budget_strategy", "monitor_rules"],
- extra_llm_params={"extra_body": {"enable_thinking": True}},
- knowledge=KnowledgeConfig(
- enable_extraction=False,
- enable_completion_extraction=False,
- enable_injection=False,
- owner="ad_placement_team",
- ),
- )
- # 基础设施配置
- SKILLS_DIR = str(Path(__file__).parent / "skills")
- TRACE_STORE_PATH = ".trace"
- LOG_LEVEL = "INFO"
- LOG_FILE = None
|