embeddings

package
v0.0.0-...-022fb7e Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintMatches

func PrintMatches(matches []schema.Document, query string)

PrintMatches prints the search matches to the console.

Types

type EmbeddingsFrame

type EmbeddingsFrame struct {
	Embedder    embeddings.Embedder
	Scheme      string
	Host        string
	IndexName   string
	VectorStore *weaviate.Store
}

EmbeddingsFrame defines the structure for the framework.

func New

func New(embedder embeddings.Embedder, scheme, host, indexName string) (*EmbeddingsFrame, error)

New creates a new instance of EmbeddingsFrame.

func (*EmbeddingsFrame) AddDocuments

func (lf *EmbeddingsFrame) AddDocuments(ctx context.Context, docs []schema.Document) (data []string, err error)

AddDocuments adds a list of documents to the vector store.

func (*EmbeddingsFrame) SimilaritySearch

func (lf *EmbeddingsFrame) SimilaritySearch(ctx context.Context, query string, topK int, threshold float32) ([]schema.Document, error)

SimilaritySearch performs a similarity search and returns matches.

Jump to

Keyboard shortcuts

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