-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DeepSeek API Error with response format active (text and json_object) #12713
Comments
I found a similar closed issue regarding the DeepSeek API error when using the response format. The issue was resolved by ensuring that the Here's the relevant code snippet that was used to fix the issue: # {"response_format": "xx"} need convert to {"response_format": {"type": "xx"}}
if "response_format" in model_parameters:
model_parameters["response_format"] = {"type": model_parameters.get("response_format")} Make sure that when you set the model_parameters = {
"response_format": {"type": "text"} # or {"type": "json_object"}
} This should help in resolving the JSON deserialization failure by ensuring the API receives the expected format [1][2]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
same problem on Dify version 0.15.0 |
The issue has not been fixed, and the same problem persists. |
+1 |
Self Checks
Dify version
0.15.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Choose chatflow
Put a LLM node
Choose deepseek-chat
Active response format
Both text and json_object
Then we got an error
✔️ Expected Behavior
Normal response from deepseek
❌ Actual Behavior
Run failed: [deepseek] Error: API request failed with status code 422: Failed to deserialize the JSON body into the target type: response_format.type: invalid type: map, expected variant identifier at line 1 column 152
The text was updated successfully, but these errors were encountered: