pub struct Embeddings {
pub data: Vec<Embedding>,
pub model: String,
pub usage: EmbeddingsUsage,
}
Fields§
§data: Vec<Embedding>
§model: String
§usage: EmbeddingsUsage
Implementations§
Source§impl Embeddings
impl Embeddings
Sourcepub async fn create(
model: &str,
input: Vec<&str>,
user: &str,
) -> ApiResponseOrError<Self>
pub async fn create( model: &str, input: Vec<&str>, user: &str, ) -> ApiResponseOrError<Self>
Creates an embedding vector representing the input text.
§Arguments
model
- 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.input
- Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed 8192 tokens in length.user
- A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
pub fn distances(&self) -> Vec<f64>
Trait Implementations§
Source§impl Clone for Embeddings
impl Clone for Embeddings
Source§fn clone(&self) -> Embeddings
fn clone(&self) -> Embeddings
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 moreSource§impl<'de> Deserialize<'de> for Embeddings
impl<'de> Deserialize<'de> for Embeddings
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Embeddings
impl RefUnwindSafe for Embeddings
impl Send for Embeddings
impl Sync for Embeddings
impl Unpin for Embeddings
impl UnwindSafe for Embeddings
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