Skip to main content

RoutedLlmClient

Trait RoutedLlmClient 

Source
pub trait RoutedLlmClient: Send + Sync {
    // Required method
    fn call<'life0, 'async_trait>(
        &'life0 self,
        request: Request,
        decision: Decision,
    ) -> Pin<Box<dyn Future<Output = Result<Response, LlmClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Performs the actual model call for a target. This is the one piece of I/O the library does not own — a host implements it over its own transport (HTTP SDK, in-process model, mock). It serves a call the stream consumer chose not to override, reached as a routed request’s default_client.

§Concurrency

A client may be shared by many targets and concurrent algorithm runs. Calls may overlap, so implementations must synchronize mutable state internally and should not serialize requests unless their transport requires it.

Required Methods§

Source

fn call<'life0, 'async_trait>( &'life0 self, request: Request, decision: Decision, ) -> Pin<Box<dyn Future<Output = Result<Response, LlmClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Serve the model identified by decision.selected_model_id(), resolving it to the provider model this client calls. request.llm_request.model is the agent’s original name, carried through for reference, not a call target.

Implementors§