pub struct StubModel { /* private fields */ }Expand description
Deterministic stand-in used when no API key / openai feature is present.
Implementations§
Trait Implementations§
Source§impl ModelClient for StubModel
impl ModelClient for StubModel
Source§fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 ModelRequest,
) -> Pin<Box<dyn Future<Output = Result<ModelResponse, CoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 ModelRequest,
) -> Pin<Box<dyn Future<Output = Result<ModelResponse, CoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Produce a complete reply in one shot.
Source§fn stream<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 ModelRequest,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, Result<String, CoreError>>, CoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stream<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 ModelRequest,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, Result<String, CoreError>>, CoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stream the reply as a sequence of tokens. The default implementation
yields the full
ModelResponse::text as a single chunk, so backends
that only support non-streaming calls work unchanged.Auto Trait Implementations§
impl Freeze for StubModel
impl RefUnwindSafe for StubModel
impl Send for StubModel
impl Sync for StubModel
impl Unpin for StubModel
impl UnsafeUnpin for StubModel
impl UnwindSafe for StubModel
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