Documentation
¶
Index ¶
- Constants
- func DirectoryWriteGuidance() string
- func OpenSharedChatStore(dir, sqliteFile string) (*sql.DB, error)
- type Config
- type ConversationSummary
- type Hybrid
- func (m *Hybrid) AddMessage(ctx context.Context, msg Message) error
- func (m *Hybrid) Clear(ctx context.Context) error
- func (m *Hybrid) Compress(ctx context.Context) error
- func (m *Hybrid) GetMessages(ctx context.Context, limit int) ([]Message, error)
- func (m *Hybrid) GetStats() Stats
- func (m *Hybrid) GetSummary(ctx context.Context) (string, error)
- func (m *Hybrid) StoredMessageCount(ctx context.Context) (int, error)
- type InMemory
- func (m *InMemory) AddMessage(ctx context.Context, msg Message) error
- func (m *InMemory) Clear(ctx context.Context) error
- func (m *InMemory) Compress(ctx context.Context) error
- func (m *InMemory) GetMessages(ctx context.Context, limit int) ([]Message, error)
- func (m *InMemory) GetStats() Stats
- func (m *InMemory) GetSummary(ctx context.Context) (string, error)
- func (m *InMemory) StoredMessageCount(ctx context.Context) (int, error)
- type LLMProvider
- type MemDir
- func (m *MemDir) AddEntry(entry *MemoryEntry) error
- func (m *MemDir) DeleteEntry(id string) error
- func (m *MemDir) GetEntry(id string) (*MemoryEntry, error)
- func (m *MemDir) GetIndex(maxLines int) (string, error)
- func (m *MemDir) Search(query string, limit int) ([]MemoryEntry, error)
- func (m *MemDir) UpdateEntry(entry *MemoryEntry) error
- type MemDirProvider
- type MemoryEntry
- type MemoryType
- type Message
- type Provider
- type SQLite
- func (s *SQLite) AddMessage(ctx context.Context, msg Message) error
- func (s *SQLite) Clear(ctx context.Context) error
- func (s *SQLite) Close() error
- func (s *SQLite) Compress(ctx context.Context) error
- func (s *SQLite) GetMessages(ctx context.Context, limit int) ([]Message, error)
- func (s *SQLite) GetStats() Stats
- func (s *SQLite) GetSummary(ctx context.Context) (string, error)
- func (s *SQLite) StoredMessageCount(ctx context.Context) (int, error)
- type Stats
- type ToolCall
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func DirectoryWriteGuidance ¶ added in v1.8.11
func DirectoryWriteGuidance() string
Types ¶
type Config ¶
type Config struct {
MaxHistoryMessages int
EnableMemoryCompress bool
MemoryCompressThreshold int
KeepRecentCount int
CompressionRatio float32
PersistDirectory string
SQLiteFile string
}
func DefaultConfig ¶
func DefaultConfig() *Config
type ConversationSummary ¶
type ConversationSummary struct {
// contains filtered or unexported fields
}
func NewConversationSummary ¶
func NewConversationSummary() *ConversationSummary
func (*ConversationSummary) AddMessage ¶
func (s *ConversationSummary) AddMessage(msg Message)
func (*ConversationSummary) GetLastUpdated ¶
func (s *ConversationSummary) GetLastUpdated() time.Time
func (*ConversationSummary) GetMessageCount ¶
func (s *ConversationSummary) GetMessageCount() int
func (*ConversationSummary) GetSummary ¶
func (s *ConversationSummary) GetSummary() string
func (*ConversationSummary) SetSummary ¶
func (s *ConversationSummary) SetSummary(summary string)
type Hybrid ¶
type Hybrid struct {
// contains filtered or unexported fields
}
func NewHybrid ¶
func NewHybrid(sessionID string, provider Provider, llmProvider LLMProvider, config *Config) *Hybrid
func (*Hybrid) GetMessages ¶
type InMemory ¶
type InMemory struct {
*agentproviders.SimpleMemoryProvider
// contains filtered or unexported fields
}
func (*InMemory) GetMessages ¶
type LLMProvider ¶
type MemDir ¶ added in v1.8.11
type MemDir struct {
// contains filtered or unexported fields
}
func (*MemDir) AddEntry ¶ added in v1.8.11
func (m *MemDir) AddEntry(entry *MemoryEntry) error
func (*MemDir) DeleteEntry ¶ added in v1.8.11
func (*MemDir) GetEntry ¶ added in v1.8.11
func (m *MemDir) GetEntry(id string) (*MemoryEntry, error)
func (*MemDir) Search ¶ added in v1.8.11
func (m *MemDir) Search(query string, limit int) ([]MemoryEntry, error)
func (*MemDir) UpdateEntry ¶ added in v1.8.11
func (m *MemDir) UpdateEntry(entry *MemoryEntry) error
type MemDirProvider ¶ added in v1.8.11
type MemDirProvider interface {
GetIndex(maxLines int) (string, error)
GetEntry(id string) (*MemoryEntry, error)
AddEntry(entry *MemoryEntry) error
UpdateEntry(entry *MemoryEntry) error
Search(query string, limit int) ([]MemoryEntry, error)
DeleteEntry(id string) error
}
type MemoryEntry ¶ added in v1.8.11
type MemoryEntry struct {
ID string `json:"id"`
Type MemoryType `json:"type"`
Title string `json:"title"`
Content string `json:"content"`
Hook string `json:"hook"`
Tags []string `json:"tags,omitempty"`
SourceID string `json:"source_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type MemoryType ¶ added in v1.8.11
type MemoryType string
const ( MemoryTypeUser MemoryType = "user" MemoryTypeFeedback MemoryType = "feedback" MemoryTypeProject MemoryType = "project" MemoryTypeReference MemoryType = "reference" )
type Message ¶
type Message = agenttypes.Message
type Provider ¶
type Provider interface {
AddMessage(ctx context.Context, msg Message) error
GetMessages(ctx context.Context, limit int) ([]Message, error)
GetSummary(ctx context.Context) (string, error)
Compress(ctx context.Context) error
Clear(ctx context.Context) error
GetStats() Stats
StoredMessageCount(ctx context.Context) (int, error)
}
func NewInMemory ¶
type SQLite ¶
type SQLite struct {
// contains filtered or unexported fields
}
func (*SQLite) GetMessages ¶
Click to show internal directories.
Click to hide internal directories.