pub struct FakeAi { /* private fields */ }Expand description
Laravel-style fake model: stub replies, assert prompts.
Implementations§
Source§impl FakeAi
impl FakeAi
pub fn new() -> Self
Sourcepub fn push_text(self, text: impl Into<String>) -> Self
pub fn push_text(self, text: impl Into<String>) -> Self
Queue a one-shot stub (FIFO). Falls back to Self::stub_text default.
Sourcepub fn stub_text(self, text: impl Into<String>) -> Self
pub fn stub_text(self, text: impl Into<String>) -> Self
Default reply when the stub queue is empty (also sets initial queue empty).
pub fn call_count(&self) -> usize
pub fn assert_called(&self)
pub fn assert_called_times(&self, n: usize)
Trait Implementations§
Source§impl LanguageModel for FakeAi
impl LanguageModel for FakeAi
Source§fn generate_text<'life0, 'async_trait>(
&'life0 mut self,
options: LanguageModelOptions,
) -> Pin<Box<dyn Future<Output = AisdkResult<LanguageModelResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_text<'life0, 'async_trait>(
&'life0 mut self,
options: LanguageModelOptions,
) -> Pin<Box<dyn Future<Output = AisdkResult<LanguageModelResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Performs a single, non-streaming text generation request. Read more
Source§fn stream_text<'life0, 'async_trait>(
&'life0 mut self,
options: LanguageModelOptions,
) -> Pin<Box<dyn Future<Output = AisdkResult<Pin<Box<dyn Stream<Item = AisdkResult<Vec<LanguageModelStreamChunk>>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream_text<'life0, 'async_trait>(
&'life0 mut self,
options: LanguageModelOptions,
) -> Pin<Box<dyn Future<Output = AisdkResult<Pin<Box<dyn Stream<Item = AisdkResult<Vec<LanguageModelStreamChunk>>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Performs a streaming text generation request. Read more
impl ReasoningSupport for FakeAi
impl StructuredOutputSupport for FakeAi
impl TextInputSupport for FakeAi
impl TextOutputSupport for FakeAi
impl ToolCallSupport for FakeAi
Auto Trait Implementations§
impl Freeze for FakeAi
impl RefUnwindSafe for FakeAi
impl Send for FakeAi
impl Sync for FakeAi
impl Unpin for FakeAi
impl UnsafeUnpin for FakeAi
impl UnwindSafe for FakeAi
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