pub trait Decision: Send + Sync {
// Required methods
fn selected_model(&self) -> &str;
fn reasoning(&self) -> Option<&str>;
fn as_any(&self) -> &dyn Any;
// Provided methods
fn routing_tier(&self) -> Option<&str> { ... }
fn is_routed_call(&self) -> bool { ... }
}Expand description
A decision/trace object produced by an algorithm.
Carried as a trait object (not a generic parameter) so a stream consumer can
inspect any algorithm’s decision through this common interface without
knowing the concrete type. as_any is the escape hatch for a consumer that
does know the algo and wants to downcast to the concrete decision.
Required Methods§
Sourcefn selected_model(&self) -> &str
fn selected_model(&self) -> &str
The model this decision selected (e.g. the routed target’s name).
Provided Methods§
Sourcefn routing_tier(&self) -> Option<&str>
fn routing_tier(&self) -> Option<&str>
Stable routing tier for the selected model, when the algorithm provides one.
Sourcefn is_routed_call(&self) -> bool
fn is_routed_call(&self) -> bool
Whether this is the final call selected to serve the request.