ModelSelectionContext

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

userId

identity of the user on whose behalf the call is made, if any

credential

the provider key active for this call, if any

Constructors

Link copied to clipboard
constructor(userId: String? = null, credential: ProviderCredential? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Name of the active provider, or null if the deployment default should be used.

Link copied to clipboard
val userId: String? = null