AS AgentScopeAPI 手册 / API Reference

AguiProperties

@ConfigurationProperties(prefix = "agentscope.agui") public class AguiProperties
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:46–275

AGUI 属性,承载智能体的部署、调度与服务化运行。位于 io.agentscope.spring.boot.agui.common 包。核心成员包括 getPathPrefix、setPathPrefix、isCorsEnabled、setCorsEnabled、getCorsAllowedOrigins、setCorsAllowedOrigins。

Configuration properties for AG-UI integration.

These properties can be configured in application.yml or application.properties:


agentscope:
agui:
path-prefix: /agui
cors-enabled: true
cors-allowed-origins:
- "*"
run-timeout: 10m
default-tool-merge-mode: MERGE_EXTERNAL_PRIORITY
default-agent-id: default
agent-id-header: X-Agent-Id
enable-path-routing: true
enable-reasoning: false
emit-token-usage: false
emit-run-finished-after-error: false
interrupt-on-disconnect: true

方法摘要Method Summary

方法Method说明Description
public String getPathPrefix()
获取 `getPathPrefix`。
Returns the path prefix.
public void setPathPrefix(String pathPrefix)
设置 `setPathPrefix`。
Sets the path prefix.
public boolean isCorsEnabled()
判断是否 `isCorsEnabled`。
Returns whether the cors enabled.
public void setCorsEnabled(boolean corsEnabled)
设置 `setCorsEnabled`。
Sets the cors enabled.
public List<String> getCorsAllowedOrigins()
获取 `getCorsAllowedOrigins`。
Returns the cors allowed origins.
public void setCorsAllowedOrigins(List<String> corsAllowedOrigins)
设置 `setCorsAllowedOrigins`。
Sets the cors allowed origins.
public Duration getRunTimeout()
获取运行超时。
Returns the run timeout.
public void setRunTimeout(Duration runTimeout)
设置运行超时。
Sets the run timeout.
public ToolMergeMode getDefaultToolMergeMode()
获取 `getDefaultToolMergeMode`。
Returns the default tool merge mode.
public void setDefaultToolMergeMode(ToolMergeMode defaultToolMergeMode)
设置 `setDefaultToolMergeMode`。
Sets the default tool merge mode.
public boolean isEmitStateEvents()
判断是否发出状态事件。
Returns whether the emit state events.
public void setEmitStateEvents(boolean emitStateEvents)
设置发出状态事件。
Sets the emit state events.
public boolean isEmitToolCallArgs()
判断是否发出工具调用参数。
Returns whether the emit tool call args.
public void setEmitToolCallArgs(boolean emitToolCallArgs)
设置发出工具调用参数。
Sets the emit tool call args.
public boolean isEmitTokenUsage()
判断是否发出令牌用量。
Returns whether the emit token usage.
public void setEmitTokenUsage(boolean emitTokenUsage)
设置发出令牌用量。
Sets the emit token usage.
public boolean isEnableReasoning()
判断是否启用推理。
Returns whether the enable reasoning.
public void setEnableReasoning(boolean enableReasoning)
设置启用推理。
Sets the enable reasoning.
public boolean isEmitRunFinishedAfterError()
判断是否 `isEmitRunFinishedAfterError`。
Returns whether the emit run finished after error.
public void setEmitRunFinishedAfterError(boolean emitRunFinishedAfterError)
设置 `setEmitRunFinishedAfterError`。
Sets the emit run finished after error.
public String getDefaultAgentId()
获取默认智能体标识。
Returns the default agent id.
public void setDefaultAgentId(String defaultAgentId)
设置默认智能体标识。
Sets the default agent id.
public boolean isServerSideMemory()
判断是否 `isServerSideMemory`。
Returns whether the server side memory.
public void setServerSideMemory(boolean serverSideMemory)
设置 `setServerSideMemory`。
Sets the server side memory.
public int getMaxThreadSessions()
获取最大会话线程会话。
Returns the max thread sessions.
public void setMaxThreadSessions(int maxThreadSessions)
设置最大会话线程会话。
Sets the max thread sessions.
public int getSessionTimeoutMinutes()
获取会话超时分钟。
Returns the session timeout minutes.
public void setSessionTimeoutMinutes(int sessionTimeoutMinutes)
设置会话超时分钟。
Sets the session timeout minutes.
public String getAgentIdHeader()
获取智能体标识请求头。
Returns the agent id header.
public void setAgentIdHeader(String agentIdHeader)
设置智能体标识请求头。
Sets the agent id header.
public boolean isEnablePathRouting()
判断是否启用路径路由。
Returns whether the enable path routing.
public void setEnablePathRouting(boolean enablePathRouting)
设置启用路径路由。
Sets the enable path routing.
public long getSseTimeout()
获取SSE 超时。
Returns the sse timeout.
public void setSseTimeout(long sseTimeout)
设置SSE 超时。
Sets the sse timeout.
public boolean isInterruptOnDisconnect()
判断是否中断 On 断开。
Returns whether the interrupt on disconnect.
public void setInterruptOnDisconnect(boolean interruptOnDisconnect)
设置中断 On 断开。
Sets the interrupt on disconnect.

方法详情Method Detail

getPathPrefix

public String getPathPrefix()

获取 getPathPrefix。

Returns the path prefix.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:132–134

setPathPrefix

public void setPathPrefix(String pathPrefix)

设置 setPathPrefix。

Sets the path prefix.

参数Parameters
名称Name类型Type说明Description
pathPrefixString路径 Prefix(类型 `String`)。The path prefix.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:136–138

isCorsEnabled

public boolean isCorsEnabled()

判断是否 isCorsEnabled。

Returns whether the cors enabled.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:140–142

setCorsEnabled

public void setCorsEnabled(boolean corsEnabled)

设置 setCorsEnabled。

Sets the cors enabled.

参数Parameters
名称Name类型Type说明Description
corsEnabledbooleancors 已启用(类型 `boolean`)。The cors enabled.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:144–146

getCorsAllowedOrigins

public List<String> getCorsAllowedOrigins()

获取 getCorsAllowedOrigins。

Returns the cors allowed origins.

返回Returns List<String>
返回列出。Returns list.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:148–150

setCorsAllowedOrigins

public void setCorsAllowedOrigins(List<String> corsAllowedOrigins)

设置 setCorsAllowedOrigins。

Sets the cors allowed origins.

参数Parameters
名称Name类型Type说明Description
corsAllowedOriginsList<String>cors 已允许 Origins(类型 `List`)。The cors allowed origins.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:152–154

getRunTimeout

public Duration getRunTimeout()

获取运行超时。

Returns the run timeout.

返回Returns Duration
返回时长。Returns duration.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:156–158

setRunTimeout

public void setRunTimeout(Duration runTimeout)

设置运行超时。

Sets the run timeout.

参数Parameters
名称Name类型Type说明Description
runTimeoutDuration运行超时(类型 `Duration`)。The run timeout.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:160–162

getDefaultToolMergeMode

public ToolMergeMode getDefaultToolMergeMode()

获取 getDefaultToolMergeMode。

Returns the default tool merge mode.

返回Returns ToolMergeMode
返回ToolMergeMode。Returns tool merge mode.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:164–166

setDefaultToolMergeMode

public void setDefaultToolMergeMode(ToolMergeMode defaultToolMergeMode)

设置 setDefaultToolMergeMode。

Sets the default tool merge mode.

参数Parameters
名称Name类型Type说明Description
defaultToolMergeModeToolMergeMode默认工具 Merge 模式(类型 `ToolMergeMode`)。The default tool merge mode.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:168–170

isEmitStateEvents

public boolean isEmitStateEvents()

判断是否发出状态事件。

Returns whether the emit state events.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:172–174

setEmitStateEvents

public void setEmitStateEvents(boolean emitStateEvents)

设置发出状态事件。

Sets the emit state events.

参数Parameters
名称Name类型Type说明Description
emitStateEventsboolean发出状态事件(类型 `boolean`)。The emit state events.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:176–178

isEmitToolCallArgs

public boolean isEmitToolCallArgs()

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

Returns whether the emit tool call args.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:180–182

setEmitToolCallArgs

public void setEmitToolCallArgs(boolean emitToolCallArgs)

设置发出工具调用参数。

Sets the emit tool call args.

参数Parameters
名称Name类型Type说明Description
emitToolCallArgsboolean发出工具调用参数(类型 `boolean`)。The emit tool call args.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:184–186

isEmitTokenUsage

public boolean isEmitTokenUsage()

判断是否发出令牌用量。

Returns whether the emit token usage.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:188–190

setEmitTokenUsage

public void setEmitTokenUsage(boolean emitTokenUsage)

设置发出令牌用量。

Sets the emit token usage.

参数Parameters
名称Name类型Type说明Description
emitTokenUsageboolean发出令牌用量(类型 `boolean`)。The emit token usage.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:192–194

isEnableReasoning

public boolean isEnableReasoning()

判断是否启用推理。

Returns whether the enable reasoning.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:196–198

setEnableReasoning

public void setEnableReasoning(boolean enableReasoning)

设置启用推理。

Sets the enable reasoning.

参数Parameters
名称Name类型Type说明Description
enableReasoningboolean启用推理(类型 `boolean`)。The enable reasoning.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:200–202

isEmitRunFinishedAfterError

public boolean isEmitRunFinishedAfterError()

判断是否 isEmitRunFinishedAfterError。

Returns whether the emit run finished after error.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:204–206

setEmitRunFinishedAfterError

public void setEmitRunFinishedAfterError(boolean emitRunFinishedAfterError)

设置 setEmitRunFinishedAfterError。

Sets the emit run finished after error.

参数Parameters
名称Name类型Type说明Description
emitRunFinishedAfterErrorboolean发出运行 Finished 之后错误(类型 `boolean`)。The emit run finished after error.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:208–210

getDefaultAgentId

public String getDefaultAgentId()

获取默认智能体标识。

Returns the default agent id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:212–214

setDefaultAgentId

public void setDefaultAgentId(String defaultAgentId)

设置默认智能体标识。

Sets the default agent id.

参数Parameters
名称Name类型Type说明Description
defaultAgentIdString默认智能体标识(类型 `String`)。The default agent id.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:216–218

isServerSideMemory

public boolean isServerSideMemory()

判断是否 isServerSideMemory。

Returns whether the server side memory.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:220–222

setServerSideMemory

public void setServerSideMemory(boolean serverSideMemory)

设置 setServerSideMemory。

Sets the server side memory.

参数Parameters
名称Name类型Type说明Description
serverSideMemoryboolean服务端 Side 记忆(类型 `boolean`)。The server side memory.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:224–226

getMaxThreadSessions

public int getMaxThreadSessions()

获取最大会话线程会话。

Returns the max thread sessions.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:228–230

setMaxThreadSessions

public void setMaxThreadSessions(int maxThreadSessions)

设置最大会话线程会话。

Sets the max thread sessions.

参数Parameters
名称Name类型Type说明Description
maxThreadSessionsint最大会话线程会话(类型 `int`)。The max thread sessions.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:232–234

getSessionTimeoutMinutes

public int getSessionTimeoutMinutes()

获取会话超时分钟。

Returns the session timeout minutes.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:236–238

setSessionTimeoutMinutes

public void setSessionTimeoutMinutes(int sessionTimeoutMinutes)

设置会话超时分钟。

Sets the session timeout minutes.

参数Parameters
名称Name类型Type说明Description
sessionTimeoutMinutesint会话超时分钟(类型 `int`)。The session timeout minutes.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:240–242

getAgentIdHeader

public String getAgentIdHeader()

获取智能体标识请求头。

Returns the agent id header.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:244–246

setAgentIdHeader

public void setAgentIdHeader(String agentIdHeader)

设置智能体标识请求头。

Sets the agent id header.

参数Parameters
名称Name类型Type说明Description
agentIdHeaderString智能体标识请求头(类型 `String`)。The agent id header.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:248–250

isEnablePathRouting

public boolean isEnablePathRouting()

判断是否启用路径路由。

Returns whether the enable path routing.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:252–254

setEnablePathRouting

public void setEnablePathRouting(boolean enablePathRouting)

设置启用路径路由。

Sets the enable path routing.

参数Parameters
名称Name类型Type说明Description
enablePathRoutingboolean启用路径路由(类型 `boolean`)。The enable path routing.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:256–258

getSseTimeout

public long getSseTimeout()

获取SSE 超时。

Returns the sse timeout.

返回Returns long
返回数值结果。Returns a numeric result.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:260–262

setSseTimeout

public void setSseTimeout(long sseTimeout)

设置SSE 超时。

Sets the sse timeout.

参数Parameters
名称Name类型Type说明Description
sseTimeoutlongSSE 超时(类型 `long`)。The sse timeout.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:264–266

isInterruptOnDisconnect

public boolean isInterruptOnDisconnect()

判断是否中断 On 断开。

Returns whether the interrupt on disconnect.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:268–270

setInterruptOnDisconnect

public void setInterruptOnDisconnect(boolean interruptOnDisconnect)

设置中断 On 断开。

Sets the interrupt on disconnect.

参数Parameters
名称Name类型Type说明Description
interruptOnDisconnectboolean中断 On 断开(类型 `boolean`)。The interrupt on disconnect.
源码Source io/agentscope/spring/boot/agui/common/AguiProperties.java:272–274
基于官方固定版本源码静态生成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.