plotembedding

package
v0.0.361 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 8 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

View Source
var (
	VKeyFn                = contract.PathKeyFn(VKey)
	EmbeddingVersionKeyFn = contract.PathKeyFn(EmbeddingVersionKey)
	DimKeyFn              = contract.PathKeyFn(DimKey)
	ModalityKeyFn         = contract.PathKeyFn(ModalityKey)
	PlotEmbeddingKeyFn    = contract.PathKeyFn(PlotEmbeddingKey)
)
View Source
var (
	TextKeyFn    = contract.PathKeyFn(TextKey)
	FileKeyFn    = contract.PathKeyFn(FileKey)
	FileURLKeyFn = contract.PathKeyFn(FileURLKey)
	MIMEKeyFn    = contract.PathKeyFn(MIMEKey)
)

Functions

func Idx

func Idx(p ...string) []contract.IndexEntry

func Rules

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