Improve data skill routing and tool organization

This commit is contained in:
武阳
2026-05-06 21:46:09 +08:00
parent 4d3981cccd
commit 1aafc0fce7
16 changed files with 1342 additions and 955 deletions
+18
View File
@@ -6,6 +6,7 @@ from pathlib import Path
from .agent_context import build_context_snapshot
from .agent_tools import AgentTool
from .agent_types import AgentRuntimeConfig, ModelConfig
from .bundled_skills import format_skills_for_system_prompt
from .builtin_agents import AgentDefinition, format_agent_listing
SYSTEM_PROMPT_DYNAMIC_BOUNDARY = '__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__'
@@ -98,6 +99,7 @@ def build_system_prompt_parts(
get_doing_tasks_section(),
get_actions_section(),
get_using_your_tools_section(enabled_tool_names),
get_skill_guidance_section(prompt_context, enabled_tool_names),
get_agent_guidance_section(enabled_tool_names, available_agents),
get_plugin_guidance_section(prompt_context),
get_mcp_guidance_section(prompt_context),
@@ -236,6 +238,22 @@ def get_using_your_tools_section(enabled_tool_names: set[str]) -> str:
return '\n'.join(['# 使用工具', *prepend_bullets(items)])
def get_skill_guidance_section(
prompt_context: PromptContext,
enabled_tool_names: set[str],
) -> str:
if 'Skill' not in enabled_tool_names:
return ''
skill_listing = format_skills_for_system_prompt(cwd=prompt_context.cwd)
items = [
'当用户请求符合某个 skill 的适用范围时,优先调用 Skill 工具进入该 skill,不要先用 Agent 子任务或通用搜索绕路。',
'数据生成、标签边界、产品定义、示例 query 到数据集这类任务,优先使用 product-data skill。',
'线上 badcase 挖掘、router session 检索、候选转样本这类任务,优先使用 online-mining skill。',
'调用 skill 后遵守 skill 内部的人类 review 门禁和允许工具列表。',
]
return '\n'.join(['# Skills', *prepend_bullets(items), '', skill_listing])
def get_tone_and_style_section() -> str:
items = [
'回复保持简洁直接。',