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

Parameter

Default Value

Description

languageModelTranslation

AZURE_GPT_4_0613

Model used for translation

languageModelLanguageDetection

AZURE_GPT_4_0613

Model used for detecting the original language of the user message.

streamingActivated

true

Flag indicating if answered is streamed or not

temperatureTranslation

0

Temperature used for translation model

translationSystemPrompt

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.

translationUserPrompt

Text to be translated: $input

User prompt provided to the model along with the user message for translation.

languageDetectionSystemPrompt

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

languageDetectionUserPrompt

User prompt used for language detection.

customOutputTokenLimit

None

The maximum number of output tokens allowed by the model. If not set, the model's default token limit will be used.

preProcessing

[
{
"name": "translation_glossary",
"value": false
}
]

A list of pre-processing functions to pre-process the user input before translation.

postProcessing

[
{
"name": "replace_sharp_s_with_ss",
"value": false,
"language": "German"
},
{
"name": "american_to_british",
"value": false,
"language": "English"
}
]

 

A list of post-processing functions to run on the translated text.

scopeIdTranslationPairs

 

Scope ID containing the glossary file with the translation pairs.

fileNameTranslationPairs

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

Author

@Fabian Schläpfer

© 2024 Unique AG. All rights reserved. Privacy PolicyTerms of Service