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 model() -> MockEmbeddingModel
pub fn model() -> MockEmbeddingModel
The mock embedding model: its local wire over this runtime.
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
impl Copy for MockEmbeddings
Source§impl Debug for MockEmbeddings
impl Debug for MockEmbeddings
Source§impl Default for MockEmbeddings
impl Default for MockEmbeddings
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more