pub struct EmbeddingRequest {
pub input: EmbeddingInput,
pub model: String,
pub dimensions: Option<u32>,
pub encoding_format: Option<EncodingFormat>,
pub user: Option<String>,
pub extra_body: Option<Map<String, Value>>,
}Expand description
Creates an embedding vector representing the input text.
Fields§
§input: EmbeddingInputInput text to embed, encoded as a string, an array of strings, an array of tokens, or an array of token arrays.
The input must not exceed the max input tokens for the model (8192 tokens for all embedding models) and cannot be an empty string.
model: StringID of the model to use, e.g. text-embedding-v4.
dimensions: Option<u32>The number of dimensions the resulting output embeddings should have.
Only supported in text-embedding-3 and later models.
encoding_format: Option<EncodingFormat>The format to return the embeddings in. Can be either float or
base64.
Note that some OpenAI-compatible providers (e.g. Qwen) only support
float.
user: Option<String>A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
extra_body: Option<Map<String, Value>>Add additional JSON properties to the request.
Implementations§
Source§impl EmbeddingRequest
impl EmbeddingRequest
pub fn is_streaming(&self) -> bool
Trait Implementations§
Source§impl Clone for EmbeddingRequest
impl Clone for EmbeddingRequest
Source§fn clone(&self) -> EmbeddingRequest
fn clone(&self) -> EmbeddingRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more