EmbeddingEngine class final

An EmbeddingGemma 2 model, loaded by the page's runtime.

Properties

cacheDir → String?
Always null on the web: the runtime keeps no weight cache.
no setter
hashCode → int
The hash code for this object.
no setterinherited
info → EmbedderInfo
The dimension, the input limit, the modalities and the backend that loaded.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → Future<void>
Deletes the engine.
computeEmbedding(List<Content> contents) → Future<Float32List>
The embedding of contents: at most one text part (its task prefix already in front), any image parts and at most one audio part, one vector for all of them. Throws EmbedderInputTooLongException for an input over the limit (never truncated), ArgumentError for contents it does not take and StateError after close.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

create(EmbeddingEngineConfig config) → Future<EmbeddingEngine>
Loads config.modelPath, a URL the page can fetch (blob:, https:), on WebGPU (Backend.gpu; a page without WebGPU is refused). The vision tower, when config.visionBackend is set, runs on the text tower's backend; the audio tower on config.audioBackend.