点击查看 Edge-TTS 配音渠道无法使用的解决办法!!!

#1961 videotrans.configure._except.StopRetry: models/gemini-1.5-pro is not found for API version v1beta, or is not supported f

156.146* Posted at: 8 hours ago 👁8

models/gemini-1.5-pro is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.:Traceback (most recent call last):
File "videotrans\translator\_gemini.py", line 132, in _item_task
File "google\genai\models.py", line 5783, in generate_content_stream
File "google\genai\models.py", line 4666, in _generate_content_stream
File "google\genai\_api_client.py", line 774, in request_streamed
File "google\genai\_api_client.py", line 672, in _request
File "google\genai\errors.py", line 101, in raise_for_response
google.genai.errors.ClientError: 404 NOT_FOUND. {'error': {'code': 404, 'message': 'models/gemini-1.5-pro is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.', 'status': 'NOT_FOUND'}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\__init__.py", line 931, in run
File "videotrans\translator\_base.py", line 77, in run
File "videotrans\translator\_base.py", line 135, in _run_srt
File "tenacity\__init__.py", line 338, in wrapped_f
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 400, in
File "concurrent\futures\_base.py", line 439, in result
File "concurrent\futures\_base.py", line 391, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_gemini.py", line 152, in _item_task
videotrans.configure._except.StopRetry: models/gemini-1.5-pro is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.


=
system:Windows-10-10.0.19045-SP0
version:v3.86
frozen:True
language:zh
root_dir:D:/win-pyvideotrans-v3.86

1 Replies

这个错误表明您选择的 Gemini 模型名称 gemini-1.5-pro 与您使用的 API 版本 v1beta 不匹配,或者该模型不支持 generateContent 方法。

核心解决方法:在软件设置中更正 Gemini 模型名称。

请按以下步骤操作:

  1. 在 pyVideoTrans 主界面,点击菜单栏的 工具 -> 设置
  2. 在“翻译设置”区域,找到并点击 Gemini 渠道。
  3. 在“模型名称”输入框中,将 gemini-1.5-pro 修改为官方支持的模型名称。

    • 推荐使用:gemini-1.5-pro-latest (这是当前稳定版本)。
    • 或者尝试:gemini-1.5-flash-latest (速度更快)。
  4. 点击“保存”并重新测试翻译。

原因说明:
Gemini API 的模型名称和可用性会更新。gemini-1.5-pro 可能是一个旧的或内部名称,在公开的 v1beta API 中不可用。使用 -latest 后缀可以确保指向当前最新的稳定版本。

如果更改后问题依旧,请检查您的 API Key 是否正确,并确保网络代理(如果需要)设置无误。

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Donate: https://ko-fi.com/jianchang512

Trending Questions