Documentation ¶
Overview ¶
Package pgvector contains an implementation of the VectorStore interface using pgvector.
Index ¶
- Constants
- Variables
- type Option
- type Store
- func (s Store) AddDocuments(ctx context.Context, docs []schema.Document, options ...vectorstores.Option) error
- func (s Store) Close(ctx context.Context) error
- func (s Store) DropTables(ctx context.Context) error
- func (s Store) RemoveCollection(ctx context.Context) error
- func (s Store) SimilaritySearch(ctx context.Context, query string, numDocuments int, ...) ([]schema.Document, error)
Constants ¶
const ( DefaultCollectionName = "langchain" DefaultPreDeleteCollection = false DefaultEmbeddingStoreTableName = "langchain_pg_embedding" DefaultCollectionStoreTableName = "langchain_pg_collection" )
Variables ¶
var ( ErrEmbedderWrongNumberVectors = errors.New("number of vectors from embedder does not match number of documents") ErrInvalidScoreThreshold = errors.New("score threshold must be between 0 and 1") ErrInvalidFilters = errors.New("invalid filters") ErrUnsupportedOptions = errors.New("unsupported options") )
var ErrInvalidOptions = errors.New("invalid options")
ErrInvalidOptions is returned when the options given are invalid.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(p *Store)
Option is a function type that can be used to modify the client.
func WithCollectionName ¶
WithCollectionName is an option for specifying the collection name.
func WithCollectionTableName ¶
WithCollectionTableName is an option for specifying the collection table name.
func WithConnectionURL ¶
WithConnectionURL is an option for specifying the Postgres connection URL. Must be set.
func WithEmbedder ¶
func WithEmbedder(e embeddings.Embedder) Option
WithEmbedder is an option for setting the embedder to use. Must be set.
func WithEmbeddingTableName ¶
WithEmbeddingTableName is an option for specifying the embedding table name.
func WithPreDeleteCollection ¶
WithPreDeleteCollection is an option for setting if the collection should be deleted before creating.