FlutterDeviceAiDesktopStub class
Implementation for Windows and Linux, which have no OS-managed language model this package can call yet.
It reports unavailable, so FlutterDeviceAi routes everything through
the configured fallback adapter (by default a local llama.cpp model, see
FlutterDeviceAi.withLocalModel). Without a fallback, calls throw OnDeviceAiUnavailableException.
- Inheritance
-
- Object
- PlatformInterface
- FlutterDeviceAiPlatform
- FlutterDeviceAiDesktopStub
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createSession(
{String? systemInstruction, List< OnDeviceAiTool> ? tools, GenerationConfig? config}) → Future<String> -
Creates a conversation and returns its id.
override
-
downloadModel(
) → Stream< ModelDownloadStatus> -
Asks the OS / browser to download the model, reporting progress.
override
-
getAvailability(
) → Future< OnDeviceAiAvailability> -
Current state of the native model, with a reason when it is not ready.
override
-
getPlatformInfo(
) → Future< OnDeviceAiPlatformInfo> -
What the native backend can do.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openAICorePlayStore(
) → Future< bool> -
Opens the Google AICore page in Play Store (Android only).
inherited
-
sessionAddImage(
String sessionId, Uint8List imageBytes, {String mimeType = 'image/jpeg'}) → Future< void> -
Adds a user image part to the pending turn.
inherited
-
sessionAddQuery(
String sessionId, String text) → Future< void> -
Adds a user text part to the pending turn.
inherited
-
sessionClose(
String sessionId) → Future< void> -
Releases the session.
inherited
-
sessionCountTokens(
String sessionId, {String? text}) → Future< int> -
Token count of the whole conversation, or of
textwhen given.inherited -
sessionGetResponse(
String sessionId, {GenerationConfig? config}) → Future< AiResponse> -
Answers the pending turn.
inherited
-
sessionGetResponseStream(
String sessionId, {GenerationConfig? config}) → Stream< String> -
Answers the pending turn as a stream of text deltas.
inherited
-
sessionStopGeneration(
String sessionId) → Future< void> -
Cancels the generation in flight, if any.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
registerWith(
) → void - Called by the Flutter tool on Windows and Linux.