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–37TaskContextState
public TaskContextState(List<Task> tasks)
初始化 TaskContextState 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
tasks | List<Task> | 任务(类型 `List`)。The tasks. |
源码Source
io/agentscope/core/state/TaskContextState.java:39–42方法详情Method Detail
getTasks
public List<Task> getTasks()
获取任务。
Returns the tasks.
List<Task>返回列出。Returns list.
源码Source
io/agentscope/core/state/TaskContextState.java:44–47tasksMutable
public List<Task> tasksMutable()
返回任务可变。
Live, mutable handle for tool implementations that need to append/remove tasks in place.
List<Task>返回列出。Returns list.
源码Source
io/agentscope/core/state/TaskContextState.java:50–52equals
public boolean equals(Object o)
设置该参数。
Performs the equals operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
o | Object | o(类型 `Object`)。The o. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/core/state/TaskContextState.java:54–63hashCode
public int hashCode()
返回 hashCode 结果。
Returns the hash code.
int返回数值结果。Returns a numeric result.
源码Source
io/agentscope/core/state/TaskContextState.java:65–68toString
public String toString()
返回 toString 结果。
Returns the to string.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/core/state/TaskContextState.java:70–73