EmbeddingInput class final

One thing to embed, shaped like Message: optional text plus media.

Media are ENCODED files (JPEG, WAV, …), not decoded pixels or samples. Which containers an engine accepts is engine-defined — its README says, and the loaded model refuses anything else with EmbeddingFormatNotSupportedException before the request is sent.

Bytes are COPIED at construction: an input is immutable, and a view the caller passes would otherwise drag its whole backing buffer along when the input is sent to the embedding worker.

Constructors

EmbeddingInput({String? text, List<Uint8List> images = const [], Uint8List? audio})
Several parts in one vector: optional text, any images and an optional audio clip — for example a photo with its caption.
factory
EmbeddingInput.audio(Uint8List encodedAudio)
One encoded audio clip. Throws ArgumentError if encodedAudio is empty.
factory
EmbeddingInput.image(Uint8List encodedImage)
One encoded image. Throws ArgumentError if encodedImage is empty.
factory
EmbeddingInput.text(String text)
Text to embed. Empty text is valid: it embeds the task prefix and the model's terminators only.
factory

Properties

audio → Uint8List?
The encoded audio clip, or null.
final
hashCode → int
The hash code for this object.
no setterinherited
images → List<Uint8List>
The encoded images, in order. Unmodifiable; empty unless images were given.
final
modalities → Set<EmbeddingModality>
The modalities this input carries. Unmodifiable, never empty.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
text → String?
The text part, or null for a media-only input.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited