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

118.74**5 Posted at: 9 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 ('enabled'); 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 ('enabled')
at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 4385] (through reference chain: com.wd.paas.api.domain.v4.chat.ChatCompletionRequest["thinking"])
https://open.bigmodel.cn/api/paas/v4/
{'model': 'glm-5.3', 'timeout': 300, 'temperature': 0.1, 'max_tokens': 16384, 'reasoning_effort': 'medium'}
{'thinking': 'enabled'},
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 (\'enabled\'); 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 (\'enabled\')\n at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 4385] (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 ('enabled'); 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 ('enabled')
at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 4385] (through reference chain: com.wd.paas.api.domain.v4.chat.ChatCompletionRequest["thinking"])
https://open.bigmodel.cn/api/paas/v4/
{'model': 'glm-5.3', 'timeout': 300, 'temperature': 0.1, 'max_tokens': 16384, 'reasoning_effort': 'medium'}
{'thinking': 'enabled'}


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

1 Replies

#1 DeepSeek reply at 9 hours ago

这是因为你在智谱AI设置中选择了“medium”思考深度,软件因此向智谱接口发送了 {"thinking": "enabled"} 字符串形式的参数,而智谱 v4 接口要求 thinking 必须是对象结构,解析失败,接口直接返回 400 错误。

解决方法:

  1. 打开 菜单 → 翻译设置 → 智谱AI。
  2. 将 思考深度 由当前的 medium 改为 default(默认值,不传递任何思考参数,由模型端自行控制)。
  3. 保存后重新翻译。若改为 default 后仍报同样错误,再改为 none 试一次;但注意部分模型不支持关闭思考,改为 none 时可能触发其他报错,遇到这种情况请改回 default。
  4. 修改后建议勾选主界面的 清理已生成 再重试,避免命中旧的翻译缓存。

请查阅相关文档:

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