ModelRef
Category: Core
Source: model_ref.dart
A fully-qualified model identifier: <provider-id>/<model-id>.
Status: part of the proposed core data model — see docs/plans/2026-04-29-harness-layers.md. Originally lived in catalog/model_ref.dart; relocated so any subsystem (strategies, session metadata, the proposed event vocabulary) can depend on it without crossing the harness boundary.
The split is on the first slash only, so model ids that themselves contain slashes round-trip correctly — e.g. a user-typed OpenRouter slug: openrouter/anthropic/claude-sonnet-4.6 → provider openrouter, model anthropic/claude-sonnet-4.6.
Classes
ModelRef
Constructor
const ModelRef({required this.providerId, required this.modelId})Properties
| Property | Type | Description |
|---|---|---|
providerId | String | |
modelId | String | |
operator | bool | |
hashCode | int get | |
hashCode | int get |
Methods
static ModelRef parse(String input)
Parse a provider/model string. Throws [ModelRefParseException] if either side is empty or the separator is missing.
static ModelRef? tryParse(String input)
Non-throwing variant — returns null if [input] is malformed.
String toString()
ModelRefParseException
Constructor
ModelRefParseException(this.message)Properties
| Property | Type | Description |
|---|---|---|
message | String |