Builder
public static final class Builder
io/agentscope/core/state/AgentState.java:313–393构建器,用于构建并配置目标实例。位于 io.agentscope.core.state 包。核心成员包括 sessionId、userId、summary、context、addMessage、replyId。
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 Detail
sessionId
public Builder sessionId(String sessionId)
设置会话标识。
Performs the session id operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
Builderio/agentscope/core/state/AgentState.java:328–331userId
public Builder userId(String userId)
设置用户标识。
Nullable; null = anonymous / single-tenant context.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
Builderio/agentscope/core/state/AgentState.java:334–337summary
public Builder summary(String summary)
设置摘要。
Performs the summary operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
summary | String | 摘要(类型 `String`)。The summary. |
Builderio/agentscope/core/state/AgentState.java:339–342context
public Builder context(List<Msg> context)
设置上下文。
Performs the context operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
context | List<Msg> | 上下文(类型 `List`)。The context. |
Builderio/agentscope/core/state/AgentState.java:344–347addMessage
public Builder addMessage(Msg message)
添加消息。
Adds the message.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
message | Msg | 消息(类型 `Msg`)。The message. |
Builderio/agentscope/core/state/AgentState.java:349–353replyId
public Builder replyId(String replyId)
设置回复标识。
Replies to the id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
replyId | String | 回复标识(类型 `String`)。The reply id. |
Builderio/agentscope/core/state/AgentState.java:355–358curIter
public Builder curIter(int curIter)
设置当前迭代次数。
Performs the cur iter operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
curIter | int | 当前迭代次数(类型 `int`)。The cur iter. |
Builderio/agentscope/core/state/AgentState.java:360–363shutdownInterrupted
public Builder shutdownInterrupted(boolean shutdownInterrupted)
设置该配置项。
Performs the shutdown interrupted operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
shutdownInterrupted | boolean | shutdown Interrupted(类型 `boolean`)。The shutdown interrupted. |
Builderio/agentscope/core/state/AgentState.java:365–368permissionContext
public Builder permissionContext(PermissionContextState permissionContext)
设置权限上下文。
Performs the permission context operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
permissionContext | PermissionContextState | 权限上下文(类型 `PermissionContextState`)。The permission context. |
Builderio/agentscope/core/state/AgentState.java:370–373toolContext
public Builder toolContext(ToolContextState toolContext)
设置工具上下文。
Performs the tool context operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
toolContext | ToolContextState | 工具上下文(类型 `ToolContextState`)。The tool context. |
Builderio/agentscope/core/state/AgentState.java:375–378tasksContext
public Builder tasksContext(TaskContextState tasksContext)
设置任务上下文。
Performs the tasks context operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
tasksContext | TaskContextState | 任务上下文(类型 `TaskContextState`)。The tasks context. |
Builderio/agentscope/core/state/AgentState.java:380–383planModeContext
public Builder planModeContext(PlanModeContextState planModeContext)
设置计划模式上下文。
Performs the plan mode context operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
planModeContext | PlanModeContextState | 计划模式上下文(类型 `PlanModeContextState`)。The plan mode context. |
Builderio/agentscope/core/state/AgentState.java:385–388build
public AgentState build()
构建并返回最终实例。
Creates and returns an instance.
AgentStateio/agentscope/core/state/AgentState.java:390–392