AutoContextConfig
public class AutoContextConfig
io/agentscope/core/memory/autocontext/AutoContextConfig.java:34–291用于AutoContextMemory的配置类。位于 io.agentscope.core.memory.autocontext 包。核心成员包括 getLargePayloadThreshold、getMaxToken、getTokenRatio、getOffloadSinglePreview、getMsgThreshold、getLastKeep。
Configuration class for AutoContextMemory.
This class contains all configurable parameters for the AutoContextMemory system, including storage backends, compression thresholds, and offloading settings.
Key Configuration Areas:
-
Storage: Working storage and original history storage backends
-
Compression Triggers: Message count and token count thresholds
-
Offloading: Large payload thresholds and preview lengths
-
Protection: Number of recent messages to keep uncompressed
All fields have default values and can be customized via builder pattern.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
Builder | 类class | 构建器,用于构建并配置目标实例。 Builder class for constructing AutoContextConfig instances. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public long getLargePayloadThreshold() | 获取 `getLargePayloadThreshold`。 Returns the large payload threshold. |
public long getMaxToken() | 获取最大令牌。 Returns the max token. |
public double getTokenRatio() | 获取 `getTokenRatio`。 Returns the token ratio. |
public int getOffloadSinglePreview() | 获取 `getOffloadSinglePreview`。 Returns the offload single preview. |
public int getMsgThreshold() | 获取消息阈值。 Returns the msg threshold. |
public int getLastKeep() | 获取 `getLastKeep`。 Returns the last keep. |
public int getMinConsecutiveToolMessages() | 获取 `getMinConsecutiveToolMessages`。 Returns the min consecutive tool messages. |
public double getCurrentRoundCompressionRatio() | 获取 `getCurrentRoundCompressionRatio`。 Returns the current round compression ratio. |
public int getMinCompressionTokenThreshold() | 获取最小压缩令牌阈值。 Returns the min compression token threshold. |
public PromptConfig getCustomPrompt() | 获取自定义提示词配置。 Gets the custom prompt configuration. |
public static Builder builder()static | 返回构建器实例。 Creates a new Builder instance for constructing AutoContextConfig. |
方法详情Method Detail
getLargePayloadThreshold
public long getLargePayloadThreshold()
获取 getLargePayloadThreshold。
Returns the large payload threshold.
longio/agentscope/core/memory/autocontext/AutoContextConfig.java:73–75getMaxToken
public long getMaxToken()
获取最大令牌。
Returns the max token.
longio/agentscope/core/memory/autocontext/AutoContextConfig.java:77–79getTokenRatio
public double getTokenRatio()
获取 getTokenRatio。
Returns the token ratio.
doubleio/agentscope/core/memory/autocontext/AutoContextConfig.java:81–83getOffloadSinglePreview
public int getOffloadSinglePreview()
获取 getOffloadSinglePreview。
Returns the offload single preview.
intio/agentscope/core/memory/autocontext/AutoContextConfig.java:85–87getMsgThreshold
public int getMsgThreshold()
获取消息阈值。
Returns the msg threshold.
intio/agentscope/core/memory/autocontext/AutoContextConfig.java:89–91getLastKeep
public int getLastKeep()
获取 getLastKeep。
Returns the last keep.
intio/agentscope/core/memory/autocontext/AutoContextConfig.java:93–95getMinConsecutiveToolMessages
public int getMinConsecutiveToolMessages()
获取 getMinConsecutiveToolMessages。
Returns the min consecutive tool messages.
intio/agentscope/core/memory/autocontext/AutoContextConfig.java:97–99getCurrentRoundCompressionRatio
public double getCurrentRoundCompressionRatio()
获取 getCurrentRoundCompressionRatio。
Returns the current round compression ratio.
doubleio/agentscope/core/memory/autocontext/AutoContextConfig.java:101–103getMinCompressionTokenThreshold
public int getMinCompressionTokenThreshold()
获取最小压缩令牌阈值。
Returns the min compression token threshold.
intio/agentscope/core/memory/autocontext/AutoContextConfig.java:105–107getCustomPrompt
public PromptConfig getCustomPrompt()
获取自定义提示词配置。
Gets the custom prompt configuration.
PromptConfigio/agentscope/core/memory/autocontext/AutoContextConfig.java:114–116builder
public static Builder builder()
返回构建器实例。
Creates a new Builder instance for constructing AutoContextConfig.
Builderio/agentscope/core/memory/autocontext/AutoContextConfig.java:123–125嵌套类详情Nested Class Detail
Builder
public static class Builder构建器,用于构建并配置目标实例。位于 io.agentscope.core.memory.autocontext 包。核心成员包括 largePayloadThreshold、maxToken、tokenRatio、offloadSinglePreview、msgThreshold、lastKeep。
Builder class for constructing AutoContextConfig instances.
This builder provides a fluent API for configuring AutoContextMemory parameters. All fields have default values matching those in AutoContextConfig.
Example usage:
`AutoContextConfig config = AutoContextConfig.builder()
.msgThreshold(50)
.maxToken(64 * 1024)
.lastKeep(20)
.build();
`