ModelResolver class final
Turns the user's ModelSettings into the LanguageModel features run on.
There is no silent fallback in either direction: with third-party providers off, the on-device model is used even if it is unavailable; with them on, an incomplete selection fails with SystemLlmException.notConfigured instead of quietly using another model.
Constructors
- ModelResolver({required ApiKeyStore keyStore, OnDeviceModel onDevice = const OnDeviceModel(), Client? client, Duration timeout = const Duration(seconds: 90)})
-
const
Properties
- client → Client?
-
Shared HTTP client for remote models; the caller owns and closes it.
Without one, each remote model creates its own and releases it in
RemoteLanguageModel.close.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- keyStore → ApiKeyStore
-
final
- onDevice → OnDeviceModel
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeout → Duration
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolve(
ModelSettings settings) → Future< LanguageModel> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited