Google Translate
Translate text using Google Cloud Translation
使用说明
Translate and detect languages using the Google Cloud Translation API. Supports auto-detection of the source language.
工具
google_translate_text
Translate text between languages using the Google Cloud Translation API. Supports auto-detection of the source language.
输入
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
apiKey | string | 是 | Google Cloud API key with Cloud Translation API enabled |
text | string | 是 | The text to translate |
target | string | 是 | Target language code (e.g., "es", "fr", "de", "ja") |
source | string | 否 | Source language code. If omitted, the API will auto-detect the source language. |
format | string | 否 | Format of the text: "text" for plain text, "html" for HTML content |
pricing | custom | 否 | No description |
metadata | string | 否 | No description |
rateLimit | string | 否 | No description |
输出
| 参数 | 类型 | 描述 |
|---|---|---|
translatedText | string | The translated text |
detectedSourceLanguage | string | The detected source language code (if source was not specified) |
google_translate_detect
Detect the language of text using the Google Cloud Translation API.
输入
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
apiKey | string | 是 | Google Cloud API key with Cloud Translation API enabled |
text | string | 是 | The text to detect the language of |
pricing | custom | 否 | No description |
metadata | string | 否 | No description |
rateLimit | string | 否 | No description |
输出
| 参数 | 类型 | 描述 |
|---|---|---|
language | string | The detected language code (e.g., "en", "es", "fr") |
confidence | number | Confidence score of the detection |