AS AgentScopeAPI 手册 / API Reference

TaskContextState

public final class TaskContextState
源码Source io/agentscope/core/state/TaskContextState.java:30–74

任务上下文状态,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.core.state 包。核心成员包括 getTasks、tasksMutable、equals、hashCode、toString、TaskContextState。

Mutable bag of Tasks carried by AgentState.

The inner list is mutable so meta-tools can append/replace tasks without rebuilding the whole context. #getTasks() returns a defensive copy for read-only consumers.

构造器摘要Constructor Summary

构造器Constructor说明Description
public TaskContextState()
初始化 `TaskContextState` 实例。
Construct an empty context.
public TaskContextState(List<Task> tasks)
初始化 `TaskContextState` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public List<Task> getTasks()
获取任务。
Returns the tasks.
public List<Task> tasksMutable()
返回任务可变。
Live, mutable handle for tool implementations that need to append/remove tasks in place.
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.

构造器详情Constructor Detail

TaskContextState

public TaskContextState()

初始化 TaskContextState 实例。

Construct an empty context.

源码Source io/agentscope/core/state/TaskContextState.java:35–37

TaskContextState

public TaskContextState(List<Task> tasks)

初始化 TaskContextState 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
tasksList<Task>任务(类型 `List`)。The tasks.
源码Source io/agentscope/core/state/TaskContextState.java:39–42

方法详情Method Detail

getTasks

public List<Task> getTasks()

获取任务。

Returns the tasks.

返回Returns List<Task>
返回列出。Returns list.
源码Source io/agentscope/core/state/TaskContextState.java:44–47

tasksMutable

public List<Task> tasksMutable()

返回任务可变。

Live, mutable handle for tool implementations that need to append/remove tasks in place.

返回Returns List<Task>
返回列出。Returns list.
源码Source io/agentscope/core/state/TaskContextState.java:50–52

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/TaskContextState.java:54–63

hashCode

public int hashCode()

返回 hashCode 结果。

Returns the hash code.

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

toString

public String toString()

返回 toString 结果。

Returns the to string.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/state/TaskContextState.java:70–73
基于官方固定版本源码静态生成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.