pub struct EmbeddingsApi<'a>(/* private fields */);
Expand description
EmbeddingsApi
struct to interact with the embeddings endpoint of the API.
Implementations§
Source§impl<'a> EmbeddingsApi<'a>
impl<'a> EmbeddingsApi<'a>
Sourcepub async fn create(
&self,
input: &str,
model: &str,
encoding_format: Option<&str>,
dimensions: Option<u64>,
user: Option<&str>,
) -> OpenAIResult<Value>
pub async fn create( &self, input: &str, model: &str, encoding_format: Option<&str>, dimensions: Option<u64>, user: Option<&str>, ) -> OpenAIResult<Value>
Create an embedding using the provided parameters.
§Arguments
input
- The input text for which to create embeddings.model
- The name of the model to use for creating embeddings.encoding_format
- Optional encoding format.dimensions
- Optional number of dimensions for the embeddings.user
- Optional user ID.
§Returns
A Result containing the JSON response as serde_json::Value
on success, or an OpenAIError
on failure.
Auto Trait Implementations§
impl<'a> Freeze for EmbeddingsApi<'a>
impl<'a> !RefUnwindSafe for EmbeddingsApi<'a>
impl<'a> Send for EmbeddingsApi<'a>
impl<'a> Sync for EmbeddingsApi<'a>
impl<'a> Unpin for EmbeddingsApi<'a>
impl<'a> !UnwindSafe for EmbeddingsApi<'a>
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