Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| NIUTRANS_API_KEY | Yes | 小牛翻译开放平台提供的 API Key,可免费使用,请登录后获取:https://niutrans.com/cloud/account_info/info |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| translate_text | 使用小牛翻译 API 将文本从 source 语种翻译到 target 语种。 支持 450+ 种语言代码,并可自动处理常见别名。返回结构包含译文和 API 原始响应。
Args:
text (str): 待翻译的原文文本,可以是任意长度的字符串。
source (str): 源语言代码或常见别名(例如 "zh"、"中文"、"chinese")。
target (str): 目标语言代码或常见别名(例如 "en"、"英文"、"english")。
Returns:
Dict[str, Any]: 包含以下字段的字典:
- source: 标准化后的源语言代码
- target: 标准化后的目标语言代码
- original_text: 原文
- translated_text: 译文
- raw: 小牛翻译 API 的原始响应数据 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| language_catalog | 提供小牛翻译支持的语种及别名列表。 返回内容包括所有语种的代码与中英文名称,以及可用的别名映射,可用于模型在翻译前完成语种推断。 |