AS AgentScopeAPI 手册 / API Reference

PruneConfig

public static class PruneConfig
源码Source io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:532–606

修剪配置,保存相关配置项。位于 io.agentscope.harness.agent.memory.compaction 包。核心成员包括 defaults、getProtectTokens、getMinimumTokens、getMaxOutputChars、getExcludedTools、builder。

Configuration for aggregate tool-result pruning.

Prune walks backward through tool-result messages, protecting the most recent #getProtectTokens() tokens of tool output. Older tool results beyond that protection window are replaced with a head+tail preview when the total prunable amount exceeds #getMinimumTokens().

This is a lightweight, non-LLM operation that runs inside ConversationCompactor#compactIfNeeded before summarization.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
PruneBuilder类class
修剪构建器,用于构建并配置目标实例。
A class in io.agentscope.harness.agent.memory.compaction that persists and restores session and memory data across calls.

方法摘要Method Summary

方法Method说明Description
public static PruneConfig defaults()
static
返回 `defaults` 结果。
Returns the defaults.
public int getProtectTokens()
获取 `getProtectTokens`。
Token budget for recent tool outputs that are never pruned (default 40 000).
public int getMinimumTokens()
获取 `getMinimumTokens`。
Minimum prunable token total before pruning actually executes (default 20 000).
public int getMaxOutputChars()
获取最大输出字符数。
Max characters to keep per pruned tool result as head+tail preview (default 2 000).
public Set<String> getExcludedTools()
获取 `getExcludedTools`。
Tool names excluded from pruning (e.g.
public static PruneBuilder builder()
static
返回构建器实例。
Returns the builder.

方法详情Method Detail

defaults

public static PruneConfig defaults()
static

返回 defaults 结果。

Returns the defaults.

返回Returns PruneConfig
返回PruneConfig。Returns prune config.
源码Source io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:546–548

getProtectTokens

public int getProtectTokens()

获取 getProtectTokens。

Token budget for recent tool outputs that are never pruned (default 40 000).

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:551–553

getMinimumTokens

public int getMinimumTokens()

获取 getMinimumTokens。

Minimum prunable token total before pruning actually executes (default 20 000).

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:556–558

getMaxOutputChars

public int getMaxOutputChars()

获取最大输出字符数。

Max characters to keep per pruned tool result as head+tail preview (default 2 000).

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:561–563

getExcludedTools

public Set<String> getExcludedTools()

获取 getExcludedTools。

Tool names excluded from pruning (e.g.

返回Returns Set<String>
返回设置。Returns set.
源码Source io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:566–568

builder

public static PruneBuilder builder()
static

返回构建器实例。

Returns the builder.

返回Returns PruneBuilder
返回PruneBuilder。Returns prune builder.
源码Source io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:570–572

嵌套类详情Nested Class Detail

PruneBuilder

public static class PruneBuilder

修剪构建器,用于构建并配置目标实例。位于 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.

基于官方固定版本源码静态生成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.