Skip to main content

Warmed

Struct Warmed 

Source
pub struct Warmed<C> { /* private fields */ }
Expand description

The door a run’s requests enter the keep-warm account by: it owns the adapter a run calls and is itself the Model the turn loop is handed, so every request that reached the provider is recorded without the turn loop knowing keep-warm exists.

The clock is the caller’s, injected from the one sampling point; the round trip it measures around each call is the lead the next renewal leaves with, so the lead follows the provider this door reaches.

Implementations§

Source§

impl<C: FnMut() -> Result<TimeMs, AxError>> Warmed<C>

Source

pub fn new( model: Box<dyn Model + Send>, setting: KeepWarm, clock: C, ) -> Warmed<C>

Wraps model; under KeepWarm::Off it only forwards.

Source

pub fn next_due(&self) -> Option<u64>

Source

pub fn renew_due(&mut self, now_ms: u64) -> Result<Vec<ModelReturn>, AxError>

Sends every renewal due by now_ms through the adapter this door owns; see Warmth::renew_due.

§Errors

The model’s failure, unchanged.

Trait Implementations§

Source§

impl<C: FnMut() -> Result<TimeMs, AxError>> Model for Warmed<C>

Source§

fn call(&mut self, req: &ModelRequest<'_>) -> Result<ModelReturn, AxError>

Source§

fn call_streaming( &mut self, req: &ModelRequest<'_>, onto: Increments<'_>, ) -> Result<ModelReturn, AxError>

The same call, reporting text as it arrives. Read more
Source§

fn call_speculating( &mut self, req: &ModelRequest<'_>, onto: &mut dyn FnMut(&Increment), _early: &mut dyn FnMut(&ToolCall), ) -> Result<ModelReturn, AxError>

The streaming call, also handing over each tool call as soon as it is complete. Read more

Auto Trait Implementations§

§

impl<C> !RefUnwindSafe for Warmed<C>

§

impl<C> !Sync for Warmed<C>

§

impl<C> !UnwindSafe for Warmed<C>

§

impl<C> Freeze for Warmed<C>
where C: Freeze,

§

impl<C> Send for Warmed<C>
where C: Send,

§

impl<C> Unpin for Warmed<C>
where C: Unpin,

§

impl<C> UnsafeUnpin for Warmed<C>
where C: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.