AS AgentScopeAPI 手册 / API Reference

Task

public final class Task
源码Source io/agentscope/core/state/Task.java:41–282

任务,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.core.state 包。核心成员包括 getSubject、getDescription、getMetadata、getCreatedAt、getState、getId。

Persistent agent task record carried inside TaskContextState.

Tasks are user-visible work items. Their #state progresses pending → in_progress → completed; dependencies are declared via #blocks (downstream task ids waiting on this one) and #blockedBy (upstream task ids whose completion gates this one).

All fields except subject and description have sensible defaults so callers normally invoke Builder#subject(String) + Builder#description(String) and let the other fields populate themselves.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
State枚举enum
用于`#state`的已允许值。
Allowed values for `#state`.
Builder类class
构建器,用于构建并配置目标实例。
A class in io.agentscope.core.state that persists and restores session and memory data across calls.

方法摘要Method Summary

方法Method说明Description
public String getSubject()
获取主题。
Returns the subject.
public String getDescription()
获取 `getDescription`。
Returns the description.
public Map<String, Object> getMetadata()
获取元数据。
Returns the metadata.
public String getCreatedAt()
获取已创建 At。
Returns the created at.
public State getState()
获取状态。
Returns the state.
public String getId()
获取标识。
Returns the id.
public String getOwner()
获取所有者。
Returns the owner.
public List<String> getBlocks()
获取 `getBlocks`。
Returns the blocks.
public List<String> getBlockedBy()
获取 `getBlockedBy`。
Returns the blocked by.
public static Builder builder()
static
返回构建器实例。
Returns the builder.
public boolean equals(Object o)
设置该参数。
Performs the equals operation.
public int hashCode()
返回 `hashCode` 结果。
Returns the hash code.
public String toString()
返回 `toString` 结果。
Returns the to string.

方法详情Method Detail

getSubject

public String getSubject()

获取主题。

Returns the subject.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/state/Task.java:133–136

getDescription

public String getDescription()

获取 getDescription。

Returns the description.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/state/Task.java:138–141

getMetadata

public Map<String, Object> getMetadata()

获取元数据。

Returns the metadata.

返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/core/state/Task.java:143–146

getCreatedAt

public String getCreatedAt()

获取已创建 At。

Returns the created at.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/state/Task.java:148–151

getState

public State getState()

获取状态。

Returns the state.

返回Returns State
返回状态。Returns state.
源码Source io/agentscope/core/state/Task.java:153–156

getId

public String getId()

获取标识。

Returns the id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/state/Task.java:158–161

getOwner

public String getOwner()

获取所有者。

Returns the owner.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/state/Task.java:163–166

getBlocks

public List<String> getBlocks()

获取 getBlocks。

Returns the blocks.

返回Returns List<String>
返回列出。Returns list.
源码Source io/agentscope/core/state/Task.java:168–171

getBlockedBy

public List<String> getBlockedBy()

获取 getBlockedBy。

Returns the blocked by.

返回Returns List<String>
返回列出。Returns list.
源码Source io/agentscope/core/state/Task.java:173–176

builder

public static Builder builder()
static

返回构建器实例。

Returns the builder.

返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/state/Task.java:178–180

equals

public boolean equals(Object o)

设置该参数。

Performs the equals operation.

参数Parameters
名称Name类型Type说明Description
oObjecto(类型 `Object`)。The o.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/core/state/Task.java:182–199

hashCode

public int hashCode()

返回 hashCode 结果。

Returns the hash code.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/core/state/Task.java:201–205

toString

public String toString()

返回 toString 结果。

Returns the to string.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/state/Task.java:207–218

嵌套类详情Nested Class Detail

State

public enum State

用于#state的已允许值。位于 io.agentscope.core.state 包。核心成员包括 getWire、fromWire、PENDING、IN_PROGRESS、COMPLETED。

Allowed values for #state.

Builder

public static final class Builder

构建器,用于构建并配置目标实例。位于 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.

基于官方固定版本源码静态生成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.