vector

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultFactory = NewFactory()

DefaultFactory is the default vector search factory instance

Functions

func CreateVectorSearch

func CreateVectorSearch(config types.VectorSearchConfig) (types.VectorSearchBackend, error)

CreateVectorSearch creates a vector search backend using the default factory

func GetSupportedEmbeddingProviders

func GetSupportedEmbeddingProviders() []types.EmbeddingProvider

GetSupportedEmbeddingProviders returns supported embedding providers using the default factory

func GetSupportedTypes

func GetSupportedTypes() []types.VectorSearchType

GetSupportedTypes returns supported vector search types using the default factory

func NewChromaBackend

func NewChromaBackend(config types.VectorSearchConfig) (types.VectorSearchBackend, error)

NewChromaBackend creates a Chroma vector search backend

func NewLocalBackend

func NewLocalBackend(config types.VectorSearchConfig) (types.VectorSearchBackend, error)

NewLocalBackend creates a local vector search backend

func NewNoneBackend

func NewNoneBackend() types.VectorSearchBackend

NewNoneBackend creates a no-op vector search backend

func NewPineconeBackend

func NewPineconeBackend(config types.VectorSearchConfig) (types.VectorSearchBackend, error)

NewPineconeBackend creates a Pinecone vector search backend

func NewQdrantBackend

func NewQdrantBackend(config types.VectorSearchConfig) (types.VectorSearchBackend, error)

NewQdrantBackend creates a Qdrant vector search backend

func NewWeaviateBackend

func NewWeaviateBackend(config types.VectorSearchConfig) (types.VectorSearchBackend, error)

NewWeaviateBackend creates a Weaviate vector search backend

func ValidateConfig

func ValidateConfig(config types.VectorSearchConfig) error

ValidateConfig validates a vector search configuration using the default factory

Types

type Factory

type Factory struct{}

Factory creates vector search backends based on configuration

func NewFactory

func NewFactory() *Factory

NewFactory creates a new vector search factory

func (*Factory) CreateVectorSearch

func (f *Factory) CreateVectorSearch(config types.VectorSearchConfig) (types.VectorSearchBackend, error)

CreateVectorSearch creates a vector search backend based on the provided configuration

func (*Factory) GetSupportedEmbeddingProviders

func (f *Factory) GetSupportedEmbeddingProviders() []types.EmbeddingProvider

GetSupportedEmbeddingProviders returns a list of supported embedding providers

func (*Factory) GetSupportedTypes

func (f *Factory) GetSupportedTypes() []types.VectorSearchType

GetSupportedTypes returns a list of supported vector search types

func (*Factory) ValidateConfig

func (f *Factory) ValidateConfig(config types.VectorSearchConfig) error

ValidateConfig validates a vector search configuration without creating the backend

type NoneBackend

type NoneBackend struct{}

NoneBackend implements a no-op vector search backend This is used when vector search is disabled or not configured

func (*NoneBackend) Close

func (n *NoneBackend) Close() error

Close is a no-op for the none backend

func (*NoneBackend) DeleteDocument

func (n *NoneBackend) DeleteDocument(ctx context.Context, id string) error

DeleteDocument is a no-op for the none backend

func (*NoneBackend) GetEmbedding

func (n *NoneBackend) GetEmbedding(ctx context.Context, text string) ([]float64, error)

GetEmbedding returns an error indicating vector search is not enabled

func (*NoneBackend) GetEmbeddings

func (n *NoneBackend) GetEmbeddings(ctx context.Context, texts []string) ([][]float64, error)

GetEmbeddings returns an error indicating vector search is not enabled

func (*NoneBackend) Health

func (n *NoneBackend) Health(ctx context.Context) error

Health always returns success for the none backend

func (*NoneBackend) IndexDocument

func (n *NoneBackend) IndexDocument(ctx context.Context, doc *types.Document) error

IndexDocument is a no-op for the none backend

func (*NoneBackend) IndexDocuments

func (n *NoneBackend) IndexDocuments(ctx context.Context, docs []*types.Document) error

IndexDocuments is a no-op for the none backend

func (*NoneBackend) Search

Search returns an error indicating vector search is not enabled

func (*NoneBackend) Type

Type returns the vector search backend type

Jump to

Keyboard shortcuts

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