plotembedding

package
v0.0.191 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VKey                = "v"
	EmbeddingVersionKey = "embedding_version"
	DimKey              = "dim"
	NormalizedKey       = "normalized"
	ModalityKey         = "modality"
	PlotEmbeddingKey    = "plot_embedding"
)
View Source
const (
	TextKey    = "text"
	FileKey    = "file"
	FileURLKey = "file_url"
	MIMEKey    = "mime"
)

Variables

This section is empty.

Functions

func DimKeyFn added in v0.0.186

func DimKeyFn(prefix string) string

func EmbeddingVersionKeyFn added in v0.0.186

func EmbeddingVersionKeyFn(prefix string) string

func Idx

func Idx(prefix string) []contract.IndexEntry

func ModalityKeyFn added in v0.0.186

func ModalityKeyFn(prefix string) string

func PlotEmbeddingKeyFn added in v0.0.186

func PlotEmbeddingKeyFn(prefix string) string

func Rules

func TextKeyFn added in v0.0.186

func TextKeyFn(prefix string) string

Types

type Comp

type Comp struct {
	contract.EmbedR `bson:",inline" validate:"recurse"`
	PlotEmbedding   *[]float32 `json:"plot_embedding" validate:"nnpt,nz"`
}

func (*Comp) GetPlotEmbedding

func (c *Comp) GetPlotEmbedding() []float32

func (*Comp) SetPlotEmbedding

func (c *Comp) SetPlotEmbedding(x []float32)

type Core

type Core struct {
	contract.EmbedC `bson:",inline" validate:"recurse"`
}

func ApplyCore

func ApplyCore(c *Core, modifiers ...CoreOption) Core

type CoreOption

type CoreOption = contracti.CoreOption[Core]

func WithEmbedC added in v0.0.136

func WithEmbedC(x contract.EmbedC) CoreOption

type Meta

type Meta struct{}

func ApplyMeta

func ApplyMeta(m *Meta, modifiers ...MetaOption) Meta

type MetaOption

type MetaOption = contract.MetaOption[Meta]

type PlotEmbedding

type PlotEmbedding struct {
	Meta `bson:",inline" validate:"recurse"`
	Comp `bson:",inline" validate:"recurse"`
	Core `bson:",inline" validate:"recurse"`
}

PlotEmbedding defines an embedding.

func Mock

func Mock(e contract.EmbedC) *PlotEmbedding

func MockWithComp added in v0.0.177

func MockWithComp(e contract.EmbedC, mod contract.Modality) *PlotEmbedding

func New

func New(m Meta, cr Core) *PlotEmbedding

func (*PlotEmbedding) Compute

func (r *PlotEmbedding) Compute(ctx context.Context, op contract.EmbedderOperator, noop bool) error

Jump to

Keyboard shortcuts

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