pub struct EmbeddingModel<H = Client> {
pub model: String,
pub encoding_format: Option<EncodingFormat>,
pub user: Option<String>,
/* private fields */
}Fields§
§model: String§encoding_format: Option<EncodingFormat>§user: Option<String>Implementations§
Source§impl<H> EmbeddingModel<H>where
Client<CopilotExt, H>: HttpClientExt + Clone + Debug + 'static,
H: Clone + Default + Debug + 'static,
impl<H> EmbeddingModel<H>where
Client<CopilotExt, H>: HttpClientExt + Clone + Debug + 'static,
H: Clone + Default + Debug + 'static,
pub fn new( client: Client<CopilotExt, H>, model: impl Into<String>, ndims: usize, ) -> EmbeddingModel<H>
Trait Implementations§
Source§impl<H> Clone for EmbeddingModel<H>where
H: Clone,
impl<H> Clone for EmbeddingModel<H>where
H: Clone,
Source§fn clone(&self) -> EmbeddingModel<H>
fn clone(&self) -> EmbeddingModel<H>
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<H> EmbeddingModel for EmbeddingModel<H>where
Client<CopilotExt, H>: HttpClientExt + Clone + Debug + WasmCompatSend + WasmCompatSync + 'static,
H: Clone + Default + Debug + WasmCompatSend + WasmCompatSync + 'static,
impl<H> EmbeddingModel for EmbeddingModel<H>where
Client<CopilotExt, H>: HttpClientExt + Clone + Debug + WasmCompatSend + WasmCompatSync + 'static,
H: Clone + Default + Debug + WasmCompatSend + WasmCompatSync + 'static,
Source§const MAX_DOCUMENTS: usize = 1024
const MAX_DOCUMENTS: usize = 1024
The maximum number of documents that can be embedded in a single request.
Source§type Client = Client<CopilotExt, H>
type Client = Client<CopilotExt, H>
Provider client type used to construct this embedding model.
Source§fn make(
client: &<EmbeddingModel<H> as EmbeddingModel>::Client,
model: impl Into<String>,
ndims: Option<usize>,
) -> EmbeddingModel<H>
fn make( client: &<EmbeddingModel<H> as EmbeddingModel>::Client, model: impl Into<String>, ndims: Option<usize>, ) -> EmbeddingModel<H>
Construct a model handle from a provider client, model identifier, and optional dimensions.
Source§async fn embed_texts(
&self,
documents: impl IntoIterator<Item = String>,
) -> Result<Vec<Embedding>, EmbeddingError>
async fn embed_texts( &self, documents: impl IntoIterator<Item = String>, ) -> 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.
Source§fn embed_texts_with_usage(
&self,
texts: impl IntoIterator<Item = String> + WasmCompatSend,
) -> impl Future<Output = Result<EmbeddingResponse, EmbeddingError>> + WasmCompatSend
fn embed_texts_with_usage( &self, texts: impl IntoIterator<Item = String> + WasmCompatSend, ) -> impl Future<Output = Result<EmbeddingResponse, EmbeddingError>> + WasmCompatSend
Embed multiple text documents in a single request and return token usage. Read more
Source§fn embed_text_with_usage(
&self,
text: &str,
) -> impl Future<Output = Result<EmbeddingResponse, EmbeddingError>> + WasmCompatSend
fn embed_text_with_usage( &self, text: &str, ) -> impl Future<Output = Result<EmbeddingResponse, EmbeddingError>> + WasmCompatSend
Embed a single text document and return token usage. Read more
Auto Trait Implementations§
impl<H = Client> !RefUnwindSafe for EmbeddingModel<H>
impl<H = Client> !UnwindSafe for EmbeddingModel<H>
impl<H> Freeze for EmbeddingModel<H>where
H: Freeze,
impl<H> Send for EmbeddingModel<H>where
H: Send,
impl<H> Sync for EmbeddingModel<H>where
H: Sync,
impl<H> Unpin for EmbeddingModel<H>where
H: Unpin,
impl<H> UnsafeUnpin for EmbeddingModel<H>where
H: UnsafeUnpin,
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