类 AgentSkillPromptProvider
java.lang.Object
io.agentscope.core.skill.AgentSkillPromptProvider
Generates skill system prompts for agents to understand available skills.
This provider creates system prompts containing information about available skills that the LLM can dynamically load and use.
Usage example:
AgentSkillPromptProvider provider = new AgentSkillPromptProvider(registry);
String prompt = provider.getSkillSystemPrompt();
-
字段概要
字段 -
构造器概要
构造器构造器说明AgentSkillPromptProvider(io.agentscope.core.skill.SkillRegistry registry) Creates a skill prompt provider.AgentSkillPromptProvider(io.agentscope.core.skill.SkillRegistry registry, String instruction) Creates a skill prompt provider with custom instruction. -
方法概要
修饰符和类型方法说明Gets the skill system prompt for the agent.voidsetCodeExecutionEnable(boolean codeExecutionEnabled) Sets whether code execution instructions are included in the skill system prompt.voidsetCodeExecutionInstruction(String codeExecutionInstruction) Sets a custom code execution instruction template.voidsetExposeAllMetadata(boolean exposeAllMetadata) Sets whether all metadata fields are exposed to the LLM.voidsetUploadDir(Path uploadDir) Sets the upload directory whose absolute path replaces every%splaceholder in the code execution instruction template.
-
字段详细资料
-
DEFAULT_AGENT_SKILL_INSTRUCTION
- 另请参阅:
-
DEFAULT_CODE_EXECUTION_INSTRUCTION
- 另请参阅:
-
-
构造器详细资料
-
AgentSkillPromptProvider
public AgentSkillPromptProvider(io.agentscope.core.skill.SkillRegistry registry) Creates a skill prompt provider.- 参数:
registry- The skill registry containing registered skills
-
AgentSkillPromptProvider
public AgentSkillPromptProvider(io.agentscope.core.skill.SkillRegistry registry, String instruction) Creates a skill prompt provider with custom instruction.- 参数:
registry- The skill registry containing registered skillsinstruction- Custom instruction header (null or blank uses default)
-
-
方法详细资料
-
getSkillSystemPrompt
Gets the skill system prompt for the agent.Generates a system prompt containing all registered skills.
- 返回:
- The skill system prompt, or empty string if no skills exist
-
setCodeExecutionEnable
public void setCodeExecutionEnable(boolean codeExecutionEnabled) Sets whether code execution instructions are included in the skill system prompt.- 参数:
codeExecutionEnabled-trueto append code execution instructions
-
setUploadDir
Sets the upload directory whose absolute path replaces every%splaceholder in the code execution instruction template.- 参数:
uploadDir- the upload directory path, ornullto disable path substitution
-
setCodeExecutionInstruction
Sets a custom code execution instruction template.Every
%splaceholder in the template will be replaced with theuploadDirabsolute path. Passnullor blank to fall back toDEFAULT_CODE_EXECUTION_INSTRUCTION.- 参数:
codeExecutionInstruction- the custom template, ornull/blank for default
-
setExposeAllMetadata
public void setExposeAllMetadata(boolean exposeAllMetadata) Sets whether all metadata fields are exposed to the LLM.When disabled, only
name,description, andskill-idare rendered into the skill prompt.- 参数:
exposeAllMetadata-trueto expose all metadata,falseto expose only the core fields
-