Overview
This node translates text from a source language to a target language using the pn010ainews translate agent powered by Ollama. It connects to a NATS server to send translation requests and receive responses. This node is useful for automating translation tasks in workflows, such as translating news articles, user-generated content, or any text data between English and Japanese, with an option for auto-detecting the source language.
Use Case Examples
- Translating English news headlines to Japanese for a localized news feed.
- Automatically translating user comments from Japanese to English in a content moderation workflow.
Properties
| Name | Meaning |
|---|---|
| NATS URL | The URL of the NATS server to connect to for sending translation requests. |
| Text | The text string that needs to be translated. |
| Source Language | The language code of the source text, or auto-detect to let the agent determine it. |
| Target Language | The language code to translate the text into. |
| Timeout (ms) | Maximum time in milliseconds to wait for the translation agent's response. |
Output
JSON
translated_text- The translated text output from the agent.source_lang- The detected or specified source language of the original text.target_lang- The target language code for the translation.original_text- The original input text before translation.
Dependencies
- NATS server for message communication
- pn010ainews translate agent (Ollama-powered)
Troubleshooting
- Connection issues to the NATS server - ensure the NATS URL is correct and the server is reachable.
- Timeout errors if the translation agent does not respond within the specified timeout period - consider increasing the timeout value.
- Errors in translation requests due to invalid input text or unsupported language codes - verify input parameters.
- If the node is set to continue on fail, errors will be returned in the output JSON under the 'error' key for each failed item.