Class CmsAiProviderConfig

java.lang.Object
org.opencms.ai.CmsAiProviderConfig

public class CmsAiProviderConfig extends Object
Simple configuration bean for AI provider access settings.

Since:
21.0.0
  • Field Details

  • Constructor Details

    • CmsAiProviderConfig

      public CmsAiProviderConfig(String apiKey, String providerUrl, String modelName)
      Creates a new provider configuration.

      Parameters:
      apiKey - the API key to use
      providerUrl - the provider base URL
      modelName - 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

      public String getApiKey()
      Returns the API key used to access the provider.

      Returns:
      the API key
    • getModelName

      public String getModelName()
      Returns the model name used for requests.

      Returns:
      the model name
    • getProviderUrl

      Returns the provider base URL.

      Returns:
      the provider URL