Skip to content

Add support for new embeddings options/parameters #9

@assembly-winston

Description

@assembly-winston

https://platform.openai.com/docs/api-reference/embeddings/create

There is now an option for controlling the encoding format, and for the new v3 models, the dimensions of the vector. But the EmbeddingsBody doesn't have it

#[derive(Debug, Serialize, Deserialize)]
pub struct EmbeddingsBody {
	/// 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.
	pub model: String,
	/// 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.
	pub input: Vec<String>,
	/// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
	#[serde(skip_serializing_if = "Option::is_none")]
	pub user: Option<String>,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions