index

package
v0.0.3-alpha1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Embedder

type Embedder interface {
	Embed(ctx context.Context, docs []document.Document) ([]embedder.Embedding, error)
}

type Pinecone

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

func NewPinecone

func NewPinecone(indexName, projectID string, embedder Embedder) (*Pinecone, error)

func (*Pinecone) LoadFromDocuments

func (s *Pinecone) LoadFromDocuments(ctx context.Context, documents []document.Document) error

func (*Pinecone) SimilaritySearch

func (s *Pinecone) SimilaritySearch(ctx context.Context, query string, topK *int) ([]SearchResponse, error)

func (*Pinecone) Size

func (s *Pinecone) Size() (int64, error)

type SearchResponse

type SearchResponse struct {
	Document document.Document
	Score    float32
	Index    int
}

type SimpleVectorIndex

type SimpleVectorIndex struct {
	Data []SimpleVectorIndexData `json:"data"`
	// contains filtered or unexported fields
}

func NewSimpleVectorIndex

func NewSimpleVectorIndex(name string, outputPath string, embedder Embedder) (*SimpleVectorIndex, error)

func (*SimpleVectorIndex) LoadFromDocuments

func (s *SimpleVectorIndex) LoadFromDocuments(ctx context.Context, documents []document.Document) error

func (*SimpleVectorIndex) SimilaritySearch

func (s *SimpleVectorIndex) SimilaritySearch(ctx context.Context, query string, topK *int) ([]SearchResponse, error)

func (*SimpleVectorIndex) Size

func (s *SimpleVectorIndex) Size() (int64, error)

type SimpleVectorIndexData

type SimpleVectorIndexData struct {
	Document  document.Document  `json:"document"`
	Embedding embedder.Embedding `json:"embedding"`
}

Jump to

Keyboard shortcuts

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