AS AgentScopeAPI 手册 / API Reference

AguiAdapterConfig

public class AguiAdapterConfig
源码Source io/agentscope/core/agui/adapter/AguiAdapterConfig.java:33–420

用于AG-UI 智能体适配器的配置。位于 io.agentscope.core.agui.adapter 包。核心成员包括 getToolMergeMode、isEmitStateEvents、isEmitToolCallArgs、isEmitTokenUsage、isEnableReasoning、isEmitRunFinishedAfterError。

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

类Class类型Kind说明Description
Builder类class
AguiAdapterConfig的构建器。
Builder for AguiAdapterConfig.

方法摘要Method Summary

方法Method说明Description
public ToolMergeMode getToolMergeMode()
获取 `getToolMergeMode`。
Get the tool merge mode.
public boolean isEmitStateEvents()
判断是否发出状态事件。
Check if state events should be emitted.
public boolean isEmitToolCallArgs()
判断是否发出工具调用参数。
Check if tool call arguments should be streamed.
public boolean isEmitTokenUsage()
判断是否发出令牌用量。
Check if model token usage should be emitted.
public boolean isEnableReasoning()
判断是否启用推理。
Check if reasoning/thinking content should be emitted.
public boolean isEmitRunFinishedAfterError()
判断是否 `isEmitRunFinishedAfterError`。
Check whether `RUN_FINISHED` should be emitted after `RUN_ERROR`.
public Duration getRunTimeout()
获取运行超时时长。
Get the run timeout duration.
public String getDefaultAgentId()
获取默认智能体标识。
Get the default agent ID.
public List<AgentEventConverter> getEventConverters()
获取 `getEventConverters`。
Get custom AgentEvent converters.
public List<AguiEventEnricher> getEventEnrichers()
获取 `getEventEnrichers`。
Get configured AG-UI event enrichers, including the default base properties enricher when enabled.
public boolean isBaseEventPropertiesEnricherEnabled()
判断是否 `isBaseEventPropertiesEnricherEnabled`。
Check whether the default base event properties enricher is enabled.
public boolean isEmitSubagentEventsAsNative()
判断是否发出子智能体事件 As 原生。
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.
public static Builder builder()
static
创建新的构建器用于 AguiAdapterConfig。
Creates a new builder for AguiAdapterConfig.
public static AguiAdapterConfig defaultConfig()
static
创建默认配置。
Creates a default configuration.

方法详情Method Detail

getToolMergeMode

public ToolMergeMode getToolMergeMode()

获取 getToolMergeMode。

Get the tool merge mode.

返回Returns ToolMergeMode
返回ToolMergeMode。The tool merge mode
源码Source io/agentscope/core/agui/adapter/AguiAdapterConfig.java:69–71

isEmitStateEvents

public boolean isEmitStateEvents()

判断是否发出状态事件。

Check if state events should be emitted.

返回Returns boolean
返回布尔值,表示判断结果。true if state events should be emitted
源码Source io/agentscope/core/agui/adapter/AguiAdapterConfig.java:78–80

isEmitToolCallArgs

public boolean isEmitToolCallArgs()

判断是否发出工具调用参数。

Check if tool call arguments should be streamed.

返回Returns boolean
返回布尔值,表示判断结果。true if tool call args events should be emitted
源码Source io/agentscope/core/agui/adapter/AguiAdapterConfig.java:87–89

isEmitTokenUsage

public boolean isEmitTokenUsage()

判断是否发出令牌用量。

Check if model token usage should be emitted.

返回Returns boolean
返回布尔值,表示判断结果。true if token usage events should be emitted
源码Source io/agentscope/core/agui/adapter/AguiAdapterConfig.java:99–101

isEnableReasoning

public boolean isEnableReasoning()

判断是否启用推理。

Check if reasoning/thinking content should be emitted.

返回Returns boolean
返回布尔值,表示判断结果。true if reasoning events should be emitted
源码Source io/agentscope/core/agui/adapter/AguiAdapterConfig.java:112–114

isEmitRunFinishedAfterError

public boolean isEmitRunFinishedAfterError()

判断是否 isEmitRunFinishedAfterError。

Check whether RUN_FINISHED should be emitted after RUN_ERROR.

返回Returns boolean
返回布尔值,表示判断结果。true if `RUN_FINISHED` should follow `RUN_ERROR`
源码Source io/agentscope/core/agui/adapter/AguiAdapterConfig.java:125–127

getRunTimeout

public Duration getRunTimeout()

获取运行超时时长。

Get the run timeout duration.

返回Returns Duration
运行超时。The run timeout
源码Source io/agentscope/core/agui/adapter/AguiAdapterConfig.java:134–136

getDefaultAgentId

public String getDefaultAgentId()

获取默认智能体标识。

Get the default agent ID.

返回Returns String
返回字符串结果。The default agent ID, or null if not set
源码Source io/agentscope/core/agui/adapter/AguiAdapterConfig.java:143–145

getEventConverters

public List<AgentEventConverter> getEventConverters()

获取 getEventConverters。

Get custom AgentEvent converters.

返回Returns List<AgentEventConverter>
返回列出。Custom event converters
源码Source io/agentscope/core/agui/adapter/AguiAdapterConfig.java:152–154

getEventEnrichers

public List<AguiEventEnricher> getEventEnrichers()

获取 getEventEnrichers。

Get configured AG-UI event enrichers, including the default base properties enricher when enabled.

返回Returns List<AguiEventEnricher>
返回列出。AG-UI event enrichers
源码Source io/agentscope/core/agui/adapter/AguiAdapterConfig.java:162–164

isBaseEventPropertiesEnricherEnabled

public boolean isBaseEventPropertiesEnricherEnabled()

判断是否 isBaseEventPropertiesEnricherEnabled。

Check whether the default base event properties enricher is enabled.

返回Returns boolean
返回布尔值,表示判断结果。true if the default base event properties enricher is enabled
源码Source io/agentscope/core/agui/adapter/AguiAdapterConfig.java:171–173

isEmitSubagentEventsAsNative

public boolean isEmitSubagentEventsAsNative()

判断是否发出子智能体事件 As 原生。

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 boolean
返回布尔值,表示判断结果。true to keep the legacy native presentation for subagent events
源码Source io/agentscope/core/agui/adapter/AguiAdapterConfig.java:182–184

builder

public static Builder builder()
static

创建新的构建器用于 AguiAdapterConfig。

Creates a new builder for AguiAdapterConfig.

返回Returns Builder
一种新的构建器实例。A new builder instance
源码Source io/agentscope/core/agui/adapter/AguiAdapterConfig.java:191–193

defaultConfig

public static AguiAdapterConfig defaultConfig()
static

创建默认配置。

Creates a default configuration.

返回Returns AguiAdapterConfig
返回AguiAdapterConfig。Default configuration
源码Source io/agentscope/core/agui/adapter/AguiAdapterConfig.java:200–202

嵌套类详情Nested Class Detail

Builder

public static class Builder

AguiAdapterConfig的构建器。位于 io.agentscope.core.agui.adapter 包。核心成员包括 toolMergeMode、emitStateEvents、emitToolCallArgs、emitTokenUsage、enableReasoning、emitRunFinishedAfterError。

Builder for AguiAdapterConfig.

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.