embedder

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type E

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

E is an embedder.

func New

func New(
	llmClient LLMClient,
	s3Client s3Client,
	vstoreClient vstoreClient,
	log logr.Logger,
) *E

New creates a new Embedder.

func (*E) AddFile

func (e *E) AddFile(
	ctx context.Context,
	collectionName,
	modelName,
	fileID,
	fileName,
	filePath string,
	chunkSizeTokens,
	chunkOverlapTokens int64,
) error

AddFile adds a file to the embedder.

func (*E) DeleteFile

func (e *E) DeleteFile(ctx context.Context, collectionName, fileID string) error

DeleteFile deletes a file from the embedder.

func (*E) Search

func (e *E) Search(ctx context.Context, collectionName, modelName, query string, numDocs int) ([]string, error)

Search searches for the matched documents in the embedder for the given query.

type LLMClient

type LLMClient interface {
	Embed(ctx context.Context, modelName, prompt string) ([]float32, error)
	PullModel(ctx context.Context, modelName string) error
}

LLMClient is an interface to handle embedding requests.

Jump to

Keyboard shortcuts

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