Model Selection Context
data class ModelSelectionContext(val userId: String? = null, val credential: ProviderCredential? = null)
What a RoleResolver gets to decide with, beyond the role name itself.
A role such as "cheapest" cannot be resolved to a model without knowing which provider is active, and in a bring-your-own-key deployment that is a property of the request rather than of the deployment. Set it for the duration of a request with ModelSelectionContextHolder.with.
Parameters
user Id
identity of the user on whose behalf the call is made, if any
credential
the provider key active for this call, if any