pub struct EmbedRequest {
pub request_id: RequestId,
pub model: Option<ModelId>,
pub input: EmbedInput,
pub encoding_format: EncodingFormat,
pub dimensions: Option<u32>,
}Expand description
Request for generating embeddings.
Fields§
§request_id: RequestIdUnique request identifier.
model: Option<ModelId>Model to use for embeddings.
input: EmbedInputInput texts to embed.
encoding_format: EncodingFormatEncoding format for the embeddings.
dimensions: Option<u32>Dimensionality for the embeddings (if model supports it).
Implementations§
Source§impl EmbedRequest
impl EmbedRequest
Sourcepub fn new(input: impl Into<EmbedInput>) -> Self
pub fn new(input: impl Into<EmbedInput>) -> Self
Creates a new embedding request.
Sourcepub fn with_model(self, model: impl Into<ModelId>) -> Self
pub fn with_model(self, model: impl Into<ModelId>) -> Self
Sets the model to use.
Sourcepub fn with_encoding_format(self, format: EncodingFormat) -> Self
pub fn with_encoding_format(self, format: EncodingFormat) -> Self
Sets the encoding format.
Sourcepub fn with_dimensions(self, dims: u32) -> Self
pub fn with_dimensions(self, dims: u32) -> Self
Sets the output dimensions.
Trait Implementations§
Source§impl Clone for EmbedRequest
impl Clone for EmbedRequest
Source§fn clone(&self) -> EmbedRequest
fn clone(&self) -> EmbedRequest
Returns a duplicate of the value. Read more
1.0.0 · 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 EmbedRequest
impl Debug for EmbedRequest
Source§impl<'de> Deserialize<'de> for EmbedRequest
impl<'de> Deserialize<'de> for EmbedRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EmbedRequest
impl RefUnwindSafe for EmbedRequest
impl Send for EmbedRequest
impl Sync for EmbedRequest
impl Unpin for EmbedRequest
impl UnwindSafe for EmbedRequest
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