diff options
Diffstat (limited to 'libpanto/src/config.zig')
| -rw-r--r-- | libpanto/src/config.zig | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libpanto/src/config.zig b/libpanto/src/config.zig index 6b8d9a8..114280c 100644 --- a/libpanto/src/config.zig +++ b/libpanto/src/config.zig @@ -69,6 +69,24 @@ pub const ProviderConfig = union(APIStyle) { } }; +/// Compaction settings the agent consults when summarizing old history. +/// +/// `keep_verbatim` is the budget (in tokens) governing how much recent +/// conversation is kept verbatim after compaction. The retention walk +/// accumulates whole turns backward and stops once the running total +/// exceeds this value, so `keep_verbatim` is an *upper bound* on the size +/// of the kept suffix (the turn that crosses the threshold is summarized, +/// not kept). +/// +/// `model`, when set, is the provider/model used to run the compaction +/// request itself. On failure (e.g. the compaction model rejects the +/// transcript for context length) the agent falls back to the active chat +/// model. When null, compaction uses the active chat model directly. +pub const CompactionConfig = struct { + keep_verbatim: u32 = 20_000, + model: ?ProviderConfig = null, +}; + /// An immutable snapshot of everything the agent consults per turn: which /// provider/model to talk to, and which tools to expose. The agent holds a /// `*const Config` and re-reads it each turn; replacing the pointer swaps @@ -80,6 +98,7 @@ pub const ProviderConfig = union(APIStyle) { pub const Config = struct { provider: ProviderConfig, registry: *const ToolRegistry, + compaction: CompactionConfig = .{}, pub fn style(self: Config) APIStyle { return self.provider.style(); |
