pinecone

package
v0.0.0-...-1414e4b Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric

type Metric string
const (
	Euclidean  Metric = "euclidean"
	Cosine     Metric = "cosine"
	DotProduct Metric = "dotproduct"
)

type Options

type Options struct {
	ApiKey      string
	Environment string
	Index       string
	NameSpace   string
	Pods        int
	Replicas    int
	PodType     string
	Metric      Metric
}

Options for the Pinecone vector store.

type SparseValues

type SparseValues struct {
	Indices []int     `json:"indices"`
	Values  []float32 `json:"values"`
}

type VectorStore

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

VectorStore is a vector store backed by Pinecone. It requires an already created Pinecone index, with the same dimensionality as the embeddings used to create the store.

func NewVectorStore

func NewVectorStore(ctx context.Context, embeddings flowllm.Embeddings, opts Options) (*VectorStore, error)

NewVectorStore creates a new Pinecone vector store.

func (*VectorStore) AddDocuments

func (s *VectorStore) AddDocuments(ctx context.Context, documents ...flowllm.Document) error

func (*VectorStore) SimilaritySearch

func (s *VectorStore) SimilaritySearch(ctx context.Context, query string, k int) ([]flowllm.Document, error)

func (*VectorStore) SimilaritySearchVectorWithScore

func (s *VectorStore) SimilaritySearchVectorWithScore(ctx context.Context, query []float32, k int) ([]flowllm.ScoredDocument, error)

Jump to

Keyboard shortcuts

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