Package io.agentscope.core.agui.adapter
Class AguiAdapterConfig
java.lang.Object
io.agentscope.core.agui.adapter.AguiAdapterConfig
Configuration for the AG-UI agent adapter.
This class provides configuration options for how the adapter handles tool merging, state events, and other behaviors.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for AguiAdapterConfig. -
Method Summary
Modifier and TypeMethodDescriptionstatic AguiAdapterConfig.Builderbuilder()Creates a new builder for AguiAdapterConfig.static AguiAdapterConfigCreates a default configuration.Get the default agent ID.Get custom AgentEvent converters.Get configured AG-UI event enrichers, including the default base properties enricher when enabled.Get the run timeout duration.io.agentscope.core.tool.ToolMergeModeGet the tool merge mode.booleanCheck whether the default base event properties enricher is enabled.booleanCheck whetherRUN_FINISHEDshould be emitted afterRUN_ERROR.booleanCheck if state events should be emitted.booleanWhenfalse(default), AgentEvents with a non-nullsource(subagent events) are emitted as AG-UICUSTOMevents under thesubagent.*namespace instead of nativeTEXT_MESSAGE_*/ run lifecycle events.booleanCheck if model token usage should be emitted.booleanCheck if tool call arguments should be streamed.booleanCheck if reasoning/thinking content should be emitted.
-
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,
ModelCallEndEventusage is accumulated and emitted as AG-UI CUSTOM events namedtoken_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 whetherRUN_FINISHEDshould be emitted afterRUN_ERROR.AG-UI treats
RUN_ERRORandRUN_FINISHEDas mutually exclusive terminal events. Default isfalse(standard AG-UI). Settrueonly for legacy clients that still expect a finish event after an error.- Returns:
- true if
RUN_FINISHEDshould followRUN_ERROR
-
getRunTimeout
Get the run timeout duration.- Returns:
- The run timeout
-
getDefaultAgentId
Get the default agent ID.- Returns:
- The default agent ID, or null if not set
-
getEventConverters
Get custom AgentEvent converters.- Returns:
- Custom event converters
-
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()Whenfalse(default), AgentEvents with a non-nullsource(subagent events) are emitted as AG-UICUSTOMevents under thesubagent.*namespace instead of nativeTEXT_MESSAGE_*/ run lifecycle events.- Returns:
- true to keep the legacy native presentation for subagent events
-
builder
Creates a new builder for AguiAdapterConfig.- Returns:
- A new builder instance
-
defaultConfig
Creates a default configuration.- Returns:
- Default configuration
-