Builder
public static final class Builder
源码Source
io/agentscope/core/state/Task.java:220–281构建器,用于构建并配置目标实例。位于 io.agentscope.core.state 包。核心成员包括 subject、description、metadata、createdAt、state、id。
A class in io.agentscope.core.state that persists and restores session and memory data across calls. Declared in io.agentscope.core.state.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder subject(String subject) | 设置主题。 Performs the subject operation. |
public Builder description(String description) | 设置该配置项。 Performs the description operation. |
public Builder metadata(Map<String, Object> metadata) | 设置元数据。 Performs the metadata operation. |
public Builder createdAt(String createdAt) | 设置已创建 At。 Performs the created at operation. |
public Builder state(State state) | 设置状态。 Performs the state operation. |
public Builder id(String id) | 设置标识。 Performs the id operation. |
public Builder owner(String owner) | 设置所有者。 Performs the owner operation. |
public Builder blocks(List<String> blocks) | 设置该配置项。 Performs the blocks operation. |
public Builder blockedBy(List<String> blockedBy) | 设置该配置项。 Performs the blocked by operation. |
public Task build() | 构建并返回最终实例。 Creates and returns an instance. |
方法详情Method Detail
subject
public Builder subject(String subject)
设置主题。
Performs the subject operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
subject | String | 主题(类型 `String`)。The subject. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/state/Task.java:233–236description
public Builder description(String description)
设置该配置项。
Performs the description operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
description | String | 描述(类型 `String`)。The description. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/state/Task.java:238–241metadata
public Builder metadata(Map<String, Object> metadata)
设置元数据。
Performs the metadata operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
metadata | Map<String, Object> | 元数据(类型 `Map`)。The metadata. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/state/Task.java:243–246createdAt
public Builder createdAt(String createdAt)
设置已创建 At。
Performs the created at operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
createdAt | String | 已创建 At(类型 `String`)。The created at. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/state/Task.java:248–251state
public Builder state(State state)
设置状态。
Performs the state operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
state | State | 状态对象(类型 `State`)。The state. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/state/Task.java:253–256id
public Builder id(String id)
设置标识。
Performs the id operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/state/Task.java:258–261owner
public Builder owner(String owner)
设置所有者。
Performs the owner operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
owner | String | 所有者(类型 `String`)。The owner. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/state/Task.java:263–266blocks
public Builder blocks(List<String> blocks)
设置该配置项。
Performs the blocks operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
blocks | List<String> | 内容块列表(类型 `List`)。The blocks. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/state/Task.java:268–271blockedBy
public Builder blockedBy(List<String> blockedBy)
设置该配置项。
Performs the blocked by operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
blockedBy | List<String> | blocked 通过(类型 `List`)。The blocked by. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/state/Task.java:273–276build
public Task build()
构建并返回最终实例。
Creates and returns an instance.
Task返回任务。Returns task.
源码Source
io/agentscope/core/state/Task.java:278–280