ModelsConfig class final
The parsed models: section: media slot overrides plus named custom
model definitions. Mutable like CustomProviderRegistry — the REPL
(/models set//models remove) updates the live instance and the
executable persists it with the usual config save.
Constructors
-
ModelsConfig({Map<
String, MediaSlotModelConfig> ? slots, Map<String, CustomModelDefinition> ? custom, ModelCapabilityOverrides? overrides}) - Creates an empty (or pre-populated) models config.
- ModelsConfig.fromYaml(Object? node)
-
Parses the
models:yaml node, strictly: the node must be a map with onlyslots/custom/overrideskeys; slot names must come from mediaModelSlotIds; entry-level rules are in MediaSlotModelConfig.fromYaml, CustomModelDefinition.fromYaml, and ModelCapabilityOverrides.fromYaml.factory
Properties
-
custom
→ Map<
String, CustomModelDefinition> -
Named custom model definitions (
/model <name>targets).final - hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
True when neither section carries an entry (the config file then
omits the whole
models:section on save).no setter - overrides ↔ ModelCapabilityOverrides
-
Per-provider+model capability overrides (gh-1426): the resolver's
top layer — survives every catalog refresh (the entries live HERE,
in the config file, never in catalog data). Mutable like the rest of
ModelsConfig: the settings flows swap the live map after a
validated config write (reload-after-write, last writer wins).
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
slots
→ Map<
String, MediaSlotModelConfig> -
Per-slot media overrides, keyed by mediaModelSlotIds name.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeOverride(
String provider, String modelId) → bool -
Removes the capability override for
provider/modelId; returns false when none was set. -
removeSlotOverride(
String slot) → bool -
Removes the override for
slot; returns false when none was set. -
setOverride(
String provider, String modelId, ModelCapabilityOverride override) → void -
Registers (or replaces) the capability override for
provider/modelId. -
setSlotOverride(
String slot, MediaSlotModelConfig override) → void -
Sets (or replaces) the override for
slot, which must be one of mediaModelSlotIds. -
toString(
) → String -
A string representation of this object.
inherited
-
toYaml(
) → String -
Serializes the
models:section (only called when non-empty). Slots emit in mediaModelSlotIds declaration order; custom definitions and capability overrides in insertion order.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited