TruncateArgsConfig
public static class TruncateArgsConfig
io/agentscope/harness/agent/memory/compaction/CompactionConfig.java:424–515Truncate 参数配置,保存相关配置项。位于 io.agentscope.harness.agent.memory.compaction 包。核心成员包括 getTriggerMessages、getTriggerTokens、getKeepMessages、getKeepTokens、getMaxArgLength、getTruncationText。
Configuration for the lightweight argument-truncation pass that runs before summarization.
When triggered, large string arguments of ToolUseBlocks in older messages
(before the keep window) are clipped to #getMaxArgLength() characters.
This is a cheap, non-LLM operation that prevents context ballooning from verbose
tool invocations (e.g., write_file, edit_file).
Defaults (when enabled via Builder#truncateArgs(TruncateArgsConfig)):
-
Trigger at 25 messages or 40 000 tokens
-
Keep the 20 most recent messages untouched
-
Max argument length: 2 000 characters
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
TruncateArgsBuilder | 类class | Truncate 参数构建器,用于构建并配置目标实例。 A class in io.agentscope.harness.agent.memory.compaction that persists and restores session and memory data across calls. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public int getTriggerMessages() | 获取 `getTriggerMessages`。 Returns the trigger messages. |
public int getTriggerTokens() | 获取 `getTriggerTokens`。 Returns the trigger tokens. |
public int getKeepMessages() | 获取 `getKeepMessages`。 Returns the keep messages. |
public int getKeepTokens() | 获取 `getKeepTokens`。 Returns the keep tokens. |
public int getMaxArgLength() | 获取 `getMaxArgLength`。 Maximum character length of any single tool argument value (default 2 000). |
public String getTruncationText() | 获取 `getTruncationText`。 Suffix appended after the first 20 characters of a truncated argument. |
public static TruncateArgsBuilder builder()static | 返回构建器实例。 Returns the builder. |
方法详情Method Detail
getTriggerMessages
public int getTriggerMessages()
获取 getTriggerMessages。
Returns the trigger messages.
intio/agentscope/harness/agent/memory/compaction/CompactionConfig.java:442–444getTriggerTokens
public int getTriggerTokens()
获取 getTriggerTokens。
Returns the trigger tokens.
intio/agentscope/harness/agent/memory/compaction/CompactionConfig.java:446–448getKeepMessages
public int getKeepMessages()
获取 getKeepMessages。
Returns the keep messages.
intio/agentscope/harness/agent/memory/compaction/CompactionConfig.java:450–452getKeepTokens
public int getKeepTokens()
获取 getKeepTokens。
Returns the keep tokens.
intio/agentscope/harness/agent/memory/compaction/CompactionConfig.java:454–456getMaxArgLength
public int getMaxArgLength()
获取 getMaxArgLength。
Maximum character length of any single tool argument value (default 2 000).
intio/agentscope/harness/agent/memory/compaction/CompactionConfig.java:459–461getTruncationText
public String getTruncationText()
获取 getTruncationText。
Suffix appended after the first 20 characters of a truncated argument.
Stringio/agentscope/harness/agent/memory/compaction/CompactionConfig.java:464–466builder
public static TruncateArgsBuilder builder()
返回构建器实例。
Returns the builder.
TruncateArgsBuilderio/agentscope/harness/agent/memory/compaction/CompactionConfig.java:468–470嵌套类详情Nested Class Detail
TruncateArgsBuilder
public static class TruncateArgsBuilderTruncate 参数构建器,用于构建并配置目标实例。位于 io.agentscope.harness.agent.memory.compaction 包。核心成员包括 triggerMessages、triggerTokens、keepMessages、keepTokens、maxArgLength、truncationText。
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.