通义多模态翻译提交html翻译任务
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
当前API暂无授权信息透出。
请求语法
POST /anytrans/translate/html/submit HTTP/1.1
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
workspaceId | string | 是 | 当前请求所使用的百炼业务空间 id | llm-kqtrcpdee4xm29xx |
format | string | 否 | 翻译形式 | text |
sourceLanguage | string | 否 | 源语言 | zh |
targetLanguage | string | 否 | 目标语言 | en |
text | string | 否 | 待翻译的 html 内容 | <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>我的第一个网页</title> </head> <body> <h1>欢迎来到我的网页!</h1> <p>这是一个简单的 HTML 页面。</p> <p>学习 HTML 是进入网页开发的第一步。</p> <a href="https://www.example.com">点击这里访问示例网站</a> </body> </html> |
scene | string | 否 | 翻译模型 枚举值:
| mt-turbo |
ext | object | 否 | 控制翻译功能的扩展参数 | |
examples | array<object> | 否 | 翻译示例列表 | |
object | 否 | 翻译示例 | ||
tgt | string | 否 | 目标文本 | hello |
src | string | 否 | 源文本 | 你好 |
domainHint | string | 否 | 领域提示(一段英文自然语言文本,用于指示大模型翻译的风格) | his sentence from an e-commerce product image, please provide a translation that is both highly concise and no more than 1.2 times the length of the original. |
sensitives | array | 否 | 敏感词库 | |
string | 否 | 待过滤的敏感词 | password | |
terminologies | array<object> | 否 | 翻译术语库 | |
object | 否 | 待干预术语对 | ||
tgt | string | 否 | 干预后译文 | ML |
src | string | 否 | 源文本 | 机器学习 |
textTransform | object | 否 | 译文大小写转换 | |
toLower | boolean | 否 | 译文全转为小写 枚举值:
| false |
toUpper | boolean | 否 | 译文全转为大写 枚举值:
| false |
toTitle | boolean | 否 | 译文全转为 capitalized 首字母大写 枚举值:
| false |
返回参数
示例
正常返回示例
JSON
格式
{
"code": "success",
"message": "success",
"requestId": "72E4FDA1-5474-5DC1-8DFF-968BEEA65C49",
"success": true,
"httpStatusCode": 200,
"data": {
"taskId": "2746f4be-cff2-465e-a2c6-12bff30ce0f9\n",
"status": "in_process"
}
}
错误码
HTTP status code | 错误码 | 错误信息 |
---|---|---|
400 | IdempotentParameterMismatch | The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical. |
访问错误中心查看更多错误码。