pub struct EmbeddingRequest {
pub model: String,
pub input: EmbeddingInput,
pub dimensions: Option<u32>,
pub user: Option<String>,
}Expand description
Request payload for /embeddings.
Fields§
§model: StringModel ID (e.g. text-embedding-3-small).
input: EmbeddingInputInput text or array of texts to embed.
dimensions: Option<u32>Optional target dimensions for models supporting truncation.
user: Option<String>Optional user ID.
Implementations§
Source§impl EmbeddingRequest
impl EmbeddingRequest
Sourcepub fn new(model: impl Into<String>, input: impl Into<EmbeddingInput>) -> Self
pub fn new(model: impl Into<String>, input: impl Into<EmbeddingInput>) -> Self
Construct a new embedding request.
Sourcepub fn dimensions(self, dims: u32) -> Self
pub fn dimensions(self, dims: u32) -> Self
Set dimensions.
Trait Implementations§
Source§impl Clone for EmbeddingRequest
impl Clone for EmbeddingRequest
Source§fn clone(&self) -> EmbeddingRequest
fn clone(&self) -> EmbeddingRequest
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 EmbeddingRequest
impl Debug for EmbeddingRequest
Source§impl<'de> Deserialize<'de> for EmbeddingRequest
impl<'de> Deserialize<'de> for EmbeddingRequest
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 EmbeddingRequest
impl RefUnwindSafe for EmbeddingRequest
impl Send for EmbeddingRequest
impl Sync for EmbeddingRequest
impl Unpin for EmbeddingRequest
impl UnsafeUnpin for EmbeddingRequest
impl UnwindSafe for EmbeddingRequest
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