CreateEmbeddingsRequest

data class CreateEmbeddingsRequest(val model: String, val input: List<String>, val dimensions: Int? = null, val encodingFormat: String? = "float", val user: String? = null)(source)

Represents a request to the OpenAI embeddings API.

See also

Constructors

Link copied to clipboard
constructor(model: String, input: List<String>, dimensions: Int? = null, encodingFormat: String? = "float", user: String? = null)

Properties

Link copied to clipboard

The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.

Link copied to clipboard
@SerialName(value = "encoding_format")
val encodingFormat: String?

The format to return the embeddings in. Can be either "float" or "base64".

Link copied to clipboard
@Serializable(with = StringOrListSerializer::class)
val input: List<String>

Input text to embed, encoded as a string or array of strings.

Link copied to clipboard

ID of the model to use for generating embeddings.

Link copied to clipboard
val user: String?

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.