ModelSettings class final

The user's model choice: the on-device model, or one of their providers.

Constructors

ModelSettings({bool useThirdParty = false, List<ProviderConfig> providers = const [], String? selectedProviderId})
const
ModelSettings.fromJson(Map<String, Object?> json)
Restores settings written by toJson. Entries that cannot be read are skipped rather than failing the whole settings.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
providers → List<ProviderConfig>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selected → ProviderConfig?
The chosen provider, if it still exists.
no setter
selectedProviderId → String?
final
useThirdParty → bool
Off: features run on the on-device model and nothing leaves the device.
final

Methods

copyWith({bool? useThirdParty, String? selectedProviderId}) → ModelSettings
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
toString() → String
A string representation of this object.
inherited
withoutProvider(String id) → ModelSettings
Removes the provider id; clears the selection if it was selected.
withProvider(ProviderConfig config) → ModelSettings
Adds config, or replaces the entry with the same id. The first provider added becomes the selected one.

Operators

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