transbridge更新一波,支持沉浸式翻译自定义API【免费提供API】
之前用golang整了个大模型转标准翻译接口开源项目来玩,佬友们反响还不错。
https://linux.do/t/topic/373582/82
一直没有时间更新,感觉挺不好意思的,趁今天摸鱼更新一波!!!
- 修复授权问题,可以这样配置
transapi:
tokens:
- "tr-98584e33-f387-42cc-a467-f02513bd400d"
- promptTemplate使用模板配置
prompt:
template: "Translate the following {{source_lang}} content to {{target_lang}}: {{input}}"
- 支持沉浸式翻译的 翻译的自定义API
Curl可以这样测试
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer tr-98584e33-f387-42cc-a467-f02513bd400d" \
-d '{
"source_lang": "zh",
"target_lang": "en",
"text_list": ["需要翻译的内容"]
}' \
"https://freeapi.fanyimao.cn/immersivel"
当然,DeepLx的免费接口还是继续提供的!
地址:https://freeapi.fanyimao.cn/translate?token=tr-98584e33-f387-42cc-a467-f02513bd400d
curl --location --request POST 'https://freeapi.fanyimao.cn/translate?token=tr-98584e33-f387-42cc-a467-f02513bd400d' \
--header 'Content-Type: application/json' \
--data-raw '{
"text": "你好啊",
"source_lang": "cn",
"target_lang": "en"
}'
最后,有问题随时提,不定期解决![]()
