embeddingsource

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package embeddingsource defines the input contract carried by managed vectors.

Index

Constants

View Source
const MetaKey = "__nornic_embedding_source"

MetaKey is reserved for the persisted consumed-source descriptor.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyIterator

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

KeyIterator traverses validated names without allocation.

func (*KeyIterator) Next

func (it *KeyIterator) Next() (string, bool)

Next returns the next name, or false after the last name.

type Keys

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

Keys is an immutable, validated view of encoded property names. Iterators borrow the persisted string; no shared mutable cache or selector slices exist.

func (Keys) Contains

func (k Keys) Contains(key string) bool

Contains reports whether a name belongs to this set.

func (Keys) Empty

func (k Keys) Empty() bool

Empty reports whether no names were recorded.

func (Keys) Iterator

func (k Keys) Iterator() KeyIterator

Iterator starts an independent traversal of the names.

type Source

type Source struct {
	Text          bool
	IncludeLabels bool
	Include       []string
	Exclude       []string
	Properties    []string
	AllProperties bool
}

Source describes inputs consumed by one result, including its chunks. Text uses the recorded worker policy; Properties names whole node-property values, including absent keys whose later addition changes input. AllProperties is the conservative default for legacy structured APIs. Providers declare Text/Properties/AllProperties; the text builder supplies the captured policy.

func Read

func Read(meta map[string]any) (s Source, present, valid bool)

Read materializes an independently mutable Source for callers that need it. The storage hot path uses ReadView and never constructs selector slices.

func (Source) Metadata

func (s Source) Metadata() string

Metadata returns an immutable, codec-neutral snapshot. Its private v1 format is version:flags: followed by three counted, byte-length-prefixed key lists (include, exclude, properties). Flags are text=1, all=2, labels=4. Key bytes need no delimiter escaping. A string avoids repeated deep copies of a nested descriptor on every node/transaction copy; both JSON and msgpack preserve it.

type View

type View struct {
	Text, AllProperties, IncludeLabels bool
	Include, Exclude, Properties       Keys
}

View is a zero-allocation interpretation of a validated immutable record.

func ReadView

func ReadView(meta map[string]any) (s View, present, valid bool)

ReadView is the sole decoder. Unsupported or malformed present records never fall back to legacy source semantics. All lengths are checked before slicing.

Jump to

Keyboard shortcuts

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