The ChatGPT Connector
Summary
An out-of-the-box connector to send translation promps to ChatGPT via the ChatGPT API.
Set up
To set up the connector, add dependency 'translations-addon-connector-chatgpt' as mentioned in the installation page.
Configuration settings are to be taken from ChatGPT API account.
Environment variables (recommended)
If you prefer not to store values in JCR, the following properties can be set via environment variables:
| Property | Environment variable | Spring AI fallback |
| chatgpt.api.key | CHATGPT_API_KEY | SPRING_AI_OPENAI_API_KEY |
| chatgpt.api.url | CHATGPT_API_URL | SPRING_AI_OPENAI_API_URL |
| chatgpt.api.model | CHATGPT_API_MODEL | SPRING_AI_OPENAI_CHAT_OPTIONS_MODEL |
If env variables are not set, values fall back to system properties and then the JCR as a last resort.
JCR Configruation
The configuration in the JCR are at the translationsaddon:connector node:
| String property | Default value | Description |
| chatgpt.api.key | API key | |
| chatgpt.api.url | https://api.openai.com/v1/chat/completions | Url to send the request |
| chatgpt.api.model | gpt-3.5-turbo | Model definition to process the request |
Turn on translation results processing scheduler job
As also mentioned at the configuration page, be sure have translation results pulled into the repository, by enabling the trigger at
/hippo:configuration/hippo:modules/scheduler/hippo:moduleconfig/translationsaddon/TranslationResultsProcessor/hipposched:triggers/every-minute
Set the property hipposched:enabled to true (checked) and save the changes.
You can also change the value of hipposched:cronExpression to adjust the time interval this job runs to check translation results on remote server.