pub struct InMemoryProvider { /* private fields */ }Expand description
Deterministic embedding provider for tests and examples.
Implementations§
Trait Implementations§
Source§impl Clone for InMemoryProvider
impl Clone for InMemoryProvider
Source§fn clone(&self) -> InMemoryProvider
fn clone(&self) -> InMemoryProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Component for InMemoryProvider
impl Component for InMemoryProvider
Source§fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the component. Read more
Source§impl Debug for InMemoryProvider
impl Debug for InMemoryProvider
Source§impl Default for InMemoryProvider
impl Default for InMemoryProvider
Source§impl Provider for InMemoryProvider
impl Provider for InMemoryProvider
Source§fn embed<'life0, 'async_trait>(
&'life0 self,
req: EmbedRequest,
) -> Pin<Box<dyn Future<Output = AppResult<EmbedResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn embed<'life0, 'async_trait>(
&'life0 self,
req: EmbedRequest,
) -> Pin<Box<dyn Future<Output = AppResult<EmbedResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate embeddings for one request.
Source§fn embed_batch<'life0, 'async_trait>(
&'life0 self,
reqs: Vec<EmbedRequest>,
) -> Pin<Box<dyn Future<Output = AppResult<Vec<EmbedResponse>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn embed_batch<'life0, 'async_trait>(
&'life0 self,
reqs: Vec<EmbedRequest>,
) -> Pin<Box<dyn Future<Output = AppResult<Vec<EmbedResponse>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate embeddings for a caller-controlled batch of requests.
Source§impl Provider for InMemoryProvider
impl Provider for InMemoryProvider
Source§impl RequestResponse<EmbedRequest, EmbedResponse> for InMemoryProvider
impl RequestResponse<EmbedRequest, EmbedResponse> for InMemoryProvider
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
input: EmbedRequest,
) -> Pin<Box<dyn Future<Output = AppResult<EmbedResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
input: EmbedRequest,
) -> Pin<Box<dyn Future<Output = AppResult<EmbedResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the request and return a single response.
Auto Trait Implementations§
impl Freeze for InMemoryProvider
impl RefUnwindSafe for InMemoryProvider
impl Send for InMemoryProvider
impl Sync for InMemoryProvider
impl Unpin for InMemoryProvider
impl UnsafeUnpin for InMemoryProvider
impl UnwindSafe for InMemoryProvider
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