pub struct Driver { /* private fields */ }Expand description
How an algorithm’s route makes model calls.
Implementations§
Source§impl Driver
impl Driver
Sourcepub async fn call_model(
&self,
request: Request,
models: Vec<ModelId>,
) -> Result<Response>
pub async fn call_model( &self, request: Request, models: Vec<ModelId>, ) -> Result<Response>
Publish a model call and await the consumer’s response.
Errors if the stream is closed or the call failed.
The await is wrapped in a libsy.llm_call span measuring fulfillment as
the algorithm observes it (host queueing/serving included; a streamed
response resolves when its stream handle arrives); latency, outcome, and
token usage are recorded when it resolves. The provider call itself is the
host’s, and is instrumented by whoever makes it.
Sourcepub async fn call_model_for_category(
&self,
request: Request,
category: Category,
) -> Result<Response>
pub async fn call_model_for_category( &self, request: Request, category: Category, ) -> Result<Response>
Call models in a category from this driver’s parent or subagent scope. Pass the category and the ordered candidate models to the host.
Sourcepub fn models_for(&self, category: &Category) -> &[ModelId]
pub fn models_for(&self, category: &Category) -> &[ModelId]
The available models for this category, typically ordered best-first.
Sourcepub fn first_model_for(&self, category: &Category) -> Result<&ModelId>
pub fn first_model_for(&self, category: &Category) -> Result<&ModelId>
The first available model for category.
Sourcepub fn for_subagent(&self) -> Result<Self>
pub fn for_subagent(&self) -> Result<Self>
A driver scoped to delegated sub-agent work: its categories are the sub-agent’s own, and the parent’s are no longer reachable through it.