Class SkillPromptBuilder
java.lang.Object
io.agentscope.harness.agent.skill.runtime.SkillPromptBuilder
Renders the harness
<available_skills> system-prompt block from a SkillCatalog.
Differences from the legacy AgentSkillPromptProvider:
- Each
<skill>optionally carries a<files-root>child giving the absolute path to that skill's files. The middleware decides whether to populate this based on shell availability and skill source. - The
<code_execution>section is emitted only when at least one entry in the catalog has a non-nullfilesRoot(i.e. shell is available and at least one skill's files are reachable). The new instruction tells the LLM to use each skill's<files-root>rather than a single hardcoded root. - Resource fallback for non-SKILL.md paths is implemented by
SkillLoadTool; the prompt does not need to mention it.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSkillPromptBuilder(String header, String codeExecutionInstruction, boolean exposeAllMetadata) -
Method Summary
Modifier and TypeMethodDescriptionrender(SkillCatalog catalog) Convenience overload used by the middleware when no extra filter is active.render(SkillCatalog catalog, io.agentscope.core.skill.SkillFilter filter) Render the prompt block.
-
Field Details
-
DEFAULT_HEADER
- See Also:
-
DEFAULT_CODE_EXECUTION_INSTRUCTION
- See Also:
-
-
Constructor Details
-
SkillPromptBuilder
public SkillPromptBuilder() -
SkillPromptBuilder
-
-
Method Details
-
render
Render the prompt block. Returns an empty string when no skills pass the filter, so the caller can no-op concatenation.- Parameters:
catalog- the per-call snapshot (non-null)filter- visibility filter applied per skillId (non-null; useSkillFilter.all())- Returns:
- prompt text, or empty string when nothing is visible
-
render
Convenience overload used by the middleware when no extra filter is active.
-