Documentation
¶
Index ¶
- Variables
- func CreateVectorSearch(config types.VectorSearchConfig) (types.VectorSearchBackend, error)
- func GetSupportedEmbeddingProviders() []types.EmbeddingProvider
- func GetSupportedTypes() []types.VectorSearchType
- func NewChromaBackend(config types.VectorSearchConfig) (types.VectorSearchBackend, error)
- func NewLocalBackend(config types.VectorSearchConfig) (types.VectorSearchBackend, error)
- func NewNoneBackend() types.VectorSearchBackend
- func NewPineconeBackend(config types.VectorSearchConfig) (types.VectorSearchBackend, error)
- func NewQdrantBackend(config types.VectorSearchConfig) (types.VectorSearchBackend, error)
- func NewWeaviateBackend(config types.VectorSearchConfig) (types.VectorSearchBackend, error)
- func ValidateConfig(config types.VectorSearchConfig) error
- type Factory
- func (f *Factory) CreateVectorSearch(config types.VectorSearchConfig) (types.VectorSearchBackend, error)
- func (f *Factory) GetSupportedEmbeddingProviders() []types.EmbeddingProvider
- func (f *Factory) GetSupportedTypes() []types.VectorSearchType
- func (f *Factory) ValidateConfig(config types.VectorSearchConfig) error
- type NoneBackend
- func (n *NoneBackend) Close() error
- func (n *NoneBackend) DeleteDocument(ctx context.Context, id string) error
- func (n *NoneBackend) GetEmbedding(ctx context.Context, text string) ([]float64, error)
- func (n *NoneBackend) GetEmbeddings(ctx context.Context, texts []string) ([][]float64, error)
- func (n *NoneBackend) Health(ctx context.Context) error
- func (n *NoneBackend) IndexDocument(ctx context.Context, doc *types.Document) error
- func (n *NoneBackend) IndexDocuments(ctx context.Context, docs []*types.Document) error
- func (n *NoneBackend) Search(ctx context.Context, query *types.VectorQuery) (*types.VectorSearchResults, error)
- func (n *NoneBackend) Type() types.VectorSearchType
Constants ¶
This section is empty.
Variables ¶
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 (*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 ¶
GetEmbedding returns an error indicating vector search is not enabled
func (*NoneBackend) GetEmbeddings ¶
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 ¶
IndexDocument is a no-op for the none backend
func (*NoneBackend) IndexDocuments ¶
IndexDocuments is a no-op for the none backend
func (*NoneBackend) Search ¶
func (n *NoneBackend) Search(ctx context.Context, query *types.VectorQuery) (*types.VectorSearchResults, error)
Search returns an error indicating vector search is not enabled
func (*NoneBackend) Type ¶
func (n *NoneBackend) Type() types.VectorSearchType
Type returns the vector search backend type