Builder
public static final class Builder
源码Source
io/agentscope/core/state/ToolContextState.java:326–354构建器,用于构建并配置目标实例。位于 io.agentscope.core.state 包。核心成员包括 maxCacheFiles、maxCacheBytes、addActivatedGroup、build。
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 maxCacheFiles(int maxCacheFiles) | 设置最大缓存文件。 Performs the max cache files operation. |
public Builder maxCacheBytes(double maxCacheBytes) | 设置最大缓存字节。 Performs the max cache bytes operation. |
public Builder addActivatedGroup(String groupName) | 添加 `addActivatedGroup`。 Adds the activated group. |
public ToolContextState build() | 构建并返回最终实例。 Creates and returns an instance. |
方法详情Method Detail
maxCacheFiles
public Builder maxCacheFiles(int maxCacheFiles)
设置最大缓存文件。
Performs the max cache files operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
maxCacheFiles | int | 最大缓存文件(类型 `int`)。The max cache files. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/state/ToolContextState.java:334–337maxCacheBytes
public Builder maxCacheBytes(double maxCacheBytes)
设置最大缓存字节。
Performs the max cache bytes operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
maxCacheBytes | double | 最大缓存字节(类型 `double`)。The max cache bytes. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/state/ToolContextState.java:339–342addActivatedGroup
public Builder addActivatedGroup(String groupName)
添加 addActivatedGroup。
Adds the activated group.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
groupName | String | 组名称(类型 `String`)。The group name. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/state/ToolContextState.java:344–349build
public ToolContextState build()
构建并返回最终实例。
Creates and returns an instance.
ToolContextState返回ToolContextState。Returns tool context state.
源码Source
io/agentscope/core/state/ToolContextState.java:351–353