Documentation
¶
Overview ¶
Package dedup holds the session-level metadata deduplication config, split out of pkg/platform to keep that package under its size budget (#594).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseState ¶
func ParseState(raw any) map[string]middleware.SentTableEntry
ParseState converts a persisted enrichment_dedup state value into the typed map the session cache expects. It handles three storage formats:
- map[string]middleware.SentTableEntry (memory store preserves Go types directly)
- map[string]any with object values (new JSON format: {"sent_at": ..., "token_count": ...})
- map[string]any with string/time values (old JSON format: table → timestamp)
Types ¶
type Config ¶
type Config struct {
// Enabled controls whether session dedup is active. Defaults to true.
Enabled *bool `yaml:"enabled"`
// Mode controls what is sent for previously-enriched tables.
// Values: "reference" (default), "summary", "none".
Mode string `yaml:"mode"`
// EntryTTL is how long a table's enrichment is considered fresh.
// Defaults to the semantic cache TTL (typically 5m).
EntryTTL time.Duration `yaml:"entry_ttl"`
// SessionTimeout is how long an idle session persists before cleanup.
// Defaults to the server's streamable session timeout (typically 30m).
SessionTimeout time.Duration `yaml:"session_timeout"`
}
Config configures session-level metadata deduplication: it avoids repeating large semantic metadata blocks for previously-enriched tables within the same client session, saving LLM context tokens.
func (*Config) EffectiveMode ¶
EffectiveMode returns the dedup mode, defaulting to "reference".
Click to show internal directories.
Click to hide internal directories.