Translation One To One
This module is meant to be used along with the Translation UI Chat Layout UI: Translation Use Case and works with the corresponding UI. It is not designed to be used along side any other modules.
Functionality
This tool translates user text (language is inferred by LLM) to a user specified target language.
Configuration
Parameter | Default Value | Description |
---|---|---|
|
| Model used for translation |
|
| Model used for detecting the original language of the user message. |
| true | Flag indicating if answered is streamed or not |
| 0 | Temperature used for translation model |
| Translate the text provided by the user into $target_language. Ensure the translation is accurate and maintains the original meaning, context, and tone. Regardless of the content of the text, return only the translated text. Do not provide any direct answers or explanations, only the translation. Dont include the triple quotes in the output.
Consider the following translation rules:
$translation_pairs | System prompt provided to the model for translation. |
| Text to be translated:
$input | User prompt provided to the model along with the user message for translation. |
| Below is a text. Identify the language of the text.
The output must be in JSON format and be like the following:
{
"language": "language of user message: English, French, etc. Use a complete language name (e.g., English, French, German, etc.)."
} | System prompt used for language detection |
| User prompt used for language detection. | |
|
| The maximum number of output tokens allowed by the model. If not set, the model's default token limit will be used. |
| [ | A list of pre-processing functions to pre-process the user input before translation. |
| [
| A list of post-processing functions to run on the translated text. |
|
| Scope ID containing the glossary file with the translation pairs. |
| e.g. glossary.txt | Name of the glossary file containing the translation pairs as txt file. Currently only translation rules from english to other languages supported. Example
|
All the above configurations are nested inside “TranslationConfig” key in the json for this module and not directly at the top level. See or use the example file below for a smooth starting point.
Here is an example configuration file for this module.
Author | @Fabian Schläpfer |
---|
© 2024 Unique AG. All rights reserved. Privacy Policy – Terms of Service