Package-level declarations

Types

Link copied to clipboard
@Serializable
class Embedding(val embedding: List<Double>, val index: Int)

An embedding result. documentation

Link copied to clipboard
@Serializable
data class EmbeddingCreateRequest(val model: ModelId, val input: EmbeddingInput, val dimensions: Int? = null, val user: String? = null, val encodingFormat: EmbeddingEncodingFormat? = null)

Embedding request supporting text, token IDs and encoded result vectors.

Link copied to clipboard
@Serializable
data class EmbeddingData(val embedding: EmbeddingVector, val index: Int, val objectType: String)

One numeric or encoded embedding and its input index.

Link copied to clipboard

Encoding used for embedding vectors.

Link copied to clipboard
@Serializable(with = EmbeddingInputSerializer::class)
sealed interface EmbeddingInput

Text or pre-tokenized input for an embedding request.

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

Create an embedding request.

Link copied to clipboard

Builder of EmbeddingRequest instances.

Link copied to clipboard
@Serializable
class EmbeddingResponse(val embeddings: List<Embedding>, val usage: Usage)

Create embeddings response.

Link copied to clipboard
@Serializable
data class EmbeddingResult(val embeddings: List<EmbeddingData>, val model: ModelId, val objectType: String, val usage: Usage)

Embedding response retaining its model and object metadata.

Link copied to clipboard
@Serializable(with = EmbeddingVectorSerializer::class)
sealed interface EmbeddingVector

Vector representation returned by the API.

Functions

Link copied to clipboard

Create an embedding request.