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.Source§fn complete_with_tools<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 ModelRequest,
_tools: &'life2 [Tool],
) -> Pin<Box<dyn Future<Output = Result<ModelTurn, CoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn complete_with_tools<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 ModelRequest,
_tools: &'life2 [Tool],
) -> Pin<Box<dyn Future<Output = Result<ModelTurn, CoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Produce a reply that may request tool calls (agentic loop). The default
implementation ignores
tools and delegates to
ModelClient::complete, so backends without function-calling support
degrade to a single-shot reply. Override this to drive the agentic loop.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