pub struct EmbeddingRequest {
pub model: String,
pub input: Value,
pub encoding_format: Option<String>,
pub dimensions: Option<u32>,
pub user: Option<String>,
}Expand description
Request body for POST /v1/embeddings.
Fields§
§model: String§input: Value§encoding_format: Option<String>§dimensions: Option<u32>§user: Option<String>Implementations§
Source§impl EmbeddingRequest
impl EmbeddingRequest
Sourcepub fn new(model: impl Into<String>, input: impl Into<String>) -> Self
pub fn new(model: impl Into<String>, input: impl Into<String>) -> Self
Create an embedding request with a single string input.
Sourcepub fn new_batch(model: impl Into<String>, inputs: Vec<String>) -> Self
pub fn new_batch(model: impl Into<String>, inputs: Vec<String>) -> Self
Create an embedding request with multiple string inputs.
Sourcepub fn encoding_format(self, format: impl Into<String>) -> Self
pub fn encoding_format(self, format: impl Into<String>) -> Self
Set the encoding format (e.g. “float”, “base64”).
Sourcepub fn dimensions(self, dims: u32) -> Self
pub fn dimensions(self, dims: u32) -> Self
Set the number of dimensions for the embedding.
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 · 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