transbridge更新一波,支持沉浸式翻译自定义API【免费提供API】

transbridge更新一波,支持沉浸式翻译自定义API【免费提供API】

之前用golang整了个大模型转标准翻译接口开源项目来玩,佬友们反响还不错。

https://linux.do/t/topic/373582/82

一直没有时间更新,感觉挺不好意思的,趁今天摸鱼更新一波!!!

  1. 修复授权问题,可以这样配置
transapi:
  tokens:
    - "tr-98584e33-f387-42cc-a467-f02513bd400d"
  1. promptTemplate使用模板配置
prompt:
  template: "Translate the following {{source_lang}} content to {{target_lang}}: {{input}}"
  1. 支持沉浸式翻译的 翻译的自定义API

我自己搭了免费配置地址:https://freeapi.fanyimao.cn/immersivel?token=tr-98584e33-f387-42cc-a467-f02513bd400d

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"
}'

最后,有问题随时提,不定期解决:rofl:

12 个赞

太强了,大佬!

又帅又快!

所以到底是啥模型啊

主要是glm的模型+我自己买的deepseek 等等,组合在一起,效果不好的就没加进来。

比较方便配置,因为我自己整了简易版的one-api来整合各家API
GitHub - fruitbars/simple-one-api: OpenAI 接口接入适配,支持千帆大模型平台、讯飞星火大模型、腾讯混元以及MiniMax、Deep-Seek,等兼容OpenAI接口,仅单可执行文件,配置超级简单,一键部署,开箱即用. Seamlessly integrate with OpenAI and compatible APIs using a single executable for quick setup and deployment.

1 个赞

大佬太强了

这种转接口和大模型直接翻译有什么区别

太强了,大佬

大佬,支持一波

感谢大佬

嗯,加了缓存之类的功能

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。