yera.setup.provider_setup.openai
Obtain and validate OpenAI provider configuration.
Symbols
OpenAIProviderSetup
ProviderSetup[OpenAIConnection]Provide presentation-independent OpenAI setup operations.
Automatic discovery looks for the conventional OpenAI API-key environment variable. Validation resolves the configured API-key reference from either the environment or the protected credential store, then checks its prefix and length locally. It does not contact OpenAI.
Attributes
Configuration key for the OpenAI provider.
Human-readable provider name shown during setup.
Python modules required by the integration.
OpenAI connection schema produced by the integration.
Methods
OpenAIProviderSetup.get_config
get_config() → SetupResult[tuple[OpenAIConnection, ...]]Obtain OpenAI configuration from the process environment.
Returns
A result containing one connection candidate referencing OPENAI_API_KEY when it is present. Otherwise, the result contains an empty candidate tuple.
OpenAIProviderSetup.validate
validate(
config: OpenAIConnection,
secret_store: SecretStore | None = None,
) → SetupResult[OpenAIConnection]Validate an OpenAI connection's API-key reference locally.
The reference may point to an environment variable or an entry in the protected credential store. Validation checks the resolved key's prefix and length without contacting OpenAI.
Parameters
OpenAI connection containing an API-key reference.
Optional protected store used to resolve the API key.
Returns
The supplied configuration with errors describing a missing, empty, or implausibly formatted API key.