FakeOnDeviceAiEmbedder class

Deterministic embedder for tests: hashes words into a fixed-size bag-of-words vector, so texts sharing words score as similar. It is a test double, not a language model; never ship it.

Inheritance

Constructors

FakeOnDeviceAiEmbedder({int dimensions = 64})

Properties

dimensions → int
final
embedded → List<String>
Every text passed to embed / embedQuery, oldest first.
final
hashCode → int
The hash code for this object.
no setterinherited
name → String
Short label for diagnostics.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → Future<void>
Releases native resources.
override
embed(String text) → Future<List<double>>
Embeds a passage that will be stored and searched.
override
embedBatch(List<String> texts) → Future<List<List<double>>>
Embeds texts in order. The default calls embed one by one.
inherited
embedQuery(String text) → Future<List<double>>
Embeds a search query. Models trained with a query instruction override this; the default is embed.
inherited
isReady() → Future<bool>
Whether the model is loaded and can embed right now.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepare({void onProgress(double progress)?}) → Future<void>
Downloads / loads the model so isReady becomes true.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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