vearch

package
v3.5.7 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

README

Vearch sdk for langchaingo.

Documentation

Overview

Package vearch contains an implementation of the VectorStore interface using vearch.

Index

Constants

View Source
const (
	DefaultDBName    = "ts_db"
	DefaultSpaceName = "ts_space"
)

Variables

View Source
var ErrInvalidOptions = errors.New("invalid options")

ErrInvalidOptions is returned when the options given are invalid.

Functions

func DoRequest

func DoRequest(ctx context.Context,
	url url.URL,
	apiKey,
	method string,
	payload interface{},
) (io.ReadCloser, int, error)

doRequest performs an HTTP request to the Qdrant API.

Types

type Option

type Option func(store *Store)

Option is a function that configures an Options.

func WithDBName added in v3.5.2

func WithDBName(name string) Option

WithDbName returns an Option for setting the database name. Required.

func WithEmbedder

func WithEmbedder(embedder embeddings.Embedder) Option

WithEmbedder is an option for setting the embedder to use. Must be set.

func WithSpaceName

func WithSpaceName(name string) Option

WithSpaceName returns an Option for setting the space name. Required.

func WithURL

func WithURL(clusterURL url.URL) Option

WithURL returns an Option for setting the Vearch cluster URL. Required.

type Store

type Store struct {
	DBName     string
	SpaceName  string
	ClusterURL url.URL
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) (Store, error)

func (Store) AddDocuments

func (s Store) AddDocuments(
	ctx context.Context,
	docs []schema.Document,
	options ...vectorstores.Option,
) ([]string, error)

func (*Store) SimilaritySearch

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

Jump to

Keyboard shortcuts

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