Package org.opencms.ai
Class CmsAiProviderConfig
java.lang.Object
org.opencms.ai.CmsAiProviderConfig
Simple configuration bean for AI provider access settings.
- Since:
- 21.0.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCmsAiProviderConfig(String apiKey, String providerUrl, String modelName) Creates a new provider configuration. -
Method Summary
Modifier and TypeMethodDescriptionReturns the API key used to access the provider.Returns the model name used for requests.Returns the provider base URL.static CmsAiProviderConfigloadFromJsonFile(String path) Loads the provider configuration from a JSON file in the RFS.static CmsAiProviderConfigLoads the configuration from the secret store.
-
Field Details
-
SECRET_PREFIX
- See Also:
-
-
Constructor Details
-
CmsAiProviderConfig
Creates a new provider configuration.- Parameters:
apiKey- the API key to useproviderUrl- the provider base URLmodelName- the model name
-
-
Method Details
-
loadFromJsonFile
Loads the provider configuration from a JSON file in the RFS.- Parameters:
path- the path of the config file- Returns:
- the provider configuration
- Throws:
Exception- if loading the file fails
-
loadFromSecretStore
Loads the configuration from the secret store.Returns null if one or more of the credentials could not be read from the secret store.
- Returns:
- the loaded configuration
- Throws:
Exception- if something goes wrong
-
getApiKey
Returns the API key used to access the provider.- Returns:
- the API key
-
getModelName
Returns the model name used for requests.- Returns:
- the model name
-
getProviderUrl
Returns the provider base URL.- Returns:
- the provider URL
-