Documentation
¶
Index ¶
- type BufferedMemory
- type Message
- type SQLiteStore
- func (s *SQLiteStore) CleanExpired(ctx context.Context) (int64, error)
- func (s *SQLiteStore) Clear() error
- func (s *SQLiteStore) Close() error
- func (s *SQLiteStore) List() ([]string, error)
- func (s *SQLiteStore) Retrieve(key string) (interface{}, error)
- func (s *SQLiteStore) Store(key string, value interface{}) error
- func (s *SQLiteStore) StoreWithTTL(ctx context.Context, key string, value interface{}, ttl time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferedMemory ¶
type BufferedMemory struct {
// contains filtered or unexported fields
}
BufferedMemory provides an in-memory store that keeps only the last N messages. It wraps an underlying agents.Memory implementation.
func NewBufferedMemory ¶
func NewBufferedMemory(maxSize int) *BufferedMemory
NewBufferedMemory creates a new BufferedMemory instance with a default history key. It initializes an InMemoryStore as the underlying storage.
func (*BufferedMemory) Add ¶
Add appends a new message to the history, ensuring the buffer size limit is maintained.
type SQLiteStore ¶
type SQLiteStore struct {
// contains filtered or unexported fields
}
SQLiteStore implements the Memory interface using SQLite as the backend.
func NewSQLiteStore ¶
func NewSQLiteStore(path string) (*SQLiteStore, error)
NewSQLiteStore creates a new SQLite-backed memory store. The path parameter specifies the database file location. If path is ":memory:", the database will be created in-memory.
func (*SQLiteStore) CleanExpired ¶
func (s *SQLiteStore) CleanExpired(ctx context.Context) (int64, error)
CleanExpired removes all expired entries from the store.
func (*SQLiteStore) Clear ¶
func (s *SQLiteStore) Clear() error
Clear implements the Memory interface Clear method.
func (*SQLiteStore) Close ¶
func (s *SQLiteStore) Close() error
Close closes the database connection.
func (*SQLiteStore) List ¶
func (s *SQLiteStore) List() ([]string, error)
List implements the Memory interface List method.
func (*SQLiteStore) Retrieve ¶
func (s *SQLiteStore) Retrieve(key string) (interface{}, error)
Retrieve implements the Memory interface Retrieve method.
func (*SQLiteStore) Store ¶
func (s *SQLiteStore) Store(key string, value interface{}) error
Store implements the Memory interface Store method.
func (*SQLiteStore) StoreWithTTL ¶
func (s *SQLiteStore) StoreWithTTL(ctx context.Context, key string, value interface{}, ttl time.Duration) error
StoreWithTTL stores a value with a time-to-live duration.