pub struct ModelAsTool { /* private fields */ }Expand description
Routes a model-selected media tool call to a specialized generation model.
The primary model receives one additional generate_media(prompt) tool. Normal answers pass
through unchanged. A matching tool call becomes a second routed model call whose host client
is responsible for turning the prompt into media.
Implementations§
Trait Implementations§
Source§impl Algorithm for ModelAsTool
impl Algorithm for ModelAsTool
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 route<'async_trait>(
self: Arc<Self>,
driver: Driver,
request: Request,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
fn route<'async_trait>(
self: Arc<Self>,
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_model,
publish Decisions with Driver::decide, and return the final Response.
The method an algorithm implements; run_stream drives it.Source§fn run_stream(self: Arc<Self>, request: Request) -> StepStream
fn run_stream(self: Arc<Self>, request: Request) -> StepStream
Auto Trait Implementations§
impl Freeze for ModelAsTool
impl RefUnwindSafe for ModelAsTool
impl Send for ModelAsTool
impl Sync for ModelAsTool
impl Unpin for ModelAsTool
impl UnsafeUnpin for ModelAsTool
impl UnwindSafe for ModelAsTool
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