pub struct EmbeddingRequestBuilder { /* private fields */ }
Expand description
Builder for EmbeddingRequest
.
Implementations§
Source§impl EmbeddingRequestBuilder
impl EmbeddingRequestBuilder
Sourcepub fn input(&mut self, value: EmbeddingInput) -> &mut Self
pub fn input(&mut self, value: EmbeddingInput) -> &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.
Sourcepub fn model(&mut self, value: EmbeddingModel) -> &mut Self
pub fn model(&mut self, value: EmbeddingModel) -> &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 encoding_format(&mut self, value: EmbeddingEncodingFormat) -> &mut Self
pub fn encoding_format(&mut self, value: EmbeddingEncodingFormat) -> &mut Self
The format to return the embeddings in. Can be either float or base64.
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 can help OpenAI to monitor and detect abuse. Learn more.
Sourcepub fn build(&self) -> Result<EmbeddingRequest, EmbeddingRequestBuilderError>
pub fn build(&self) -> Result<EmbeddingRequest, EmbeddingRequestBuilderError>
Trait Implementations§
Source§impl Clone for EmbeddingRequestBuilder
impl Clone for EmbeddingRequestBuilder
Source§fn clone(&self) -> EmbeddingRequestBuilder
fn clone(&self) -> EmbeddingRequestBuilder
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 moreAuto Trait Implementations§
impl Freeze for EmbeddingRequestBuilder
impl RefUnwindSafe for EmbeddingRequestBuilder
impl Send for EmbeddingRequestBuilder
impl Sync for EmbeddingRequestBuilder
impl Unpin for EmbeddingRequestBuilder
impl UnwindSafe for EmbeddingRequestBuilder
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