Documentation
¶
Overview ¶
Package compact implements the /compact slash command logic and idle autocompaction summarisation.
Summarize asks a throwaway client on the compact model to summarise the conversation using SummaryPrompt. The summary is then either carried forward into a fresh session via BuildCarryOver (/compact) or applied in place (idle autocompaction). The session's own client is never reused.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SummaryPrompt string
Functions ¶
func BuildCarryOver ¶
BuildCarryOver formats the summary produced by the old session into the opening user message for the new session.
func Summarize ¶ added in v0.3.0
func Summarize(ctx context.Context, apiKey string, m model.ID, genOpts model.GenerationOptions, history []message.Message, opts ...client.Option) (string, error)
Summarize asks the compact model for a summary of history. The history snapshot is sent as-is, followed by a hidden SummaryPrompt user message. The session client is not used: a throwaway client is built with no tools and prompt caching disabled. opts configures additional transport options (e.g. client.WithProviderPreferences).
Types ¶
This section is empty.
Source Files
¶
- compact.go