PromptVault.Compaction behaviour (PromptVault v0.1.0)
View SourceBehaviour for compaction strategy implementations.
Compaction strategies are used to reduce the number of messages in a context while preserving important information, typically to manage token limits.
Summary
Callbacks
Compacts the given context using the strategy's algorithm.
Types
@type t() :: term()
Callbacks
@callback compact(context :: PromptVault.Context.t(), opts :: keyword()) :: {:ok, PromptVault.Context.t()} | {:error, reason :: any()}
Compacts the given context using the strategy's algorithm.
Returns a new context with fewer messages, or an error if compaction fails.