SpringAiLLMEmbeddingProvider

class SpringAiLLMEmbeddingProvider(embeddingModel: EmbeddingModel, dispatcher: CoroutineDispatcher) : LLMEmbeddingProvider(source)

An LLMEmbeddingProvider implementation that delegates to a Spring AI EmbeddingModel.

When multiple embedding models are registered in the Spring context, use the koog.spring.ai.embedding.embedding-model-bean-name property to select the desired bean. The LLModel.id is forwarded to the underlying Spring AI model via EmbeddingOptions so that backends which support runtime model selection (e.g. OpenAI-compatible endpoints) can honour it; backends that ignore the option will simply use their pre-configured model.

Parameters

embeddingModel

the Spring AI embedding model to delegate to

dispatcher

the CoroutineDispatcher used for blocking embedding calls

Constructors

Link copied to clipboard
constructor(embeddingModel: EmbeddingModel, dispatcher: CoroutineDispatcher)

Types

Link copied to clipboard
class Builder

A Java-friendly builder for SpringAiLLMEmbeddingProvider.

Link copied to clipboard
object Companion

Java-friendly builder access.

Functions

Link copied to clipboard
open suspend override fun embed(text: String, model: LLModel): List<Double>