Documentation
¶
Overview ¶
Package chroma provides a Chroma vector database driver implementation.
Index ¶
- Constants
- type Config
- type Driver
- func (d *Driver) Add(ctx context.Context, docs []vector.Document) error
- func (d *Driver) Close() error
- func (d *Driver) Delete(ctx context.Context, ids []string) error
- func (d *Driver) Get(ctx context.Context, ids []string) ([]vector.Document, error)
- func (d *Driver) Query(ctx context.Context, embedding []float32, topK int) ([]vector.QueryResult, error)
Constants ¶
View Source
const (
// DefaultCollectionName is the default collection name for storing tapes embeddings.
DefaultCollectionName = "tapes"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// URL is the Chroma server URL (e.g., "http://localhost:8000").
URL string
// CollectionName is the name of the collection to use.
// Defaults to DefaultCollectionName if empty.
CollectionName string
// MaxRetries overrides the maximum number of connection retries.
// Defaults to maxConnectRetries if zero.
MaxRetries uint
// RetryDelay overrides the initial delay between retries.
// Defaults to initialRetryDelay if zero.
RetryDelay time.Duration
// MaxRetryDelay overrides the maximum delay between retries.
// Defaults to maxRetryDelay if zero.
MaxRetryDelay time.Duration
}
Config holds configuration for the Chroma driver.
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver implements vector.Driver using Chroma's REST API.
func NewDriver ¶
NewDriver creates a new Chroma vector driver. It uses exponential delay retries if it cannot connect to Chroma.
Click to show internal directories.
Click to hide internal directories.