ConfigurableEmbeddingRoleResolver

The platform's own EmbeddingRoleResolver, consulted after any the application registers.

Reads embabel.models.embedding-roles - role, then provider, then model:

embabel:
models:
embedding-roles:
documents:
openai: text-embedding-3-small
mistral: mistral-embed

The active provider comes from ModelSelectionContext.provider when a user key is in play, and otherwise from defaultProviderName - so a single-provider deployment gets the right column without setting a context at all.

Falls back to the flat embabel.models.embedding-services map, which remains the right shape for a deployment that will only ever have one provider.

The structure mirrors ConfigurableRoleResolver case for case, deliberately: the two are read side by side whenever somebody is working out why a role resolved the way it did, and a difference between them would have to be a difference that matters.

Parameters

properties

the bound embabel.models configuration

defaultProviderName

provider of the deployment's default embedding service, used when no key is active. A function because that default is resolved by ConfigurableModelProvider against registered beans, after this is constructed.

Constructors

Link copied to clipboard
constructor(properties: ConfigurableModelProviderProperties, defaultProviderName: () -> String?)

Functions

Link copied to clipboard
fun configuredModelFor(role: String, provider: String?): String?

What configuration says role means for provider - the nested entry if there is one, otherwise the flat map.

Link copied to clipboard
open fun getOrder(): Int
Link copied to clipboard
fun modelFor(role: String, provider: String?): String?

The model configured for role under provider, or null if the role says nothing about it.

Link copied to clipboard
open override fun resolve(role: String, context: ModelSelectionContext): EmbeddingRoleResolution?