Documentation
¶
Index ¶
Constants ¶
View Source
const ( SummarizePolicyNormal = "normal" SummarizePolicyAggressive = "aggressive" )
SummarizePolicy constants control how aggressively content is compressed.
Variables ¶
This section is empty.
Functions ¶
func BuildPrompt ¶
func BuildPrompt(text string, opts SummarizeOptions) string
BuildPrompt constructs the appropriate summarization prompt.
func EstimateTokens ¶
EstimateTokens returns a rough token count (~4 chars per token).
Types ¶
type LLMSummarizer ¶
type LLMSummarizer struct {
// Generate calls the LLM with the given prompt and returns the response text.
AIChat types.OpenAIChatClient
}
LLMSummarizer generates summaries using an LLM via a callback function.
func (*LLMSummarizer) Summarize ¶
func (s *LLMSummarizer) Summarize(ctx context.Context, text string, opts SummarizeOptions) (string, error)
Summarize generates a summary with escalation: normal -> aggressive -> deterministic fallback.
type StaticSummarizer ¶
StaticSummarizer always returns a fixed response (for testing).
func (*StaticSummarizer) Summarize ¶
func (s *StaticSummarizer) Summarize(_ context.Context, _ string, _ SummarizeOptions) (string, error)
Summarize returns the static response.
Click to show internal directories.
Click to hide internal directories.