embed

open suspend fun embed(text: String, model: LLModel): List<Double>(source)

Embeds the given text using the given model into a vector of double-precision numbers.

Return

A list of floating-point values representing the embedding.

Parameters

text

The text to embed.

model

The model to use for embedding. Must have the Embed capability.

Throws

if the model does not have the Embed capability.


open suspend fun embed(inputs: List<String>, model: LLModel): List<List<Double>>(source)

Embeds the given input using the given model into a vector of double-precision numbers.

Return

A list of lists of floating-point values representing the embedding. Each inner list represents a single input embedding.

Parameters

inputs

The input to embed.

model

The model to use for embedding. Must have the Embed capability.

Throws

if the model does not have the Embed capability.