fakeembedder

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package fakeembedder provides a fake implementation of genkit.Embedder for testing purposes. The caller must register the values that the fake embedder should return for each document. Asking for the values of an unregistered document panics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Embedder

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

Embedder is a fake implementation of an Embedder.

func New

func New() *Embedder

New returns a new fake embedder.

func (*Embedder) Embed

func (e *Embedder) Embed(ctx context.Context, req *ai.EmbedRequest) (*ai.EmbedResponse, error)

func (*Embedder) Register

func (e *Embedder) Register(d *ai.Document, vals []float32)

Register records the value to return for a Document.

Jump to

Keyboard shortcuts

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