Class AguiAdapterConfig

java.lang.Object
io.agentscope.core.agui.adapter.AguiAdapterConfig

public class AguiAdapterConfig extends Object
Configuration for the AG-UI agent adapter.

This class provides configuration options for how the adapter handles tool merging, state events, and other behaviors.

  • Method Details

    • getToolMergeMode

      public io.agentscope.core.tool.ToolMergeMode getToolMergeMode()
      Get the tool merge mode.
      Returns:
      The tool merge mode
    • isEmitStateEvents

      public boolean isEmitStateEvents()
      Check if state events should be emitted.
      Returns:
      true if state events should be emitted
    • isEmitToolCallArgs

      public boolean isEmitToolCallArgs()
      Check if tool call arguments should be streamed.
      Returns:
      true if tool call args events should be emitted
    • isEmitTokenUsage

      public boolean isEmitTokenUsage()
      Check if model token usage should be emitted.

      When enabled, ModelCallEndEvent usage is accumulated and emitted as AG-UI CUSTOM events named token_usage. Default is false.

      Returns:
      true if token usage events should be emitted
    • isEnableReasoning

      public boolean isEnableReasoning()
      Check if reasoning/thinking content should be emitted.

      When enabled, ThinkingBlock content will be converted to REASONING_* events according to the AG-UI Reasoning draft specification. When disabled (default), ThinkingBlock content is ignored and no reasoning events are emitted.

      Returns:
      true if reasoning events should be emitted
    • isEmitRunFinishedAfterError

      public boolean isEmitRunFinishedAfterError()
      Check whether RUN_FINISHED should be emitted after RUN_ERROR.

      AG-UI treats RUN_ERROR and RUN_FINISHED as mutually exclusive terminal events. Default is false (standard AG-UI). Set true only for legacy clients that still expect a finish event after an error.

      Returns:
      true if RUN_FINISHED should follow RUN_ERROR
    • getRunTimeout

      public Duration getRunTimeout()
      Get the run timeout duration.
      Returns:
      The run timeout
    • getDefaultAgentId

      public String getDefaultAgentId()
      Get the default agent ID.
      Returns:
      The default agent ID, or null if not set
    • getEventConverters

      public List<AgentEventConverter> getEventConverters()
      Get custom AgentEvent converters.
      Returns:
      Custom event converters
    • getEventEnrichers

      public List<AguiEventEnricher> getEventEnrichers()
      Get configured AG-UI event enrichers, including the default base properties enricher when enabled.
      Returns:
      AG-UI event enrichers
    • isBaseEventPropertiesEnricherEnabled

      public boolean isBaseEventPropertiesEnricherEnabled()
      Check whether the default base event properties enricher is enabled.
      Returns:
      true if the default base event properties enricher is enabled
    • isEmitSubagentEventsAsNative

      public boolean isEmitSubagentEventsAsNative()
      When false (default), AgentEvents with a non-null source (subagent events) are emitted as AG-UI CUSTOM events under the subagent.* namespace instead of native TEXT_MESSAGE_* / run lifecycle events.
      Returns:
      true to keep the legacy native presentation for subagent events
    • builder

      public static AguiAdapterConfig.Builder builder()
      Creates a new builder for AguiAdapterConfig.
      Returns:
      A new builder instance
    • defaultConfig

      public static AguiAdapterConfig defaultConfig()
      Creates a default configuration.
      Returns:
      Default configuration