Class SubagentSpecGenerator

java.lang.Object
io.agentscope.harness.agent.subagent.SubagentSpecGenerator

public final class SubagentSpecGenerator extends Object
LLM-driven generator for SubagentDeclaration markdown specs.

Given a free-form description of an agent's purpose, prompts the supplied Model to emit a markdown document with YAML frontmatter conforming to AgentSpecLoader's schema. The output is parseable round-trip via AgentSpecLoader.parse(java.lang.String, java.lang.String, java.nio.file.Path).

This is the Java analogue of opencode's Agent.generate flow ( opencode/packages/opencode/src/agent/agent.ts). Intended to be called from a CLI scaffolder or from AgentGenerateTool during a live session.

Reuses the same model.stream(messages, null, null).reduce(...) pattern used by ConversationCompactor for one-shot LLM calls, so behaviour stays consistent with other internal LLM users in the harness.