PruneConfig
public static class PruneConfig
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()
返回 defaults 结果。
Returns the defaults.
PruneConfigio/agentscope/harness/agent/memory/compaction/CompactionConfig.java:546–548getProtectTokens
public int getProtectTokens()
获取 getProtectTokens。
Token budget for recent tool outputs that are never pruned (default 40 000).
intio/agentscope/harness/agent/memory/compaction/CompactionConfig.java:551–553getMinimumTokens
public int getMinimumTokens()
获取 getMinimumTokens。
Minimum prunable token total before pruning actually executes (default 20 000).
intio/agentscope/harness/agent/memory/compaction/CompactionConfig.java:556–558getMaxOutputChars
public int getMaxOutputChars()
获取最大输出字符数。
Max characters to keep per pruned tool result as head+tail preview (default 2 000).
intio/agentscope/harness/agent/memory/compaction/CompactionConfig.java:561–563getExcludedTools
public Set<String> getExcludedTools()
获取 getExcludedTools。
Tool names excluded from pruning (e.g.
Set<String>io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:566–568builder
public static PruneBuilder builder()
返回构建器实例。
Returns the builder.
PruneBuilderio/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.