Documentation
¶
Index ¶
- Constants
- Variables
- type HistoryMemory
- func (m *HistoryMemory) Close() error
- func (m *HistoryMemory) DeleteHistory(ctx context.Context, conversationID string) error
- func (m *HistoryMemory) Init(ctx context.Context) error
- func (m *HistoryMemory) RetrieveHistory(ctx context.Context, conversationID string) ([]*ai.Message, error)
- func (m *HistoryMemory) SetMaxMessagesPerConversation(ctx context.Context, max int) error
- func (m *HistoryMemory) StoreHistory(ctx context.Context, conversationID string, history []*ai.Message) error
Constants ¶
View Source
const ( HistoryTableQuery = `` /* 182-byte string literal not displayed */ HistorySourceIndexQuery = `CREATE INDEX IF NOT EXISTS idx_history_conversation_id ON history(conversation_id)` HistoryTimeIndexQuery = `CREATE INDEX IF NOT EXISTS idx_history_created_at ON history(created_at ASC)` RetrieveHistory = `SELECT id, message FROM history WHERE conversation_id = $1 ORDER BY created_at ASC` DeleteHistory = `DELETE FROM history WHERE conversation_id = $1` HistoryTrigger = `` /* 182-byte string literal not displayed */ HistoryTriggerFunctionFormat = `` /* 880-byte string literal not displayed */ )
Variables ¶
View Source
var ErrDBNotInitialized = errors.New("database connection not initialized")
Functions ¶
This section is empty.
Types ¶
type HistoryMemory ¶
type HistoryMemory struct {
// contains filtered or unexported fields
}
func NewHistoryMemory ¶
func (*HistoryMemory) Close ¶
func (m *HistoryMemory) Close() error
func (*HistoryMemory) DeleteHistory ¶
func (m *HistoryMemory) DeleteHistory(ctx context.Context, conversationID string) error
func (*HistoryMemory) RetrieveHistory ¶
func (*HistoryMemory) SetMaxMessagesPerConversation ¶
func (m *HistoryMemory) SetMaxMessagesPerConversation(ctx context.Context, max int) error
func (*HistoryMemory) StoreHistory ¶
Click to show internal directories.
Click to hide internal directories.