Skip to content

deepseek response format error #12868

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

Closed
5 tasks done
kenneth-bro opened this issue Jan 20, 2025 · 1 comment · Fixed by #12747
Closed
5 tasks done

deepseek response format error #12868

kenneth-bro opened this issue Jan 20, 2025 · 1 comment · Fixed by #12747
Labels
🐞 bug Something isn't working

Comments

@kenneth-bro
Copy link

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.15.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

Image

✔️ Expected Behavior

No response

❌ 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 132

@dosubot dosubot bot added the 🐞 bug Something isn't working label Jan 20, 2025
Copy link

dosubot bot commented Jan 20, 2025

To resolve the "deepseek response format error" with status code 422, ensure that the response_format parameter is structured correctly. The response_format should be a dictionary with a 'type' key. Update your configuration to use the following structure:

{
    "response_format": {"type": "json_object"}  # or {"type": "text"}
}

This conversion is necessary for proper JSON deserialization when making API requests to the DeepSeek API. Make sure your model_parameters include the response_format in this format to avoid the deserialization error [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant