EmbeddingWorker class

Main-isolate handle to the embedding worker. Spawns the isolate, performs the load handshake, and multiplexes concurrent requests by id.

Properties

hashCode int
The hash code for this object.
no setterinherited
inputSequenceLength int
Sequence length the forward pass reported at load, or -1 if the engine has none to report (see EmbeddingForwardPass.inputSequenceLength).
final
outputDimension int
Output embedding dimension.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future<void>
Tear down the forward pass and stop the isolate. Waits for the worker to finish native teardown (a _CloseAck, or the isolate's onExit) before killing it, so handles are never freed mid-dispose.
embed(String text, {required String prefix}) Future<List<double>>
Embed one text. The forward runs in the worker; the UI isolate stays free.
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

spawn({required ForwardPassDescriptor descriptor, required String tokenizerPath}) Future<EmbeddingWorker>
Spawn the worker and wait until the forward pass is loaded.