pub struct Route { /* private fields */ }Expand description
A configured algorithm and the per-target clients its calls resolve through.
Implementations§
Source§impl Route
impl Route
Sourcepub fn new(
algorithm: Arc<dyn Algorithm>,
clients: ClientRouter,
caller_auth: Option<CallerAuthKind>,
capabilities: ModelCapabilities,
anthropic_auxiliary_target: Option<AuxiliaryTarget>,
responses_auxiliary_target: Option<AuxiliaryTarget>,
decision_targets: Vec<DecisionTarget>,
models: RuntimeModels,
) -> Self
pub fn new( algorithm: Arc<dyn Algorithm>, clients: ClientRouter, caller_auth: Option<CallerAuthKind>, capabilities: ModelCapabilities, anthropic_auxiliary_target: Option<AuxiliaryTarget>, responses_auxiliary_target: Option<AuxiliaryTarget>, decision_targets: Vec<DecisionTarget>, models: RuntimeModels, ) -> Self
Creates a fully configured execution route.
Sourcepub fn algorithm_name(&self) -> &str
pub fn algorithm_name(&self) -> &str
Returns the configured libsy algorithm name.
Sourcepub fn capabilities(&self) -> ModelCapabilities
pub fn capabilities(&self) -> ModelCapabilities
Returns model-list capability metadata.
Sourcepub fn caller_auth(&self) -> Option<CallerAuthKind>
pub fn caller_auth(&self) -> Option<CallerAuthKind>
Returns the forwarded caller credential family.
Sourcepub fn models(&self) -> &RuntimeModels
pub fn models(&self) -> &RuntimeModels
Returns the models grouped for one algorithm execution.
Sourcepub fn check_caller_format(
&self,
input_format: WireFormat,
) -> Result<(), RunnerError>
pub fn check_caller_format( &self, input_format: WireFormat, ) -> Result<(), RunnerError>
Rejects a caller format incompatible with forwarded credentials.
Sourcepub async fn execute(
&self,
request: Request,
observer: Option<RunObserver>,
) -> Result<RunOutput, RunnerError>
pub async fn execute( &self, request: Request, observer: Option<RunObserver>, ) -> Result<RunOutput, RunnerError>
Executes the configured route without consuming or proxying streamed responses.
Sourcepub async fn decide(
&self,
request: Request,
) -> Result<RoutingOutcome, RunnerError>
pub async fn decide( &self, request: Request, ) -> Result<RoutingOutcome, RunnerError>
Completes routing-time calls without serving a post-routing completion.
Sourcepub fn apply_infra(
&self,
outcome: &mut RoutingOutcome,
signals: &InfraSignals,
) -> Result<bool, RunnerError>
pub fn apply_infra( &self, outcome: &mut RoutingOutcome, signals: &InfraSignals, ) -> Result<bool, RunnerError>
Apply the optional queue policy to a completed task decision.
The host must hold its in-flight accounting lock through this call and the
increment for the selected model. Ordinary decide leaves task routing unchanged.
Sourcepub async fn decide_with_client(
&self,
request: Request,
client: Arc<dyn RoutedLlmClient>,
) -> Result<RoutingOutcome, RunnerError>
pub async fn decide_with_client( &self, request: Request, client: Arc<dyn RoutedLlmClient>, ) -> Result<RoutingOutcome, RunnerError>
Routes with a host-owned client for routing-time LLM calls, such as judges.
The host owns transport, credentials, and target request settings. Configured HTTP clients, target prompts, and decision clients are not used on this path. The same algorithm instance retains its state across calls. No post-routing completion is dispatched.
Sourcepub async fn call_auxiliary(
&self,
request: Request,
operation: AuxiliaryOperation,
) -> Result<Value, RunnerError>
pub async fn call_auxiliary( &self, request: Request, operation: AuxiliaryOperation, ) -> Result<Value, RunnerError>
Executes a model-bearing provider operation through a compatible target.