AS AgentScopeAPI 手册 / API Reference

Builder

public static final class Builder
源码Source io/agentscope/core/agent/EventSource.java:216–272

EventSource的构建器。位于 io.agentscope.core.agent 包。核心成员包括 agentKey、agentId、agentName、sessionId、parentSessionId、taskId。

Builder for EventSource.

方法摘要Method Summary

方法Method说明Description
public Builder agentKey(String agentKey)
设置智能体键。
Performs the agent key operation.
public Builder agentId(String agentId)
设置智能体标识。
Performs the agent id operation.
public Builder agentName(String agentName)
设置智能体名称。
Performs the agent name operation.
public Builder sessionId(String sessionId)
设置会话标识。
Performs the session id operation.
public Builder parentSessionId(String parentSessionId)
设置父级会话标识。
Performs the parent session id operation.
public Builder taskId(String taskId)
设置任务标识。
Performs the task id operation.
public Builder depth(int depth)
设置该配置项。
Performs the depth operation.
public Builder path(String path)
设置路径。
Performs the path operation.
public EventSource build()
构建并返回最终实例。
Creates and returns an instance.

方法详情Method Detail

agentKey

public Builder agentKey(String agentKey)

设置智能体键。

Performs the agent key operation.

参数Parameters
名称Name类型Type说明Description
agentKeyString智能体键(类型 `String`)。The agent key.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/agent/EventSource.java:229–232

agentId

public Builder agentId(String agentId)

设置智能体标识。

Performs the agent id operation.

参数Parameters
名称Name类型Type说明Description
agentIdString智能体标识(类型 `String`)。The agent id.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/agent/EventSource.java:234–237

agentName

public Builder agentName(String agentName)

设置智能体名称。

Performs the agent name operation.

参数Parameters
名称Name类型Type说明Description
agentNameString智能体名称(类型 `String`)。The agent name.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/agent/EventSource.java:239–242

sessionId

public Builder sessionId(String sessionId)

设置会话标识。

Performs the session id operation.

参数Parameters
名称Name类型Type说明Description
sessionIdString会话标识(类型 `String`)。The session id.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/agent/EventSource.java:244–247

parentSessionId

public Builder parentSessionId(String parentSessionId)

设置父级会话标识。

Performs the parent session id operation.

参数Parameters
名称Name类型Type说明Description
parentSessionIdString父级会话标识(类型 `String`)。The parent session id.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/agent/EventSource.java:249–252

taskId

public Builder taskId(String taskId)

设置任务标识。

Performs the task id operation.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/agent/EventSource.java:254–257

depth

public Builder depth(int depth)

设置该配置项。

Performs the depth operation.

参数Parameters
名称Name类型Type说明Description
depthintdepth(类型 `int`)。The depth.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/agent/EventSource.java:259–262

path

public Builder path(String path)

设置路径。

Performs the path operation.

参数Parameters
名称Name类型Type说明Description
pathString路径(类型 `String`)。The path.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/agent/EventSource.java:264–267

build

public EventSource build()

构建并返回最终实例。

Creates and returns an instance.

返回Returns EventSource
返回EventSource。Returns event source.
源码Source io/agentscope/core/agent/EventSource.java:269–271
基于官方固定版本源码静态生成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.