ApiKeys
Wisej.AI.Helpers.ApiKeys
Last updated
Wisej.AI.Helpers.ApiKeys
Last updated
Namespace: Wisej.AI.Helpers
Assembly: Wisej.AI (3.5.0.0)
Provides methods to retrieve API keys from environment variables or a configuration file.
Retrieves the API key associated with the specified name.
name
The name of the API key to retrieve.
namePostfix
An optional postfix to remove from the name when searching for the key.
The prefix for environment variables. Default is "WISEJ_AI_APIKEY_".
Returns: . The API key if found; otherwise, null
.
This method first attempts to retrieve the API key from environment variables using the specified prefix. If not found, it attempts to read the key from a JSON configuration file located at the path defined by AI_PATH
and APIKEYS_FILENAME
.
envPrefix