ConfigurableRoleResolver

class ConfigurableRoleResolver(properties: ConfigurableModelProviderProperties, defaultProviderName: () -> String?) : RoleResolver

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

Reads embabel.models.roles - role, then provider, then options:

embabel:
models:
roles:
cheapest:
openai: { model: gpt-4.1-nano }
anthropic: { model: claude-haiku-4-5, temperature: 0.3 }

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

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

Parameters

properties

the bound embabel.models configuration

defaultProviderName

provider of the default LLM, used when no key is active. A function because the default LLM is resolved by ConfigurableModelProvider against registered beans.

Constructors

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

Functions

Link copied to clipboard
fun configuredOptionsFor(role: String, provider: String?): <Error class: unknown class>?

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 optionsFor(role: String, provider: String?): <Error class: unknown class>?

Options 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): RoleResolution?