WebEmbeddingModel class

Inheritance
  • Object
  • EmbeddingModel
  • WebEmbeddingModel
Mixed-in types
  • CloseNotifier

Constructors

WebEmbeddingModel({required VoidCallback onClose, String? modelPath, String? tokenizerPath})

Properties

activeBackend → PreferredBackend?
Null, and stated rather than inherited: on web the runtime picks the accelerator itself and the answer does not exist until the first embedding, so a synchronous getter cannot carry it. The JS side reports it — window.getLiteRtEmbeddingAccelerator() and getLiteRtEmbeddingFullyAccelerated(). Saying so here keeps "we cannot know" distinguishable from "nobody thought about it", which a default alone cannot.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
isClosed → bool
Whether close has already been called.
no setteroverride
modelPath → String?
no setter
onClose → VoidCallback
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tokenizerPath → String?
no setter

Methods

addCloseListener(VoidCallback listener) → void
inherited
close() → Future<void>
Close the embedding model and release resources.
override
fireCloseListeners() → void
inherited
generateEmbedding(String text, {TaskType taskType = TaskType.retrievalQuery}) → Future<List<double>>
Generate embedding vector for given text.
override
generateEmbeddings(List<String> texts, {TaskType taskType = TaskType.retrievalQuery}) → Future<List<List<double>>>
Generate embedding vectors for multiple texts.
override
getDimension() → Future<int>
Get the dimension of embedding vectors generated by this model.
override
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