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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RoutingCandidate(options): RoutingCandidate;Defined in: src/models/routing/router.ts:75
Create an immutable routing candidate.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | RoutingCandidateOptions | Candidate model, name, description, and metadata |
Returns
Section titled “Returns”RoutingCandidate
Throws
Section titled “Throws”TypeError if metadata is not a plain object
Throws
Section titled “Throws”JsonValidationError if metadata contains values that cannot be serialized to JSON
Throws
Section titled “Throws”Error if metadata serialization fails for another reason
Properties
Section titled “Properties”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.
description?
Section titled “description?”readonly optional description?: string;Defined in: src/models/routing/router.ts:63
Optional strategy-facing description.
metadata?
Section titled “metadata?”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.