类 StructuredOutputCapableAgent
java.lang.Object
io.agentscope.core.agent.AgentBase
io.agentscope.core.agent.StructuredOutputCapableAgent
- 所有已实现的接口:
Agent,CallableAgent,ObservableAgent,StreamableAgent,StateModule
- 直接已知子类:
ReActAgent
Abstract base class for agents that support structured output generation.
This class provides the infrastructure for generating structured output using the
generate_response tool pattern combined with StructuredOutputHook for flow control.
Key Features:
- Automatic tool registration for structured output
- Schema validation before tool execution
- Memory compression after structured output completion
- Configurable reminder mode (TOOL_CHOICE or PROMPT)
Subclass Requirements:
- Provide Toolkit via constructor
- Implement
getMemory()for memory access - Implement
buildGenerateOptions()for model options
-
字段概要
字段修饰符和类型字段说明static final StringThe tool name for structured output generation.protected final StructuredOutputReminderprotected final Toolkit -
构造器概要
构造器限定符构造器说明protectedStructuredOutputCapableAgent(String name, String description, boolean checkRunning, List<Hook> hooks, Toolkit toolkit) Constructor with default reminder mode (TOOL_CHOICE).protectedStructuredOutputCapableAgent(String name, String description, boolean checkRunning, List<Hook> hooks, Toolkit toolkit, StructuredOutputReminder structuredOutputReminder) Constructor with custom reminder mode. -
方法概要
修饰符和类型方法说明protected abstract GenerateOptionsBuild generate options for model calls.protected final reactor.core.publisher.Mono<Msg> Internal implementation for processing multiple messages with structured output.protected final reactor.core.publisher.Mono<Msg> Internal implementation for processing multiple messages with structured output.abstract MemoryGet the memory for structured output hook.Get the toolkit for tool operations.从类继承的方法 io.agentscope.core.agent.AgentBase
addHook, addSystemHook, call, call, call, checkInterruptedAsync, doCall, doObserve, getAgentId, getDescription, getHooks, getInterruptFlag, getInterruptSource, getName, getSortedHooks, getSubscriberCount, handleInterrupt, hasSubscribers, interrupt, interrupt, interrupt, observe, observe, removeHook, removeSubscribers, removeSystemHook, resetInterruptFlag, resetSubscribers, stream, stream, stream, toString从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait从接口继承的方法 io.agentscope.core.state.StateModule
loadFrom, loadFrom, loadIfExists, loadIfExists, saveTo, saveTo
-
字段详细资料
-
STRUCTURED_OUTPUT_TOOL_NAME
The tool name for structured output generation.- 另请参阅:
-
toolkit
-
structuredOutputReminder
-
-
构造器详细资料
-
StructuredOutputCapableAgent
protected StructuredOutputCapableAgent(String name, String description, boolean checkRunning, List<Hook> hooks, Toolkit toolkit) Constructor with default reminder mode (TOOL_CHOICE). -
StructuredOutputCapableAgent
protected StructuredOutputCapableAgent(String name, String description, boolean checkRunning, List<Hook> hooks, Toolkit toolkit, StructuredOutputReminder structuredOutputReminder) Constructor with custom reminder mode.
-
-
方法详细资料
-
getToolkit
Get the toolkit for tool operations. -
getMemory
Get the memory for structured output hook. Subclasses must implement this. -
buildGenerateOptions
Build generate options for model calls. Subclasses must implement this. -
doCall
protected final reactor.core.publisher.Mono<Msg> doCall(List<Msg> msgs, Class<?> structuredOutputClass) 从类复制的说明:AgentBaseInternal implementation for processing multiple messages with structured output. Subclasses that support structured output must override this method. Default implementation throws UnsupportedOperationException. -
doCall
protected final reactor.core.publisher.Mono<Msg> doCall(List<Msg> msgs, com.fasterxml.jackson.databind.JsonNode outputSchema) 从类复制的说明:AgentBaseInternal implementation for processing multiple messages with structured output. Subclasses that support structured output must override this method. Default implementation throws UnsupportedOperationException.
-