Add skill enable controls and data factory SQL skill
This commit is contained in:
+20
-5
@@ -99,7 +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_skill_guidance_section(prompt_context, runtime_config, enabled_tool_names),
|
||||
get_agent_guidance_section(enabled_tool_names, available_agents),
|
||||
get_plugin_guidance_section(prompt_context),
|
||||
get_mcp_guidance_section(prompt_context),
|
||||
@@ -240,17 +240,32 @@ def get_using_your_tools_section(enabled_tool_names: set[str]) -> str:
|
||||
|
||||
def get_skill_guidance_section(
|
||||
prompt_context: PromptContext,
|
||||
runtime_config: AgentRuntimeConfig,
|
||||
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)
|
||||
skill_listing = format_skills_for_system_prompt(
|
||||
cwd=prompt_context.cwd,
|
||||
enabled_skill_names=runtime_config.enabled_skill_names,
|
||||
)
|
||||
enabled_skill_names = (
|
||||
{
|
||||
name.strip().lower()
|
||||
for name in runtime_config.enabled_skill_names
|
||||
if name.strip()
|
||||
}
|
||||
if runtime_config.enabled_skill_names is not None
|
||||
else None
|
||||
)
|
||||
items = [
|
||||
'当用户请求符合某个 skill 的适用范围时,优先调用 Skill 工具进入该 skill,不要先用 Agent 子任务或通用搜索绕路。',
|
||||
'数据生成、标签边界、产品定义、示例 query 到数据集这类任务,优先使用 product-data skill。',
|
||||
'线上 badcase 挖掘、router session 检索、候选转样本这类任务,优先使用 online-mining skill。',
|
||||
'调用 skill 后遵守 skill 内部的人类 review 门禁和允许工具列表。',
|
||||
]
|
||||
if enabled_skill_names is None or 'product-data' in enabled_skill_names:
|
||||
items.append('数据生成、标签边界、产品定义、示例 query 到数据集这类任务,优先使用 product-data skill。')
|
||||
if enabled_skill_names is None or 'online-mining' in enabled_skill_names:
|
||||
items.append('线上 badcase 挖掘、router session 检索、候选转样本这类任务,优先使用 online-mining skill。')
|
||||
items.append('调用 skill 后遵守 skill 内部的人类 review 门禁和允许工具列表。')
|
||||
return '\n'.join(['# Skills', *prepend_bullets(items), '', skill_listing])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user