pinecone

package
v0.0.0-...-9a0c461 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 11 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 Option

type Option func(*VectorStore)

func WithAPIKey

func WithAPIKey(apiKey string) Option

func WithDimensions

func WithDimensions(dimensions int) Option

func WithEnvironment

func WithEnvironment(environment string) Option

func WithIndexName

func WithIndexName(indexName string) Option

func WithMetric

func WithMetric(metric Metric) Option

func WithNamespace

func WithNamespace(namespace string) Option

func WithPodType

func WithPodType(podType string) Option

func WithPods

func WithPods(pods int) Option

type SparseValues

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

type VectorStore

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

func NewVectorStore

func NewVectorStore(ctx context.Context, embeddings llmcomposer.Embeddings, opts ...Option) (*VectorStore, error)

func (*VectorStore) AddDocuments

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

func (*VectorStore) SimilaritySearch

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

func (*VectorStore) SimilaritySearchVectorWithScore

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

Jump to

Keyboard shortcuts

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