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 |
|---|---|---|
protectTokens | int | protect 令牌数(类型 `int`)。The protect tokens. |
PruneBuilder返回PruneBuilder。Returns prune builder.
源码Source
io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:582–585minimumTokens
public PruneBuilder minimumTokens(int minimumTokens)
设置该配置项。
Performs the minimum tokens operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
minimumTokens | int | minimum 令牌数(类型 `int`)。The minimum tokens. |
PruneBuilder返回PruneBuilder。Returns prune builder.
源码Source
io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:587–590maxOutputChars
public PruneBuilder maxOutputChars(int maxOutputChars)
设置最大输出字符数。
Performs the max output chars operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
maxOutputChars | int | 最大输出字符数(类型 `int`)。The max output chars. |
PruneBuilder返回PruneBuilder。Returns prune builder.
源码Source
io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:592–595excludedTools
public PruneBuilder excludedTools(Set<String> excludedTools)
设置该配置项。
Performs the excluded tools operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
excludedTools | Set<String> | excluded 工具(类型 `Set`)。The excluded tools. |
PruneBuilder返回PruneBuilder。Returns prune builder.
源码Source
io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:597–600build
public PruneConfig build()
构建并返回最终实例。
Creates and returns an instance.
PruneConfig返回PruneConfig。Returns prune config.
源码Source
io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:602–604