plotembedding

package
v0.0.178 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 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 Idx

func Idx(prefix string) []contract.IndexEntry

func NewDimKey added in v0.0.153

func NewDimKey(prefix string) string

func NewEmbeddingVersionKey added in v0.0.153

func NewEmbeddingVersionKey(prefix string) string

func NewModalityKey added in v0.0.158

func NewModalityKey(prefix string) string

func NewPlotEmbeddingKey added in v0.0.153

func NewPlotEmbeddingKey(prefix string) string

func NewTextKey added in v0.0.153

func NewTextKey(prefix string) string

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