pub struct RoutingOutcome {
pub selected_model_ids: Vec<ModelId>,
pub request: Request,
pub fallback_request: Option<Request>,
pub response: Option<Response>,
pub metadata: Option<OutcomeMetadata>,
pub state: State,
}Expand description
The terminal result of routing.
Fields§
§selected_model_ids: Vec<ModelId>Models selected by the algorithm, ordered best model first.
request: RequestThe request after all routing-time rewrites, stamped with the selected model.
fallback_request: Option<Request>The request the fallback candidates receive instead of request, when routing
rewrote request for the selected model only.
Content-policy denials do not advance to these fallback candidates.
response: Option<Response>A response produced while routing, or None when the client must make the answer call.
metadata: Option<OutcomeMetadata>Outcome identity and optional algorithm evidence.
Constructors leave this empty; Algorithm::run_stream fills it before publishing a
successful outcome.
state: StateRouting state after the run, for hosts that store state outside the algorithm.
Implementations§
Source§impl RoutingOutcome
impl RoutingOutcome
Sourcepub fn selected_model_id(&self) -> Result<&ModelId>
pub fn selected_model_id(&self) -> Result<&ModelId>
The model the algorithm recommends, the best model for this request.
LibsyError::NoTargets if the algorithm selected no models, which should be impossible.