CTSX ChatGPT Translator
Content management Unbundled: Extension
Issues |
|||
Git |
|||
Latest |
3.5.1
|
The ChatGPT translation module performs translations using the OpenAI APIs. Translations are handled synchronously.
Installing with Maven
Maven is the easiest way to install the module. Add the following to your bundle:
In order to start the ChatGPT translation process, ensure the core and apps modules for Content Translation Extended are already installed. |
<dependency>
<groupId>info.magnolia.translation</groupId>
<artifactId>magnolia-content-translation-support-ext-chatgpt</artifactId>
<version>3.5.1</version>
</dependency>
Configuration
You handle configuration for the ChatGPT Translator in the module config
folder, typically located at /modules/content-translation-support-ext-core/config/
.
You can configure the provider with the properties listed on this page as a child to the /config/
folder.
Set the clientToken field to your OpenAI API key.
This is usually found under API keys in your OpenAI account.
|
Use JCR for module configuration.
When using yaml , translation provider definition are not loaded and the connector is unusable.
|
The ChatGPT model (GPT-3.5-Turbo) is constrained by limitations on the volume of content it can process and return.
To address this constraint, we employ the characterLimit
and whiteSpaceCharacterIndex
properties to partition the input content effectively, allowing us to control the size of each request.
When content is submitted in segments, the resulting parts are subsequently concatenated to produce the translated outcome.
Notably, when processing HTML elements, there may arise instances where certain opening or closing tags are inadvertently omitted.
To mitigate this, we utilize the htmlParser
property, which governs the activation or deactivation of a tool designed to sanitize the content as HTML before its transmission.
Property | Description |
---|---|
|
required Definition class for the translator to be used. See |
|
required Unused but needs a value. |
|
required token from OpenAI account |
|
required Identifies the configuration within Magnolia. |
|
optional The default configuration used by the system in the case of multiple translation services being used. |
|
required Enable or disable the configuration using this flag. |
|
required Implementation class for interfacing with DeepL. See |
|
optional You can adjust the character limit in one request. Default is |
|
optional You can adjust on which index the partition is made. Default is from the 1500th character. |
|
optional You can adjust the duration timeout of the OpenAI service. Default is |
|
optional You can adjust what prompt is sent as a message before the content is translated. |
|
optional You can adjust which ChatGPT model is used. Default is |
|
optional Boolean to enable or disable the Default value is |
Sample configuration
'config':
'ChatGPT':
'class': 'info.magnolia.translation.ext.provider.chatgpt.definition.ChatGPTProviderDefinition'
'clientToken': 'xxxxxx-xxxxx-xxxx-xxxx-xxxx' (1)
'configName': 'ChatGPT.com'
'enabledFlag': 'true'
'implementationClass': 'info.magnolia.translation.ext.provider.chatgpt.translator.ChatGPTTranslator'
1 | Your OpenAI client token. |
Usage
After registration and starting, the Content Translation Support Extended (CTSX) module binds the ChatGPT translator to the Configuration
field.
You can test the connection to the translator API before using. |
Choose Pages
-
Choose the pages that contain the i18n items before starting the process.
-
Click to 'Add to translation batch' action on action bar.
-
In the 'Add to translation batch' dialog:
-
Input the batch name or select a existing batch.
-
Check to include Dependencies and include Sub-nodes if necessary.
-
Select ChatGPT in the Configuration.
-
Optionally, add instructions and notes.
-
Click Save Changes.
-
Submit Batch
-
Open the Translation Extend app (under the Tools menu).
-
From the 'Batches' tab:
-
Select your batch.
-
Edit the batch information if you want.
-
Click to 'Submit batch' action on action bar.
After The executeGetTranslationCommand
has run, you will get the Pulse notification for the translation result. +You can bypass this step (auto import translated content) if you set"autoTranslationAllowed=true"
.
-
-
In the 'Translation Review' dialog:
-
Click to 'Assign to me' on action bar.
-
Can be 'Approve & Import' or Reject the task.
-
Click to 'Review' action for comparing the different.
It can also be 'Import' or "Reject" in the 'Comparison' tab. After importing the translated content, you can open the selected page again for checking the result.
-