pub struct MockEmbeddings;Available on crate feature
test-utils only.Expand description
The mock embedding runtime: every text embeds to one fixed vector, five
texts to a request at ten dimensions. It is the transport of a Local
embedding wire (Self::model).
Implementations§
Source§impl MockEmbeddings
impl MockEmbeddings
Sourcepub fn embed(texts: Vec<String>) -> EmbeddingResponse
pub fn embed(texts: Vec<String>) -> EmbeddingResponse
The reply this runtime gives for texts: one fixed ten-dimension
vector per text, in order.
Trait Implementations§
Source§impl Clone for MockEmbeddings
impl Clone for MockEmbeddings
Source§fn clone(&self) -> MockEmbeddings
fn clone(&self) -> MockEmbeddings
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 moreimpl Copy for MockEmbeddings
Source§impl Debug for MockEmbeddings
impl Debug for MockEmbeddings
Source§impl Default for MockEmbeddings
impl Default for MockEmbeddings
Source§fn default() -> MockEmbeddings
fn default() -> MockEmbeddings
Returns the “default value” for a type. Read more
Source§impl PartialEq for MockEmbeddings
impl PartialEq for MockEmbeddings
impl StructuralPartialEq for MockEmbeddings
Source§impl Transport<Local<Embedding>> for MockEmbeddings
impl Transport<Local<Embedding>> for MockEmbeddings
Source§fn send(
&self,
texts: Vec<String>,
_exchange: Exchange,
) -> Opening<Step<Embedding>> ⓘ
fn send( &self, texts: Vec<String>, _exchange: Exchange, ) -> Opening<Step<Embedding>> ⓘ
Open the reply to one payload. Nothing is sent until the opening is
first polled. A payload the transport cannot send in the exchange’s
mode fails the opening; a failure after the reply opened is its last
frame.
Auto Trait Implementations§
impl Freeze for MockEmbeddings
impl RefUnwindSafe for MockEmbeddings
impl Send for MockEmbeddings
impl Sync for MockEmbeddings
impl Unpin for MockEmbeddings
impl UnsafeUnpin for MockEmbeddings
impl UnwindSafe for MockEmbeddings
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