providers

package
v0.0.0-...-b8e807e Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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

func (s *S3ContextStorage) StoreContext(ctx context.Context, contextData *models.Context) error

StoreContext stores a context in S3

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL