translate
Translate text between multiple languages with language detection and context-aware adjustments. Specify target language, provide contextual hints, and include instructions for precise translations.
Instructions
Translate text between languages with support for language detection and context-aware translations.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
context | No | Additional context string to improve translation quality (e.g., 'This is a legal document' or 'Im talking with a doctor'). This helps the translation system better understand the domain. | |
instructions | No | A list of instructions to adjust the network’s behavior regarding the output (e.g., 'Use a formal tone'). | |
source | No | The source language code (e.g., 'en-EN' for English). If not specified, the system will attempt to detect it automatically. If you have a hint about the source language, you should specify it in the source_hint field. | |
source_hint | No | Used to guide language detection. Specify this when the source language is uncertain to improve detection accuracy. | |
target | Yes | The target language code (e.g., 'it-IT' for Italian). This specifies the language you want the text translated into. | |
text | Yes | An array of text blocks to translate. Each block contains a text string and a boolean indicating whether it should be translated. This allows for selective translation where some text blocks can be preserved in their original form while others are translated. |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"context": {
"description": "Additional context string to improve translation quality (e.g., 'This is a legal document' or 'Im talking with a doctor'). This helps the translation system better understand the domain.",
"type": "string"
},
"instructions": {
"description": "A list of instructions to adjust the network’s behavior regarding the output (e.g., 'Use a formal tone').",
"items": {
"type": "string"
},
"type": "array"
},
"source": {
"description": "The source language code (e.g., 'en-EN' for English). If not specified, the system will attempt to detect it automatically. If you have a hint about the source language, you should specify it in the source_hint field.",
"type": "string"
},
"source_hint": {
"description": "Used to guide language detection. Specify this when the source language is uncertain to improve detection accuracy.",
"type": "string"
},
"target": {
"description": "The target language code (e.g., 'it-IT' for Italian). This specifies the language you want the text translated into.",
"type": "string"
},
"text": {
"description": "An array of text blocks to translate. Each block contains a text string and a boolean indicating whether it should be translated. This allows for selective translation where some text blocks can be preserved in their original form while others are translated.",
"items": {
"additionalProperties": false,
"properties": {
"text": {
"type": "string"
},
"translatable": {
"type": "boolean"
}
},
"required": [
"text",
"translatable"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"text",
"target"
],
"type": "object"
}