pub struct MultiPipelineRouter { /* private fields */ }Expand description
Routes incoming prompts across multiple named pipeline instances.
Build via MultiPipelineRouter::builder().
Implementations§
Source§impl MultiPipelineRouter
impl MultiPipelineRouter
Sourcepub fn builder() -> MultiPipelineRouterBuilder
pub fn builder() -> MultiPipelineRouterBuilder
Create a new builder.
Sourcepub fn classify(&self, request: &PromptRequest) -> PromptClass
pub fn classify(&self, request: &PromptRequest) -> PromptClass
Classify a prompt request using the heuristic classifier.
Respects an optional "pipeline_class" key in request.meta for
explicit override.
Sourcepub async fn route(
&self,
request: PromptRequest,
) -> Result<(), OrchestratorError>
pub async fn route( &self, request: PromptRequest, ) -> Result<(), OrchestratorError>
Route a request to the best-fit pipeline.
Routing priority:
- Pipeline whose
target_classmatches the classified prompt. - Any pipeline that lists the class in
also_serves. - First pipeline (default/general fallback).
§Errors
Returns OrchestratorError::ChannelClosed if the selected
pipeline’s input channel is closed.
Sourcepub fn stats(&self) -> Vec<PipelineRoutingStats>
pub fn stats(&self) -> Vec<PipelineRoutingStats>
Return a snapshot of routing statistics per pipeline.
Sourcepub fn record_latency(&self, pipeline_name: &str, latency_ms: f64)
pub fn record_latency(&self, pipeline_name: &str, latency_ms: f64)
Record observed latency for a pipeline (called by the pipeline consumer).
Auto Trait Implementations§
impl !RefUnwindSafe for MultiPipelineRouter
impl !UnwindSafe for MultiPipelineRouter
impl Freeze for MultiPipelineRouter
impl Send for MultiPipelineRouter
impl Sync for MultiPipelineRouter
impl Unpin for MultiPipelineRouter
impl UnsafeUnpin for MultiPipelineRouter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request