#9112 智谱AI: JSON parse error: Cannot construct instance of `com.wd.paas.api.domain.v4.chat.ChatCompletionRequest$Thinking` (al

2409**625b Posted at: 20 hours ago

智谱AI: JSON parse error: Cannot construct instance of com.wd.paas.api.domain.v4.chat.ChatCompletionRequest$Thinking (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('disabled'); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of com.wd.paas.api.domain.v4.chat.ChatCompletionRequest$Thinking (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('disabled')
at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 4381] (through reference chain: com.wd.paas.api.domain.v4.chat.ChatCompletionRequest["thinking"])
https://open.bigmodel.cn/api/paas/v4/
{'model': 'glm-5', 'timeout': 300, 'temperature': 0.1, 'max_tokens': 16384, 'reasoning_effort': 'none'}
{'thinking': 'disabled'},
Traceback (most recent call last):
File "videotrans\translator\_openaicompat.py", line 99, in _item_task
File "videotrans\translator\_openaicompat.py", line 39, in _create_completion
File "openai\_utils\_utils.py", line 298, in wrapper
File "openai\resources\chat\completions\completions.py", line 1215, 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': 'JSON parse error: Cannot construct instance of com.wd.paas.api.domain.v4.chat.ChatCompletionRequest$Thinking (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value (\'disabled\'); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of com.wd.paas.api.domain.v4.chat.ChatCompletionRequest$Thinking (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value (\'disabled\')\n at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 4381] (through reference chain: com.wd.paas.api.domain.v4.chat.ChatCompletionRequest["thinking"])', 'code': '400'}}

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\_runner.py", line 71, in run
File "videotrans\translator\_base.py", line 82, in run
File "videotrans\translator\_base.py", line 165, 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 451, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_openaicompat.py", line 112, in _item_task
videotrans.configure.excepts.StopTask: JSON parse error: Cannot construct instance of com.wd.paas.api.domain.v4.chat.ChatCompletionRequest$Thinking (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('disabled'); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of com.wd.paas.api.domain.v4.chat.ChatCompletionRequest$Thinking (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('disabled')
at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 4381] (through reference chain: com.wd.paas.api.domain.v4.chat.ChatCompletionRequest["thinking"])
https://open.bigmodel.cn/api/paas/v4/
{'model': 'glm-5', 'timeout': 300, 'temperature': 0.1, 'max_tokens': 16384, 'reasoning_effort': 'none'}
{'thinking': 'disabled'}


=
system:Windows-10-10.0.26200-SP0
version:v4.20
frozen:True
language:zh_CN
root_dir:D:/zip_zimu/win-pyvideotrans-v4.20

1 Replies

#1 DeepSeek reply at 20 hours ago

这是因为你在智谱AI设置里把「思考深度」选为了 none,软件会向智谱发送 {'thinking': 'disabled'} 这种字符串形式的参数,而智谱的接口(glm-5)要求 thinking 必须是对象结构,无法从字符串 "disabled" 反序列化,因此直接返回 400。

解决方法:

  1. 打开 菜单 → 翻译设置 → 智谱AI。
  2. 将 思考深度 由 none 改为 default(不带入任何 thinking 参数,交由模型端控制),保存。
  3. 重新执行翻译;若之前有失败缓存,建议勾选主界面 清理已生成 或删除 tmp/translate_cache/ 下对应缓存后再试。

补充:

  • 部分模型本身不支持关闭思考模式,选 none 就会报此类错,遇此情况统一改回 default。
  • 如果改回 default 后仍报类似 thinking 相关错误,说明该模型对参数的兼容性有问题,建议把模型换成 glm-4.6 等稳定文本模型,或改用 DeepSeek 等 AI 渠道翻译。

请查阅相关文档:

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