AS AgentScopeAPI 手册 / API Reference

PruneBuilder

public static class PruneBuilder
源码Source io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:574–605

修剪构建器,用于构建并配置目标实例。位于 io.agentscope.harness.agent.memory.compaction 包。核心成员包括 protectTokens、minimumTokens、maxOutputChars、excludedTools、build。

A class in io.agentscope.harness.agent.memory.compaction that persists and restores session and memory data across calls. Declared in io.agentscope.harness.agent.memory.compaction.

方法摘要Method Summary

方法Method说明Description
public PruneBuilder protectTokens(int protectTokens)
设置该配置项。
Performs the protect tokens operation.
public PruneBuilder minimumTokens(int minimumTokens)
设置该配置项。
Performs the minimum tokens operation.
public PruneBuilder maxOutputChars(int maxOutputChars)
设置最大输出字符数。
Performs the max output chars operation.
public PruneBuilder excludedTools(Set<String> excludedTools)
设置该配置项。
Performs the excluded tools operation.
public PruneConfig build()
构建并返回最终实例。
Creates and returns an instance.

方法详情Method Detail

protectTokens

public PruneBuilder protectTokens(int protectTokens)

设置该配置项。

Performs the protect tokens operation.

参数Parameters
名称Name类型Type说明Description
protectTokensintprotect 令牌数(类型 `int`)。The protect tokens.
返回Returns PruneBuilder
返回PruneBuilder。Returns prune builder.
源码Source io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:582–585

minimumTokens

public PruneBuilder minimumTokens(int minimumTokens)

设置该配置项。

Performs the minimum tokens operation.

参数Parameters
名称Name类型Type说明Description
minimumTokensintminimum 令牌数(类型 `int`)。The minimum tokens.
返回Returns PruneBuilder
返回PruneBuilder。Returns prune builder.
源码Source io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:587–590

maxOutputChars

public PruneBuilder maxOutputChars(int maxOutputChars)

设置最大输出字符数。

Performs the max output chars operation.

参数Parameters
名称Name类型Type说明Description
maxOutputCharsint最大输出字符数(类型 `int`)。The max output chars.
返回Returns PruneBuilder
返回PruneBuilder。Returns prune builder.
源码Source io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:592–595

excludedTools

public PruneBuilder excludedTools(Set<String> excludedTools)

设置该配置项。

Performs the excluded tools operation.

参数Parameters
名称Name类型Type说明Description
excludedToolsSet<String>excluded 工具(类型 `Set`)。The excluded tools.
返回Returns PruneBuilder
返回PruneBuilder。Returns prune builder.
源码Source io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:597–600

build

public PruneConfig build()

构建并返回最终实例。

Creates and returns an instance.

返回Returns PruneConfig
返回PruneConfig。Returns prune config.
源码Source io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:602–604
基于官方固定版本源码静态生成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.