Struct async_openai::types::CreateEmbeddingRequestArgs
source · pub struct CreateEmbeddingRequestArgs { /* private fields */ }
Expand description
Builder for CreateEmbeddingRequest
.
Implementations§
source§impl CreateEmbeddingRequestArgs
impl CreateEmbeddingRequestArgs
sourcepub fn model<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn model<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.
sourcepub fn input<VALUE: Into<EmbeddingInput>>(&mut self, value: VALUE) -> &mut Self
pub fn input<VALUE: Into<EmbeddingInput>>(&mut self, value: VALUE) -> &mut Self
Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for text-embedding-ada-002
), cannot be an empty string, and any array must be 2048 dimensions or less. Example Python code for counting tokens.
sourcepub fn encoding_format<VALUE: Into<EncodingFormat>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn encoding_format<VALUE: Into<EncodingFormat>>( &mut self, value: VALUE, ) -> &mut Self
The format to return the embeddings in. Can be either float
or base64
. Defaults to float
sourcepub fn user<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn user<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. Learn more.
sourcepub fn dimensions<VALUE: Into<u32>>(&mut self, value: VALUE) -> &mut Self
pub fn dimensions<VALUE: Into<u32>>(&mut self, value: VALUE) -> &mut Self
The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3
and later models.
sourcepub fn build(&self) -> Result<CreateEmbeddingRequest, OpenAIError>
pub fn build(&self) -> Result<CreateEmbeddingRequest, OpenAIError>
Trait Implementations§
source§impl Clone for CreateEmbeddingRequestArgs
impl Clone for CreateEmbeddingRequestArgs
source§fn clone(&self) -> CreateEmbeddingRequestArgs
fn clone(&self) -> CreateEmbeddingRequestArgs
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CreateEmbeddingRequestArgs
impl Debug for CreateEmbeddingRequestArgs
Auto Trait Implementations§
impl Freeze for CreateEmbeddingRequestArgs
impl RefUnwindSafe for CreateEmbeddingRequestArgs
impl Send for CreateEmbeddingRequestArgs
impl Sync for CreateEmbeddingRequestArgs
impl Unpin for CreateEmbeddingRequestArgs
impl UnwindSafe for CreateEmbeddingRequestArgs
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)