Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/32 OpenAI key configuration from content #35

Merged
merged 9 commits into from
Oct 25, 2023

Conversation

stoerr
Copy link
Member

@stoerr stoerr commented Oct 25, 2023

This sets up lookup for the OpenAI API Key via Sling Context Aware Configuration, and adds a configuration so that it can set up in AEMaaCS as cloud secret.

We have now a fallback hierarchy for the OpenAI API key:

  • Sling Context Aware Configuration
  • OSGI configuration at "Composum AI GPT Chat Completion Service" - this is configured by default for AEMaaCS
    as $[secret:OPENAI_API_KEY] to retrieve a value configurable in the cloud manager
  • Environment variable OPENAI_API_KEY

For the sling context aware configuration, we have a configuration
com.composum.ai.backend.slingbase.model.OpenAIConfig with the property openAiApiKey . Thus, set up configuration of
the API key in the JCR repository has the following possibilities:

  • to enable it globally (even if you do not normally use Sling Context Aware Configuration), you could set up a
    configuration node at
    /conf/global/sling:configs/com.composum.ai.backend.slingbase.model.OpenAIConfig
    with the property openAiApiKey set to the OpenAI API key. Caution: this requires read permissions for the users.
  • to enable it for a site or page tree that already has a sling:configRef set up (searchable with query
    /content//*[@sling:configRef]) you could set up a configuration node
    com.composum.ai.backend.slingbase.model.OpenAIConfig in
    the corresponding /conf/.../sling:configs node.
  • otherwise you'd have to set up Sling Context Aware Configuration for the page tree in question.

@stoerr stoerr linked an issue Oct 25, 2023 that may be closed by this pull request
@stoerr stoerr merged commit ba1b399 into develop Oct 25, 2023
2 checks passed
@stoerr stoerr deleted the feature/32-openai-key-configuration branch October 25, 2023 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenAI Key configuration
1 participant