AS AgentScopeAPI 手册 / API Reference

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
maxCacheFilesint最大缓存文件(类型 `int`)。The max cache files.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/state/ToolContextState.java:334–337

maxCacheBytes

public Builder maxCacheBytes(double maxCacheBytes)

设置最大缓存字节。

Performs the max cache bytes operation.

参数Parameters
名称Name类型Type说明Description
maxCacheBytesdouble最大缓存字节(类型 `double`)。The max cache bytes.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/state/ToolContextState.java:339–342

addActivatedGroup

public Builder addActivatedGroup(String groupName)

添加 addActivatedGroup。

Adds the activated group.

参数Parameters
名称Name类型Type说明Description
groupNameString组名称(类型 `String`)。The group name.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/state/ToolContextState.java:344–349

build

public ToolContextState build()

构建并返回最终实例。

Creates and returns an instance.

返回Returns ToolContextState
返回ToolContextState。Returns tool context state.
源码Source io/agentscope/core/state/ToolContextState.java:351–353
基于官方固定版本源码静态生成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.