EmbeddingRequest

@Serializable
class EmbeddingRequest(val model: ModelId, val input: List<String>, val dimensions: Int? = null, val user: String? = null)

Create an embedding request.

documentation

Constructors

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

Properties

Link copied to clipboard
@SerialName(value = "dimensions")
val dimensions: Int? = null

The number of dimensions the resulting output embeddings should have.

Link copied to clipboard
@SerialName(value = "input")
val input: List<String>

Input text to get embeddings for, encoded as an array of token. Each input must not exceed 2048 tokens in length.

Link copied to clipboard
@SerialName(value = "model")
val model: ModelId

ID of the model to use.

Link copied to clipboard
@SerialName(value = "user")
val user: String? = null

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