EmbeddingGeneration

object EmbeddingGeneration


Entry point for getting EmbeddingModel instances.

Summary

Public functions

suspend List<EmbeddingModel>
getEmbeddingModels(modelSignature: String?)

Returns embedding models available on the device using default EmbeddingOptions, optionally filtered by modelSignature.

suspend List<EmbeddingModel>

Returns embedding models available on the device matching the given options.

Public functions

getEmbeddingModels

suspend fun getEmbeddingModels(modelSignature: String? = null): List<EmbeddingModel>

Returns embedding models available on the device using default EmbeddingOptions, optionally filtered by modelSignature.

Each returned EmbeddingModel holds client resources; callers should call EmbeddingModel.close on any unused instances and when finished.

Parameters
modelSignature: String? = null

The signature of the desired embedding model. If null or empty, returns all available embedding models on the device; otherwise returns only models matching the signature (or an empty list if none match).

Returns
List<EmbeddingModel>

A list of matching EmbeddingModel instances available on the device.

getEmbeddingModels

suspend fun getEmbeddingModels(options: EmbeddingOptions): List<EmbeddingModel>

Returns embedding models available on the device matching the given options.

Each returned EmbeddingModel holds client resources; callers should call EmbeddingModel.close on any unused instances and when finished.

Parameters
options: EmbeddingOptions

The EmbeddingOptions specifying an optional model signature filter and background executor.

Returns
List<EmbeddingModel>

A list of matching EmbeddingModel instances available on the device, or an empty list if no available model matches EmbeddingOptions.modelSignature.