MCPcopy Create free account
hub / github.com/Louisym/MiniCC / CompactionConfig

Class CompactionConfig

tutorials/07_auto_compaction.py:133–143  ·  view source on GitHub ↗

压缩配置。 preserve_recent_messages: 保留最近几条消息(不压缩它们) max_estimated_tokens: 超过多少 token 就触发压缩 对应源码: compact.rs:4-16

Source from the content-addressed store, hash-verified

131
132@dataclass(frozen=True)
133class CompactionConfig:
134 """
135 压缩配置。
136
137 preserve_recent_messages: 保留最近几条消息(不压缩它们)
138 max_estimated_tokens: 超过多少 token 就触发压缩
139
140 对应源码: compact.rs:4-16
141 """
142 preserve_recent_messages: int = 4 # 默认保留最近 4 条
143 max_estimated_tokens: int = 10_000 # 默认 10k token 就压缩
144
145
146def should_compact(session: Session, config: CompactionConfig) -> bool:

Callers 2

maybe_auto_compactFunction · 0.70
mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected