pub struct Passthrough { /* private fields */ }Expand description
Routing algorithm that always calls one configured target.
Implementations§
Trait Implementations§
Source§impl Algorithm for Passthrough
impl Algorithm for Passthrough
Source§fn name(&self) -> &str
fn name(&self) -> &str
Stable, low-cardinality name identifying this algorithm — the
algorithm attribute on every span, metric, and log line the crate
emits for its runs.Source§fn count_tokens_client(&self) -> Option<Arc<dyn RoutedLlmClient>>
fn count_tokens_client(&self) -> Option<Arc<dyn RoutedLlmClient>>
The client
count_tokens forwards to: the first of
this algorithm’s targets whose client can count tokens (an Anthropic
upstream). The default is None — an algorithm with no Anthropic target
does not support token counting. Read moreSource§fn create_run_task<'async_trait>(
self: Arc<Self>,
ctx: Context,
driver: Driver,
request: Request,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
fn create_run_task<'async_trait>(
self: Arc<Self>,
ctx: Context,
driver: Driver,
request: Request,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
Run one request to completion: make model calls with
Driver::call_llm_target,
publish Decisions with Driver::info, and return the final Response.
The method an algorithm implements; run / run_stream
drive it. ctx carries the request’s cross-cutting values (today: the
algorithm’s telemetry label in Context::values).Source§fn process_signals<'async_trait>(
self: Arc<Self>,
signals: Signals,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
fn process_signals<'async_trait>(
self: Arc<Self>,
signals: Signals,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
Feed the algorithm agentic-stack events (tool results, budgets, etc.). The
reference algorithms ignore signals; a stateful algorithm updates its own
(interior-mutable) state. Takes
self: Arc<Self> like the other run methods.Source§fn count_tokens<'life0, 'async_trait>(
&'life0 self,
request: Request,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count_tokens<'life0, 'async_trait>(
&'life0 self,
request: Request,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Count the tokens
request would use — a direct passthrough to this
algorithm’s Anthropic target (via
count_tokens_client), not a routed
call. Token counting is a pre-flight estimate with no routing decision,
so it deliberately bypasses the classifier cascade (which runs only for
completions via run). Returns the upstream’s JSON
verbatim. Errors when the algorithm has no Anthropic target.Source§fn run_stream(
self: Arc<Self>,
ctx: Context,
request: Request,
observer: Option<RunObserver>,
) -> StepStream
fn run_stream( self: Arc<Self>, ctx: Context, request: Request, observer: Option<RunObserver>, ) -> StepStream
Source§fn run<'async_trait>(
self: Arc<Self>,
ctx: Context,
request: Request,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Arc<dyn Decision>>, Response)>> + Send + 'async_trait>>where
Self: 'async_trait,
fn run<'async_trait>(
self: Arc<Self>,
ctx: Context,
request: Request,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Arc<dyn Decision>>, Response)>> + Send + 'async_trait>>where
Self: 'async_trait,
Source§fn run_observed<'async_trait>(
self: Arc<Self>,
ctx: Context,
request: Request,
observer: Option<RunObserver>,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Arc<dyn Decision>>, Response)>> + Send + 'async_trait>>where
Self: 'async_trait,
fn run_observed<'async_trait>(
self: Arc<Self>,
ctx: Context,
request: Request,
observer: Option<RunObserver>,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Arc<dyn Decision>>, Response)>> + Send + 'async_trait>>where
Self: 'async_trait,
Process a request to completion while reporting each model call to
observer.Auto Trait Implementations§
impl Freeze for Passthrough
impl !RefUnwindSafe for Passthrough
impl Send for Passthrough
impl Sync for Passthrough
impl Unpin for Passthrough
impl UnsafeUnpin for Passthrough
impl !UnwindSafe for Passthrough
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