The ChatGPT Connector

Overview

The ChatGPT Connector enables integration with the ChatGPT API for automated translation requests. This connector is provided as part of the Translations Addon and allows you to send translation prompts directly to ChatGPT.

Prerequisites

  • Access to a ChatGPT API account.
  • The translations-addon-connector-chatgpt dependency added to your project. For installation instructions, see the installation page.

Configuration

You can configure the ChatGPT Connector using environment variables, system properties, or JCR properties. Environment variables are recommended for managing sensitive information.

Environment Variables

Set the following environment variables to configure the connector without storing values in the JCR:

PropertyEnvironment VariableSpring AI Fallback
chatgpt.api.keyCHATGPT_API_KEYSPRING_AI_OPENAI_API_KEY
chatgpt.api.urlCHATGPT_API_URLSPRING_AI_OPENAI_API_URL
chatgpt.api.modelCHATGPT_API_MODELSPRING_AI_OPENAI_CHAT_OPTIONS_MODEL

If these environment variables are not set, the connector will use system properties. If neither are set, the connector will retrieve values from the JCR.

JCR Configuration

You can also configure the connector directly in the JCR under the translationsaddon:connector node. The following properties are available:

String PropertyDefault ValueDescription
chatgpt.api.keyAPI key
chatgpt.api.urlhttps://api.openai.com/v1/chat/completionsURL for sending requests
chatgpt.api.modelgpt-3.5-turboModel used for processing translation prompts

Enable the Translation Results Processor Scheduler

To ensure that translation results are imported into the repository, enable the translation results processing scheduler job. This job pulls completed translations from the remote service.

  1. Navigate to the following JCR node:
/hippo:configuration/hippo:modules/scheduler/hippo:moduleconfig/translationsaddon/TranslationResultsProcessor/hipposched:triggers/every-minute
  1. Set the hipposched:enabled property to true.
  2. Save your changes.

You can adjust the polling interval by modifying the hipposched:cronExpression property. For more details, see the configuration page.

Verification

After configuration, verify that translation prompts are sent to ChatGPT and that results are imported into the repository according to the scheduler settings.

Share Feedback
Page: /build/service-plugins/translations-add-on/chatgpt-connector
Section: Build
Category *
The ChatGPT Connector | Bloomreach Content Documentation