Skip to content

RoutingCandidate

Defined in: src/models/routing/router.ts:57

A model or opaque model group with optional strategy-facing evidence.

Classifier-based strategies may send name, description, and metadata across provider boundaries, so they must not contain secrets. Metadata is stored without copying, so it must not be mutated after construction.

Base instances are frozen automatically. Subclasses must freeze themselves after initializing additional fields.

new RoutingCandidate(options): RoutingCandidate;

Defined in: src/models/routing/router.ts:75

Create an immutable routing candidate.

ParameterTypeDescription
optionsRoutingCandidateOptionsCandidate model, name, description, and metadata

RoutingCandidate

TypeError if metadata is not a plain object

JsonValidationError if metadata contains values that cannot be serialized to JSON

Error if metadata serialization fails for another reason

readonly model:
| Model<BaseModelConfig>
| ModelRouter;

Defined in: src/models/routing/router.ts:59

Concrete model or opaque nested router.


readonly optional name?: string;

Defined in: src/models/routing/router.ts:61

Optional strategy-facing name.


readonly optional description?: string;

Defined in: src/models/routing/router.ts:63

Optional strategy-facing description.


readonly optional metadata?: Readonly<Record<string, JSONValue>>;

Defined in: src/models/routing/router.ts:65

Optional strategy-facing evidence; must be JSON-serializable and free of secrets.