AS AgentScopeAPI 手册 / API Reference

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
subjectString主题(类型 `String`)。The subject.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/state/Task.java:233–236

description

public Builder description(String description)

设置该配置项。

Performs the description operation.

参数Parameters
名称Name类型Type说明Description
descriptionString描述(类型 `String`)。The description.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/state/Task.java:238–241

metadata

public Builder metadata(Map<String, Object> metadata)

设置元数据。

Performs the metadata operation.

参数Parameters
名称Name类型Type说明Description
metadataMap<String, Object>元数据(类型 `Map`)。The metadata.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/state/Task.java:243–246

createdAt

public Builder createdAt(String createdAt)

设置已创建 At。

Performs the created at operation.

参数Parameters
名称Name类型Type说明Description
createdAtString已创建 At(类型 `String`)。The created at.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/state/Task.java:248–251

state

public Builder state(State state)

设置状态。

Performs the state operation.

参数Parameters
名称Name类型Type说明Description
stateState状态对象(类型 `State`)。The state.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/state/Task.java:253–256

id

public Builder id(String id)

设置标识。

Performs the id operation.

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

owner

public Builder owner(String owner)

设置所有者。

Performs the owner operation.

参数Parameters
名称Name类型Type说明Description
ownerString所有者(类型 `String`)。The owner.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/state/Task.java:263–266

blocks

public Builder blocks(List<String> blocks)

设置该配置项。

Performs the blocks operation.

参数Parameters
名称Name类型Type说明Description
blocksList<String>内容块列表(类型 `List`)。The blocks.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/state/Task.java:268–271

blockedBy

public Builder blockedBy(List<String> blockedBy)

设置该配置项。

Performs the blocked by operation.

参数Parameters
名称Name类型Type说明Description
blockedByList<String>blocked 通过(类型 `List`)。The blocked by.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/state/Task.java:273–276

build

public Task build()

构建并返回最终实例。

Creates and returns an instance.

返回Returns Task
返回任务。Returns task.
源码Source io/agentscope/core/state/Task.java:278–280
基于官方固定版本源码静态生成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.