compressor

package
v0.0.0-...-99d71fe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCompressionPrompts = CompressionPrompts{

	Minimalist: `Summarize the conversation history concisely, preserving key facts, decisions, and context needed for continuation.`,
	Structured: `Compress this conversation into a brief summary including:
		- Main topics discussed
		- Key decisions/conclusions
		- Important context for next exchanges
		Keep it under 200 words.
	`,
	UltraShort:      `Summarize this conversation: extract key facts, decisions, and essential context only.`,
	ContinuityFocus: `Create a compact summary of this conversation that preserves all information needed to continue the discussion naturally.`,
}

Functions

This section is empty.

Types

type CompressionPrompts

type CompressionPrompts struct {
	Minimalist      string
	Structured      string
	UltraShort      string
	ContinuityFocus string
}

type CompressorAgent

type CompressorAgent struct {
	// contains filtered or unexported fields
}

func NewCompressorAgent

func NewCompressorAgent(ctx context.Context, agentConfig agents.AgentConfig, modelConfig models.ModelConfig) (*CompressorAgent, error)

func (*CompressorAgent) CompressMessages

func (c *CompressorAgent) CompressMessages(messages []*ai.Message) (agents.ChatResponse, error)

CompressMessages compresses a list of messages into a summary

func (*CompressorAgent) CompressMessagesStream

func (c *CompressorAgent) CompressMessagesStream(messages []*ai.Message, callback func(agents.ChatResponse) error) (agents.ChatResponse, error)

CompressMessagesStream compresses a list of messages into a summary using streaming

func (*CompressorAgent) CompressText

func (c *CompressorAgent) CompressText(text string) (agents.ChatResponse, error)

func (*CompressorAgent) CompressTextStream

func (c *CompressorAgent) CompressTextStream(text string, callback func(agents.ChatResponse) error) (agents.ChatResponse, error)

CompressTextStream compresses the given text using streaming

func (*CompressorAgent) GetCompressionPrompt

func (c *CompressorAgent) GetCompressionPrompt() string

GetCompressionPrompt returns the current compression prompt

func (*CompressorAgent) GetInfo

func (c *CompressorAgent) GetInfo() (agents.AgentInfo, error)

func (*CompressorAgent) GetKind

func (c *CompressorAgent) GetKind() agents.AgentKind

func (*CompressorAgent) GetName

func (c *CompressorAgent) GetName() string

func (*CompressorAgent) SetCompressionPrompt

func (c *CompressorAgent) SetCompressionPrompt(prompt string)

SetCompressionPrompt sets a new compression prompt