-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[功能请求] 支持Claude3的API #232
Comments
I have been using Claude 3 a lot in my applications and I would be very happy to have it to translate my books. Would it be possible to insert it into the plugin? |
@Arthur-WWW 谢谢建议。现已根据文档添加了 Claude 为翻译引擎,但是目前我没条件测试。请从插件主页 https://translator.bookfere.com 下载安装最新的 Rolling Release 版本测试并提供反馈。 @alissonryan Claude has been added as a translation engine; however, I am unable to test it currently. Please download and install the Rolling Release version from https://translator.bookfere.com and provide further feedback. |
I select model "claude-3-haiku-20240307" and test engine, got below log: File "calibre_plugins.ebook_translator.components.engine", line 70, in translate_text File "calibre_plugins.ebook_translator.engines.anthropic", line 117, in _parse_stream AttributeError: 'NoneType' object has no attribute 'get' |
@Arthur-WWW I have fixed the bug. Please try the latest version. |
最新版可以翻译了,但速度却很慢,还经常断线,同样的环境用Gemini就没有这个问题,不确定是Claude服务器的问题,还是实现的问题。 |
如果是大段原文后面有大段译文,这可能是因为原文译文行数没对齐导致的,是预期行为,是根据 #208 做的改动。 |
确实是这个问题,所以是因为合并翻译才产生的问题?这个问题之后会解决吗?现在取消合并翻译是否能避免这个问题? |
对,只有合并翻译会出现这个问题。如果行数不一致,错乱着匹配就没有意义了。解决这个问题,需要在高级模式手动对齐行数。不过 #241 提出了一个不错的想法,当行数不一致时,可以将其拆开重新翻译一次,应该就能自动解决这个问题了。 |
合并翻译我的理解是合并几个段落一起翻译,所以译文只要段落数跟原文一样就能对上,这是否可以在prompt里要求返回的译文格式保持跟原文一样的分段格式就能解决这个问题? |
原文是通过换行符将多个段落合并起来的,因此需要返回的译文也保持同样的格式,但 AI 可能会删减行数。 不太确定通过提示词约束是否可靠,你可以在设置中修改提示词试试看。 |
好的,AI翻译时还会改变段落数,我改一下prompt试试,之前写语法检查的prompt也加了类似的约束,效果还可以,至少可以很大程度上缓解这个问题 |
我试过很多版提示词,都不能完全避免Gemini输出错行的问题。 |
确实,我也测试过了,并不能通过prompt避免这个问题,还没有测试的是自己给原文加上一个特殊的段落号标记,要求译文返回时保留这个标记,并在prompt里给一个example。不合并翻译有时遇到单行人名这种段落,Gemini就开始胡扯,可能由于免费的原因Gemini的稳定性越来越差 |
最近Claude3的API出来了,价格比chatgpt便宜,速度也快,用来代替chatgpt3.5不错,能否支持一下,谢谢
The text was updated successfully, but these errors were encountered: