类 StructuredOutputCapableAgent

java.lang.Object
io.agentscope.core.agent.AgentBase
io.agentscope.core.agent.StructuredOutputCapableAgent
所有已实现的接口:
Agent, CallableAgent, ObservableAgent, StreamableAgent, StateModule
直接已知子类:
ReActAgent

public abstract class StructuredOutputCapableAgent extends AgentBase
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:

  • 字段详细资料

    • STRUCTURED_OUTPUT_TOOL_NAME

      public static final String STRUCTURED_OUTPUT_TOOL_NAME
      The tool name for structured output generation.
      另请参阅:
    • toolkit

      protected final Toolkit toolkit
    • structuredOutputReminder

      protected final StructuredOutputReminder 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

      public Toolkit getToolkit()
      Get the toolkit for tool operations.
    • getMemory

      public abstract Memory getMemory()
      Get the memory for structured output hook. Subclasses must implement this.
    • buildGenerateOptions

      protected abstract GenerateOptions 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)
      从类复制的说明: AgentBase
      Internal implementation for processing multiple messages with structured output. Subclasses that support structured output must override this method. Default implementation throws UnsupportedOperationException.
      覆盖:
      doCall 在类中 AgentBase
      参数:
      msgs - Input messages
      structuredOutputClass - Class defining the structure
      返回:
      Response message with structured data in metadata
    • doCall

      protected final reactor.core.publisher.Mono<Msg> doCall(List<Msg> msgs, com.fasterxml.jackson.databind.JsonNode outputSchema)
      从类复制的说明: AgentBase
      Internal implementation for processing multiple messages with structured output. Subclasses that support structured output must override this method. Default implementation throws UnsupportedOperationException.
      覆盖:
      doCall 在类中 AgentBase
      参数:
      msgs - Input messages
      outputSchema - com.fasterxml.jackson.databind.JsonNode instance defining the structure
      返回:
      Response message with structured data in metadata