DesktopInferenceModelSession class

Desktop implementation of InferenceModelSession.

Uses gRPC to communicate with the LiteRT-LM server. Buffers query chunks, images, and audio until getResponse is called.

Thread Safety: This session is NOT thread-safe. All method calls must originate from the same isolate. Concurrent access from multiple isolates may cause undefined behavior.

Inheritance

Constructors

DesktopInferenceModelSession({required LiteRtLmClient grpcClient, required ModelType modelType, required ModelFileType fileType, required bool supportImage, required bool supportAudio, required VoidCallback onClose})

Properties

fileType ModelFileType
final
grpcClient LiteRtLmClient
final
hashCode int
The hash code for this object.
no setterinherited
modelType ModelType
final
onClose VoidCallback
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportAudio bool
final
supportImage bool
final

Methods

addQueryChunk(Message message) Future<void>
override
close() Future<void>
override
getResponse() Future<String>
override
getResponseAsync() Stream<String>
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sizeInTokens(String text) Future<int>
override
stopGeneration() Future<void>
override
toString() String
A string representation of this object.
inherited

Operators

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