pub struct TestClient { /* private fields */ }Expand description
Simple test client that emits a deterministic response.
Implementations§
Source§impl TestClient
impl TestClient
pub fn new(events: Vec<LlmEvent>) -> TestClient
Trait Implementations§
Source§impl Default for TestClient
impl Default for TestClient
Source§fn default() -> TestClient
fn default() -> TestClient
Returns the “default value” for a type. Read more
Source§impl LlmClient for TestClient
impl LlmClient for TestClient
Source§fn stream<'a>(
&'a self,
_request: &'a LlmRequest,
) -> Pin<Box<dyn Stream<Item = Result<LlmEvent, LlmError>> + Send + 'a>>
fn stream<'a>( &'a self, _request: &'a LlmRequest, ) -> Pin<Box<dyn Stream<Item = Result<LlmEvent, LlmError>> + Send + 'a>>
Stream a completion request Read more
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), LlmError>> + Send + 'async_trait>>where
'life0: 'async_trait,
TestClient: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), LlmError>> + Send + 'async_trait>>where
'life0: 'async_trait,
TestClient: 'async_trait,
Check if the client is healthy/connected
Source§fn compile_schema(
&self,
output_schema: &OutputSchema,
) -> Result<CompiledSchema, SchemaError>
fn compile_schema( &self, output_schema: &OutputSchema, ) -> Result<CompiledSchema, SchemaError>
Compile an output schema for this provider. Read more
Auto Trait Implementations§
impl Freeze for TestClient
impl RefUnwindSafe for TestClient
impl Send for TestClient
impl Sync for TestClient
impl Unpin for TestClient
impl UnsafeUnpin for TestClient
impl UnwindSafe for TestClient
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