pub struct EmbeddingParametersBuilder { /* private fields */ }Expand description
Builder for EmbeddingParameters.
Implementations§
Source§impl EmbeddingParametersBuilder
impl EmbeddingParametersBuilder
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.
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.
Sourcepub fn encoding_format<VALUE: Into<EmbeddingEncodingFormat>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn encoding_format<VALUE: Into<EmbeddingEncodingFormat>>( &mut self, value: VALUE, ) -> &mut Self
The format to return the embeddings in. Can be either float or base64.
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 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.
Sourcepub fn build(
&self,
) -> Result<EmbeddingParameters, EmbeddingParametersBuilderError>
pub fn build( &self, ) -> Result<EmbeddingParameters, EmbeddingParametersBuilderError>
Trait Implementations§
Source§impl Clone for EmbeddingParametersBuilder
impl Clone for EmbeddingParametersBuilder
Source§fn clone(&self) -> EmbeddingParametersBuilder
fn clone(&self) -> EmbeddingParametersBuilder
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 EmbeddingParametersBuilder
impl RefUnwindSafe for EmbeddingParametersBuilder
impl Send for EmbeddingParametersBuilder
impl Sync for EmbeddingParametersBuilder
impl Unpin for EmbeddingParametersBuilder
impl UnwindSafe for EmbeddingParametersBuilder
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