bookfere / Ebook-Translator-Calibre-Plugin

A Calibre plugin to translate ebook into a specified language.
https://translator.bookfere.com
GNU General Public License v3.0
1.56k stars 102 forks source link

ChatGPT (OpenAI)填了API引擎测试失败不知道是哪里设置不对 #199

Open mavsill opened 6 months ago

mavsill commented 6 months ago

安装的是最新的Rolling Release版插件。通用开了代理填了地址端口并测试通,用DeepL (free)引擎测试可以翻译,但换成ChatGPT (OpenAI)填上自己账号下的API(在别的地方试过可以使用)测试就翻译不了了,求助谢谢。

Traceback (most recent call last):,
  File "calibre_plugins.ebook_translator.components.engine", line 66, in translate_text
    translation = self.translator.translate(text)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "calibre_plugins.ebook_translator.engines.chatgpt", line 94, in translate
    return self.get_result(
           ^^^^^^^^^^^^^^^^
  File "calibre_plugins.ebook_translator.engines.base", line 217, in get_result
    raise Exception(
Exception: 无法解析返回的响应。原始数据:

Traceback (most recent call last):
  File "calibre_plugins.ebook_translator.engines.base", line 204, in get_result
    br.open(request)
  File "mechanize/_mechanize.py", line 257, in open
  File "mechanize/_mechanize.py", line 313, in _mech_open
mechanize._response.get_seek_wrapper_class.<locals>.httperror_seek_wrapper: HTTP Error 404: Not Found

{
    "error": {
        "message": "The model `gpt-4` does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.",
        "type": "invalid_request_error",
        "param": null,
        "code": "model_not_found"
    }
}
bookfere commented 6 months ago

你填写的 API 密钥是否有访问 GTP4 模型的权限?

mavsill commented 6 months ago

你填写的 API 密钥是否有访问 GTP4 模型的权限?

有的。