Builder
public static final class Builder
源码Source
io/agentscope/core/agent/EventSource.java:216–272EventSource的构建器。位于 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 |
|---|---|---|
agentKey | String | 智能体键(类型 `String`)。The agent key. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/agent/EventSource.java:229–232agentId
public Builder agentId(String agentId)
设置智能体标识。
Performs the agent id operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentId | String | 智能体标识(类型 `String`)。The agent id. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/agent/EventSource.java:234–237agentName
public Builder agentName(String agentName)
设置智能体名称。
Performs the agent name operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentName | String | 智能体名称(类型 `String`)。The agent name. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/agent/EventSource.java:239–242sessionId
public Builder sessionId(String sessionId)
设置会话标识。
Performs the session id operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/agent/EventSource.java:244–247parentSessionId
public Builder parentSessionId(String parentSessionId)
设置父级会话标识。
Performs the parent session id operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
parentSessionId | String | 父级会话标识(类型 `String`)。The parent session id. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/agent/EventSource.java:249–252taskId
public Builder taskId(String taskId)
设置任务标识。
Performs the task id operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
taskId | String | 任务标识(类型 `String`)。The task id. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/agent/EventSource.java:254–257depth
public Builder depth(int depth)
设置该配置项。
Performs the depth operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
depth | int | depth(类型 `int`)。The depth. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/agent/EventSource.java:259–262path
public Builder path(String path)
设置路径。
Performs the path operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
path | String | 路径(类型 `String`)。The path. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/agent/EventSource.java:264–267build
public EventSource build()
构建并返回最终实例。
Creates and returns an instance.
EventSource返回EventSource。Returns event source.
源码Source
io/agentscope/core/agent/EventSource.java:269–271