qdrantstore

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package qdrantstore contains an implementation of the llm.VectorStore interface using Qdrant.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(s *Store) error

Option is a function that configures an Options.

func WithAPIKey

func WithAPIKey(apiKey string) Option

WithAPIKey returns an Option for setting the API key to authenticate the connection. Optional.

func WithCollectionName

func WithCollectionName(collectionName string) Option

WithCollectionName returns an Option for setting the collection name. Required.

func WithCollectionVectorSize

func WithCollectionVectorSize(collectionVectorSize int) Option

WithCollectionVectorSize returns an Option for setting the collection vector size.

func WithContentKey

func WithContentKey(contentKey string) Option

WithContent returns an Option for setting field name of the document content in the Qdrant payload. Optional. Defaults to "content".

func WithEmbedder

func WithEmbedder(embedder llm.Embedder) Option

WithEmbedder returns an Option for setting the embedder to be used when adding documents or doing similarity search. Required.

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient Set custom http client.

func WithRawURL

func WithRawURL(rawURL string) Option

WithRawURL returns an Option for setting the Qdrant instance URL. Example: 'http://localhost:63333'. Required.

type Store

type Store struct {
	// contains filtered or unexported fields
}

func New

func New(options ...Option) (*Store, error)

func (*Store) AddDocuments

func (s *Store) AddDocuments(ctx context.Context, docs []llm.Document, _ ...llm.VectorStoreOption) ([]string, error)

func (*Store) ClearCollection

func (s *Store) ClearCollection(ctx context.Context) error

func (*Store) SimilaritySearch

func (s *Store) SimilaritySearch(ctx context.Context, query string, numDocuments int, options ...llm.VectorStoreOption) ([]llm.Document, error)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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