#2453 TaskCfg(cache_folder=None, target_dir='C:/Ruanjian/win-pyvideotrans-v3.91/output/translate', remove_noise=False, is_sepa

168.107* Posted at: 1 month ago 👁76

翻译字幕阶段出错 [Gemini AI] 无效的值或参数:1 validation error for ThinkingConfig
thinking_level
Extra inputs are not permitted [type=extra_forbidden, input_value='high', input_type=str]

For further information visit https://errors.pydantic.dev/2.10/v/extra_forbidden

Traceback (most recent call last):
File "videotrans\translator\_base.py", line 79, in run
File "videotrans\translator\_base.py", line 96, in _run_text
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 421, in exc_check
tenacity.RetryError: RetryError[]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\task\job.py", line 184, in run
File "videotrans\task\_translate_srt.py", line 45, in trans
File "videotrans\translator\__init__.py", line 933, in run
File "videotrans\translator\_base.py", line 81, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_gemini.py", line 77, in _item_task
File "pydantic\main.py", line 214, in init
pydantic_core._pydantic_core.ValidationError: 1 validation error for ThinkingConfig
thinking_level
Extra inputs are not permitted [type=extra_forbidden, input_value='high', input_type=str]

For further information visit https://errors.pydantic.dev/2.10/v/extra_forbidden

TaskCfg(cache_folder=None, target_dir='C:/Ruanjian/win-pyvideotrans-v3.91/output/translate', remove_noise=False, is_separate=False, detect_language=None, subtitle_language=None, source_language=None, target_language=None, source_language_code='Japanese', target_language_code='Simplified Chinese', source_sub='C:/Users/liina/Videos/How to 学园 性爱教科书-1 (BARE-001)/_video_out/[email protected]', target_sub='C:/Ruanjian/win-pyvideotrans-v3.91/output/translate/[email protected] Chinese.srt', source_wav=None, source_wav_output=None, target_wav=None, target_wav_output=None, subtitles=None, novoice_mp4=None, noextname='hhd800.com@722BARE-001-ja', shibie_audio=None, targetdir_mp4=None, instrument=None, vocal=None, back_audio=None, background_music=None, app_mode='biaozhun', subtitle_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role=None, copysrt_rawvideo=False, clear_cache=False, translate_type=5, tts_type=None, recogn_type=None, model_name=None, split_type=0, voice_autorate=False, video_autorate=False, cuda=False, name='C:/Users/liina/Videos/How to 学园 性爱教科书-1 (BARE-001)/_video_out/[email protected]', basename='[email protected]', ext='srt', dirname='C:/Users/liina/Videos/How to 学园 性爱教科书-1 (BARE-001)/_video_out', shound_del_name=None, uuid='1b63e81e32', remove_silent_mid=False, align_sub_audio=True, enable_diariz=False, nums_diariz=0, rephrase=2, only_out_mp4=False)


=
system:Windows-10-10.0.26200-SP0
version:v3.91
frozen:True
language:zh
root_dir:C:/Ruanjian/win-pyvideotrans-v3.91

1 Replies

此错误是由于 Gemini AI 的 thinking_level 参数在当前版本的 pyVideoTrans 中不被支持或配置有误导致的。请按以下步骤解决:

  1. 检查 Gemini API Key 和模型配置

    • 在软件主界面,点击 翻译设置 按钮。
    • 在打开的窗口中,找到并选择 Gemini 渠道。
    • 确保 API Key 已正确填写,并且 模型名称 选择的是当前可用的模型(例如 gemini-1.5-progemini-1.5-flash)。请勿在模型名称中填写 thinking_level=high 或其他额外参数
  2. 修改翻译提示词(如果上一步无效)

    • 翻译设置 窗口中,找到 自定义翻译提示词System Prompt 的输入框。
    • 检查其中是否包含了 thinking_level 相关的设置。如果有,请将其删除,只保留翻译任务本身的指令。
  3. 重启软件

    • 完成上述修改后,关闭并重新启动 pyVideoTrans,然后重试翻译任务。

根本原因:错误信息 Extra inputs are not permitted 表明软件在调用 Gemini API 时,传入了一个名为 thinking_level 的额外参数,但 Gemini 的 API 配置类 (ThinkingConfig) 不允许此参数。这通常是由于软件内部的配置模板或用户自定义的提示词中包含了过时或不支持的参数。

如果问题依旧,请提供您在“翻译设置”中为 Gemini 渠道填写的完整配置截图。

请查看更多参考文档:

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.

Related resource

Similar issues already exist