术语干预翻译
POST
https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions
1.
terms
,每个术语是一个JSON对象,包含术语和翻译过的术语信息,格式如下:{
"source": "术语",
"target": "提前翻译好的术语"
}
2.
translation_options
参数传入第一步定义好的 terms
术语数组。请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions' \
--header 'Authorization: Bearer {{DASHSCOPE_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "qwen-mt-turbo",
"messages": [
{
"role": "user",
"content": "而这套生物传感器运用了石墨烯这种新型材料,它的目标物是化学元素,敏锐的“嗅觉”让它能更深度、准确地体现身体健康状况。"
}
],
"translation_options": {
"source_lang": "Chinese",
"target_lang": "English",
"terms": [
{
"source": "生物传感器",
"target": "biological sensor"
},
{
"source": "石墨烯",
"target": "graphene"
},
{
"source": "化学元素",
"target": "chemical elements"
},
{
"source": "身体健康状况",
"target": "health status of the body"
}
]
}
}'
响应示例响应示例
{}
请求参数
Header 参数
Authorization
string
必需
示例值:
Bearer {{DASHSCOPE_API_KEY}}
Content-Type
string
必需
示例值:
application/json
Body 参数application/json
返回响应
修改于 2025-02-28 08:18:37