pub struct MockEmbeddingModel;Available on crate feature
test-utils only.Expand description
A deterministic EmbeddingModel that returns a fixed vector for each input document.
Trait Implementations§
Source§impl Clone for MockEmbeddingModel
impl Clone for MockEmbeddingModel
Source§fn clone(&self) -> MockEmbeddingModel
fn clone(&self) -> MockEmbeddingModel
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 Debug for MockEmbeddingModel
impl Debug for MockEmbeddingModel
Source§impl Default for MockEmbeddingModel
impl Default for MockEmbeddingModel
Source§fn default() -> MockEmbeddingModel
fn default() -> MockEmbeddingModel
Returns the “default value” for a type. Read more
Source§impl EmbeddingModel for MockEmbeddingModel
impl EmbeddingModel for MockEmbeddingModel
Source§const MAX_DOCUMENTS: usize = 5
const MAX_DOCUMENTS: usize = 5
The maximum number of documents that can be embedded in a single request.
Source§fn make(_: &Self::Client, _: impl Into<String>, _: Option<usize>) -> Self
fn make(_: &Self::Client, _: impl Into<String>, _: Option<usize>) -> Self
Construct a model handle from a provider client, model identifier, and optional dimensions.
Source§async fn embed_texts(
&self,
documents: impl IntoIterator<Item = String> + WasmCompatSend,
) -> Result<Vec<Embedding>, EmbeddingError>
async fn embed_texts( &self, documents: impl IntoIterator<Item = String> + WasmCompatSend, ) -> Result<Vec<Embedding>, EmbeddingError>
Embed multiple text documents in a single request
Source§fn embed_text(
&self,
text: &str,
) -> impl Future<Output = Result<Embedding, EmbeddingError>> + WasmCompatSend
fn embed_text( &self, text: &str, ) -> impl Future<Output = Result<Embedding, EmbeddingError>> + WasmCompatSend
Embed a single text document.
Auto Trait Implementations§
impl Freeze for MockEmbeddingModel
impl RefUnwindSafe for MockEmbeddingModel
impl Send for MockEmbeddingModel
impl Sync for MockEmbeddingModel
impl Unpin for MockEmbeddingModel
impl UnsafeUnpin for MockEmbeddingModel
impl UnwindSafe for MockEmbeddingModel
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
Source§impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
fn clone_storage(&self) -> Box<dyn CloneDebuggableStorage>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CloneableStorage for T
impl<T> CloneableStorage for T
fn clone_storage(&self) -> Box<dyn CloneableStorage>
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> 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