EmbeddingRoleResolution

sealed interface EmbeddingRoleResolution

What an embedding role resolved to.

The embedding counterpart of RoleResolution, and deliberately a separate type rather than a fourth case on that one. A resolver written for chat answers with an com.embabel.agent.spi.LlmService or with LlmOptions carrying a temperature, neither of which means anything to an embedding call - so sharing the chain would oblige the platform to ask every chat resolver about every embedding role and discard most of what came back. Worse, it would make a role NAME shared between the two - "cheapest", "default" - resolve to a chat model for an embedding request. Two chains, two answers, no collision.

An application that resolves both from one source implements both interfaces on one class; the Credential case is usually all either of them needs.

Inheritors

Types

Link copied to clipboard

A provider key. The platform looks the role up for that provider and builds the service through a CredentialEmbeddingServiceFactory, caching it per provider, key and model.

Link copied to clipboard
data class Model(val model: String) : EmbeddingRoleResolution

The name of a registered embedding service.

Link copied to clipboard
data class Service(val embeddingService: EmbeddingService) : EmbeddingRoleResolution

An already-built service, for callers that construct their own.