ProviderConfigKey

org.llm4s.llmconnect.spi.ProviderConfigKey
See theProviderConfigKey companion object
final case class ProviderConfigKey(name: String, description: String, required: Boolean, default: Option[String], env: Option[String], deprecatedAliases: Seq[String])

A provider-specific key in a named provider section: one the fixed fields of NamedProviderConfig do not cover.

Declaring the key is what makes it part of the section. The section validator checks required keys, fills in defaults and resolves deprecated aliases before the descriptor sees the section, and the descriptor reads the result from NamedProviderConfig.extras. A key in a section that no descriptor declares is reported as unknown and not passed on.

Values are strings, as they are in HOCON; a descriptor that needs a number or a boolean parses it in buildConfig and reports a malformed value there.

Value parameters

default

value used when the section omits the key. A key with a default is never missing, so required is then moot.

deprecatedAliases

older names for this key. A section that sets an alias instead of name still works, with a deprecation warning per alias used; one that sets name and an alias, or two aliases, to different values is an error. An alias may be a former extra key, or one of the built-in fields in ProviderConfigSpec.BuiltinAliasKeys - which is how a provider moves off a repurposed field (Vertex AI's endpoint became project). provider, model and headers cannot be aliases, and a spec naming one fails validation.

description

what the key means, shown when a required one is missing - e.g. "the GCP project ID that owns your Vertex AI resources".

env

the conventional environment variable for this key, if it has one. Named sections read no variable by themselves, so the missing-key message shows the binding that reads it - key = ${?VAR} - rather than telling the user to set a variable nothing would read.

name

the key as written in llm4s.providers.<name>, e.g. "region". Must not be one of ProviderConfigSpec.BuiltinKeys.

required

a section without this key (and without a default) is invalid.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product