discontinuedPackage flutter_gemma has been discontinued and replaced by flutter_edge_ai.

WebModelSession class

Inheritance

Constructors

WebModelSession({required LlmInference llmInference, required VoidCallback onClose, required ModelType modelType, ModelFileType fileType = ModelFileType.task, bool supportImage = false, bool supportAudio = false, String? systemInstruction})

Properties

fileType → ModelFileType
final
hashCode → int
The hash code for this object.
no setterinherited
llmInference → LlmInference
final
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
systemInstruction → String?
final

Methods

addQueryChunk(Message message) → Future<void>
override
close() → Future<void>
override
getResponse() → Future<String>
override
getResponseAsync() → Stream<String>
override
getSessionMetrics() → SessionMetrics
Get session metrics including token usage and performance stats.
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