Attributes
- Companion
- class
- Graph
-
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
OpenAIConfig.type
Members list
Type members
Inherited and Abstract types
The names of the product elements
The names of the product elements
Attributes
- Inherited from:
- Mirror
The name of the type
The name of the type
Attributes
- Inherited from:
- Mirror
Value members
Concrete methods
Builds a config without validating it; fromValues validates, and OpenAIClient applies validate to whatever it is given. explicitProviderId defaults to None, which infers the provider from baseUrl; workloadIdentity defaults to None, which authenticates with apiKey.
Builds a config without validating it; fromValues validates, and OpenAIClient applies validate to whatever it is given. explicitProviderId defaults to None, which infers the provider from baseUrl; workloadIdentity defaults to None, which authenticates with apiKey.
Attributes
The API key and model, every other field at its default: the entry point for Java and Kotlin, which do not see Scala default arguments. The base URL is DEFAULT_BASE_URL, there is no organisation, and contextWindow and reserveCompletion come from the model name alone (gpt-4o is 128k, an unknown model 8192); set them, and the rest, with the with* setters, or use fromValues to consult the bundled model catalogue.
The API key and model, every other field at its default: the entry point for Java and Kotlin, which do not see Scala default arguments. The base URL is DEFAULT_BASE_URL, there is no organisation, and contextWindow and reserveCompletion come from the model name alone (gpt-4o is 128k, an unknown model 8192); set them, and the rest, with the with* setters, or use fromValues to consult the bundled model catalogue.
Attributes
Constructs an OpenAIConfig, resolving contextWindow and reserveCompletion from the model name automatically.
Constructs an OpenAIConfig, resolving contextWindow and reserveCompletion from the model name automatically.
The resolver first consults a bundled model-metadata catalogue; if the model is not listed there it falls back to name-pattern matching before defaulting to 8192 tokens. Prefer this factory over the primary constructor so that new models receive correct context-window values without manual lookup.
Value parameters
- apiKey
-
OpenAI API key; must be non-empty, except that it is empty exactly when
workloadIdentityis set. - baseUrl
-
API base URL; must be non-empty. Pass a URL containing
"openrouter.ai"to route through OpenRouter. - modelName
-
Model identifier, e.g.
"gpt-4o". - organization
-
Optional OpenAI organisation ID.
- providerId
-
the provider the config belongs to, e.g.
ProviderId("requesty");Noneinfers it frombaseUrl, as OpenAIConfig.providerId describes. - workloadIdentity
-
OpenAI workload identity federation instead of
apiKey; only for a config belonging toopenaiwhosebaseUrlis an OpenAI API host (https://api.openai.com/v1or a data-residency region such ashttps://eu.api.openai.com/v1).
Attributes
- Returns
-
Left(ConfigurationError)for a blank field or a config validate refuses.
Concrete fields
The OpenAI API base URL, used by the short apply(apiKey, model).
The OpenAI API base URL, used by the short apply(apiKey, model).
Attributes
The declaration of OrganizationKey each of those providers lists in its ProviderConfigSpec.extras.
The declaration of OrganizationKey each of those providers lists in its ProviderConfigSpec.extras.
Attributes
The provider-specific key naming the OpenAI organisation ID, organization.
The provider-specific key naming the OpenAI organisation ID, organization.
It was a field of NamedProviderConfig that every provider carried; it is now declared only by the providers that build an OpenAIConfig - OpenAI, Requesty and OpenRouter - and read with section.extra(OrganizationKey) (#1133).