ProviderModelBinding class final
The complete identity of one provider+model choice: the catalog record (or custom entry) name, the wire kind, the normalized endpoint, the model id, the key's env indirection, and the provenance.
Construct ONLY through ProviderModelBinding.resolve — the single validating constructor. Every field is immutable; equality covers the identity fields (record, wire, endpoint, model, key ref) so a persisted state can round-trip (I5) regardless of which entry point authored the binding.
Constructors
- ProviderModelBinding.resolve({required String providerKind, required String modelId, String? baseUrl, String? recordName, String? keyEnvRef, BindingProvenance provenance = BindingProvenance.command, String? wire})
-
Resolves and VALIDATES one provider+model choice.
factory
Properties
- baseUrl → String
-
The serving endpoint, normalized (no trailing slash). Never empty.
final
- catalogRecord → String
-
The RESOLVED catalog record the binding rides —
spec.namefrom the oneresolveCliProviderSpeclookup (or the record the caller passed). Callers that need the spec (e.g. the provider queue's model/adapter factory) read it here instead of re-deriving the legacy openai/openrouter rule from the kind + URL.final - hashCode → int
-
The hash code for this object.
no setteroverride
- keyEnvRef → String?
-
The key's environment indirection (the env var NAME the key resolves
from), or null for keyless endpoints. Never a key value (S3).
final
- modelId → String
-
The model id exactly as the caller spelled it (trimmed).
final
- provenance → BindingProvenance
-
Where this binding was authored.
final
- providerKind → String
-
The WIRE kind the session speaks (
openai-completions,anthropic,google,zai,minimax,dial,copilot,chatgpt-codex,aiin) — the resolved ProviderSpec.kind, or thewire:override.final - recordName → String?
-
The catalog or saved custom record this binding rides, when the
caller named one. Null on kind-only bindings with their own endpoint.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- wireOverride → bool
-
Whether an explicit
wire:override authored the wire kind — echoed in every report so a silenced dialect check is never invisible (E6).final
Methods
-
echo(
) → String - The one-line report (boot notices, switch confirmations, restore notes). Names record, wire, endpoint, model, key indirection, and the wire override when present — never a key value.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
Identity equality (I5 round-trips): record, wire, endpoint, model,
key ref. Provenance and the override flag describe the AUTHOR, not
the identity.
override