pub struct Embeddings<'c, C: Config> { /* private fields */ }
Expand description
Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.
Related guide: Embeddings
Implementations§
Source§impl<'c, C: Config> Embeddings<'c, C>
impl<'c, C: Config> Embeddings<'c, C>
pub fn new(client: &'c Client<C>) -> Self
Sourcepub async fn create(
&self,
request: CreateEmbeddingRequest,
) -> Result<CreateEmbeddingResponse, OpenAIError>
pub async fn create( &self, request: CreateEmbeddingRequest, ) -> Result<CreateEmbeddingResponse, OpenAIError>
Creates an embedding vector representing the input text.
byot: In serialized request
you must ensure “encoding_format” is not “base64”
Creates an embedding vector representing the input text.
byot: In serialized request
you must ensure “encoding_format” is not “base64”
Sourcepub async fn create_byot<T0: Serialize, R: DeserializeOwned>(
&self,
request: T0,
) -> Result<R, OpenAIError>
pub async fn create_byot<T0: Serialize, R: DeserializeOwned>( &self, request: T0, ) -> Result<R, OpenAIError>
Creates an embedding vector representing the input text.
byot: In serialized request
you must ensure “encoding_format” is not “base64”
Sourcepub async fn create_base64(
&self,
request: CreateEmbeddingRequest,
) -> Result<CreateBase64EmbeddingResponse, OpenAIError>
pub async fn create_base64( &self, request: CreateEmbeddingRequest, ) -> Result<CreateBase64EmbeddingResponse, OpenAIError>
Creates an embedding vector representing the input text.
The response will contain the embedding in base64 format.
byot: In serialized request
you must ensure “encoding_format” is “base64”
Creates an embedding vector representing the input text.
The response will contain the embedding in base64 format.
byot: In serialized request
you must ensure “encoding_format” is “base64”
Sourcepub async fn create_base64_byot<T0: Serialize, R: DeserializeOwned>(
&self,
request: T0,
) -> Result<R, OpenAIError>
pub async fn create_base64_byot<T0: Serialize, R: DeserializeOwned>( &self, request: T0, ) -> Result<R, OpenAIError>
Creates an embedding vector representing the input text.
The response will contain the embedding in base64 format.
byot: In serialized request
you must ensure “encoding_format” is “base64”