embedBlocking

@JvmName(name = "embed")
fun embedBlocking(text: String, model: LLModel, executorService: ExecutorService? = null): List<Double>(source)

Blocking Java-friendly wrapper around embed for single-text embedding.

Runs the suspending embed call on an IO-bound dispatcher and blocks until the result is available.

Return

A list of floating-point values representing the embedding vector.

Parameters

text

The text to embed.

model

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

executorService

An optional ExecutorService to control the execution context. If null, a default IO-bound dispatcher is used.

Throws

if the model does not have the Embed capability.


@JvmName(name = "embed")
fun embedBlocking(inputs: List<String>, model: LLModel, executorService: ExecutorService? = null): List<List<Double>>(source)

Blocking Java-friendly wrapper around embed for batch embedding.

Runs the suspending embed call on an IO-bound dispatcher and blocks until the result is available.

Return

A list of embedding vectors, one per input string.

Parameters

inputs

The list of texts to embed.

model

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

executorService

An optional ExecutorService to control the execution context. If null, a default IO-bound dispatcher is used.

Throws

if the model does not have the Embed capability.