Documentation
¶
Index ¶
- type ContextStorage
- type InMemoryContextStorage
- func (s *InMemoryContextStorage) Cleanup()
- func (s *InMemoryContextStorage) DeleteContext(ctx context.Context, contextID string) error
- func (s *InMemoryContextStorage) GetContext(ctx context.Context, contextID string) (*models.Context, error)
- func (s *InMemoryContextStorage) ListContexts(ctx context.Context, agentID string, sessionID string) ([]*models.Context, error)
- func (s *InMemoryContextStorage) StartCleanupTask(ctx context.Context, interval time.Duration)
- func (s *InMemoryContextStorage) StoreContext(ctx context.Context, contextData *models.Context) error
- type S3ContextStorage
- func (s *S3ContextStorage) DeleteContext(ctx context.Context, contextID string) error
- func (s *S3ContextStorage) GetContext(ctx context.Context, contextID string) (*models.Context, error)
- func (s *S3ContextStorage) ListContexts(ctx context.Context, agentID string, sessionID string) ([]*models.Context, error)
- func (s *S3ContextStorage) StoreContext(ctx context.Context, contextData *models.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextStorage ¶
type ContextStorage interface {
// StoreContext stores a context
StoreContext(ctx context.Context, contextData *models.Context) error
// GetContext retrieves a context by ID
GetContext(ctx context.Context, contextID string) (*models.Context, error)
// DeleteContext deletes a context
DeleteContext(ctx context.Context, contextID string) error
// ListContexts lists contexts for an agent and optionally a session
ListContexts(ctx context.Context, agentID string, sessionID string) ([]*models.Context, error)
}
ContextStorage defines the interface for context storage providers
type InMemoryContextStorage ¶
type InMemoryContextStorage struct {
// contains filtered or unexported fields
}
InMemoryContextStorage implements context storage using in-memory map This is primarily for development and testing purposes
func NewInMemoryContextStorage ¶
func NewInMemoryContextStorage() *InMemoryContextStorage
NewInMemoryContextStorage creates a new in-memory context storage provider
func (*InMemoryContextStorage) Cleanup ¶
func (s *InMemoryContextStorage) Cleanup()
Cleanup removes expired contexts
func (*InMemoryContextStorage) DeleteContext ¶
func (s *InMemoryContextStorage) DeleteContext(ctx context.Context, contextID string) error
DeleteContext deletes a context from memory
func (*InMemoryContextStorage) GetContext ¶
func (s *InMemoryContextStorage) GetContext(ctx context.Context, contextID string) (*models.Context, error)
GetContext retrieves a context from memory
func (*InMemoryContextStorage) ListContexts ¶
func (s *InMemoryContextStorage) ListContexts(ctx context.Context, agentID string, sessionID string) ([]*models.Context, error)
ListContexts lists contexts from memory
func (*InMemoryContextStorage) StartCleanupTask ¶
func (s *InMemoryContextStorage) StartCleanupTask(ctx context.Context, interval time.Duration)
StartCleanupTask starts a periodic cleanup task
func (*InMemoryContextStorage) StoreContext ¶
func (s *InMemoryContextStorage) StoreContext(ctx context.Context, contextData *models.Context) error
StoreContext stores a context in memory
type S3ContextStorage ¶
type S3ContextStorage struct {
// contains filtered or unexported fields
}
S3ContextStorage implements context storage using AWS S3
func NewS3ContextStorage ¶
func NewS3ContextStorage(s3Client *s3client.S3Client, prefix string) *S3ContextStorage
NewS3ContextStorage creates a new S3 context storage provider
func (*S3ContextStorage) DeleteContext ¶
func (s *S3ContextStorage) DeleteContext(ctx context.Context, contextID string) error
DeleteContext deletes a context from S3
func (*S3ContextStorage) GetContext ¶
func (s *S3ContextStorage) GetContext(ctx context.Context, contextID string) (*models.Context, error)
GetContext retrieves a context from S3
func (*S3ContextStorage) ListContexts ¶
func (s *S3ContextStorage) ListContexts(ctx context.Context, agentID string, sessionID string) ([]*models.Context, error)
ListContexts lists contexts from S3
func (*S3ContextStorage) StoreContext ¶
StoreContext stores a context in S3