Graphrt

Google Translate

Google Cloud Translation Basic (v2) with an API key in a header, translate text, detect language, list languages

Beta v0.1.0 Node.js 4 actions
Use in Graphrt Desktop

About

A Graphrt plugin for Google Cloud Translation - Basic (v2). It translates texts, detects their language and lists supported languages. Every operation is a workflow node and an agent tool.

What it can do

  • translate_text: up to 128 texts into one target language, optional source, format (text or html), model (nmt or base), returns [{translatedText, detectedSourceLanguage}]
  • detect_language: [{language, confidence}] candidates per text
  • list_languages: codes and names (named in display_language)
  • api_request: any other v2 endpoint (GET only for agents)

Actions

Each action is a step you can add to a workflow. Agents can also use most of them as tools.

  • Translate text google-translate.translate_text
  • Detect language google-translate.detect_language
  • List languages google-translate.list_languages
  • Cloud Translation API (v2) request google-translate.api_request

Settings

Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.

  • GOOGLE_TRANSLATE_API_KEY Required
    API key, sent as x-goog-api-key

How to use it

In Graphrt Desktop

  1. Open Plugins and search for Google Translate.
  2. Click Install and approve it.
  3. Follow the setup steps on the plugin's page, then paste the settings it needs.
  4. Describe a job that needs it, and the builder adds the steps.
Plugins in Graphrt Desktop

With the CLI

terminal
$ graphrt plugin install google-translate
workflow.yaml
- id: translated
  type: google-translate.translate_text
  text: ["{{#start.review#}}"]
  target: en
- id: answer
  type: answer
  answer: "{{#translated.data.0.translatedText#}} ({{#translated.data.0.detectedSourceLanguage#}})"
Plugins in the docs