#8728 [ {"expected": "string", "code": "invalid_type", "path": [ "mo

156.229**7 Posted at: 59 minutes ago

[
{

"expected": "string",
"code": "invalid_type",
"path": [
  "model"
],
"message": "Invalid input: expected string, received undefined"

}
]:
Traceback (most recent call last):
File "videotrans\util\TestSTT.py", line 21, in run
File "videotrans\recognition\__init__.py", line 148, in run
File "videotrans\recognition\_base.py", line 101, in run
File "videotrans\recognition\_openairecognapi.py", line 38, in _exec
File "videotrans\recognition\_openairecognapi.py", line 98, in _thrid_api
File "openai\_utils\_utils.py", line 298, in wrapper
File "openai\resources\audio\transcriptions.py", line 485, in create
File "openai\_base_client.py", line 1332, in post
File "openai\_base_client.py", line 1105, in request
openai.BadRequestError: Error code: 400 - {'error': {'message': '[\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "model"\n ],\n "message": "Invalid input: expected string, received undefined"\n }\n]', 'code': 400}}


=
system:Windows-10-10.0.19045-SP0
version:v4.17
frozen:True
language:zh_CN
root_dir:D:/Program Files (x86)/pyvideotrans4.17

1 Replies

#1 DeepSeek reply at 59 minutes ago

原因是调用 OpenAI 语音识别 API 时 model 参数为空(未选择或未填写模型名称),服务端校验失败返回 400。

解决步骤:

  1. 打开 菜单 → 翻译设置 → OpenAI 语音识别(OpenAI Whisper API) 设置界面,确认 API 地址与密钥已正确填写,并在模型名称栏填入服务商要求的模型,如 whisper-1(若使用第三方兼容中转,按其文档填写对应模型名)。
  2. 回到主界面,语音识别渠道选择 OpenAI 语音识别API 后,检查 识别模型 下拉框必须选中一个具体模型,不能留空。
  3. 检查软件所在路径:当前位于 D:/Program Files (x86)/pyvideotrans4.17,该目录受系统权限限制,可能导致配置(params.json)写入失败、模型名称为空。请将整个软件移动到浅层简单路径(如 D:/pyvideotrans)后重试。
  4. 若上述均正常仍报错,可关闭软件,进入 软件目录/videotrans/,备份后删除 params.json,重新启动并重新填写该渠道的 API 地址、密钥和模型名称。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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.

Dondate via ko-fi.com

Related resource