RemoteCatalogEnrichment class final
Holds the preloaded RemoteModelsCatalog for the lifetime of the process. Hosts (CLI startup, app boot) inject the catalog once; the rest of the code calls mergeFor and mediaFor to fold catalog hints into the endpoint-reported model list without re-fetching.
Constructors
Properties
- cached → RemoteModelsCatalog?
-
Returns the live parsed catalog (or null when no preload ran).
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
chatFallbackFor(
String? providerKind) → List< String> -
Chat model ids the catalog knows about for
providerKind— the LAST-RESORT fallback the picker uses when the live/v1/modelsfetch is empty. Endpoint-reported ids always win; this list is only consulted on the empty-result branch so the picker stays useful when the endpoint can't answer. -
mediaFor(
String? providerKind, String slot) → List< String> -
Media-model ids the catalog lists for
providerKind/slot, or an empty list when the catalog has no opinion. -
mergeFor(
ModelsEndpointInfo info, String? providerKind, {List< String> mediaSlot = const []}) → ModelsEndpointInfo -
Merges the cached catalog into
infoforproviderKind. Used by hosts that want the merged view directly (pickers, settings flows) rather than going through the dispatcher twice. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
preload(
{Uri? url, Client? client}) → Future< void> -
Loads the catalog via fetchRemoteModelsCatalog. Failures (any
network, timeout, or parse error) leave
_cacheduntouched so a later preload can recover without surfacing prior failures. -
pricingFor(
String? providerKind, String modelId) → RemoteModelPricing? -
Flat per-Mtok pricing the catalog lists for
providerKind/modelId, or null when the catalog ships no number — the picker renders—(never 0.00) on a miss (issue #278 E3). -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited