Open wadezyj opened 2 hours ago
@wadezyj Hello there! I'm here to help you with bugs, questions, and becoming a contributor. Let's solve this together while we wait for a human maintainer.
The error you're encountering is due to the response_format
field being set to a value that is not accepted by the Dify system. According to the Dify codebase, the accepted values for the response_format
field are:
"json_schema"
: This requires an accompanying json_schema
to be defined and correctly formatted.response_format
dictionary [1].The error message indicates that the system expected an object type for response_format
, but received a string instead. To resolve this, ensure that the response_format
is set to a valid value, such as "json_schema"
with a proper JSON schema, or another accepted string value. If "json_object"
is not a recognized value, you may need to adjust it to one of the accepted formats.
To continue talking to Dosu, mention @dosu.
Self Checks
Dify version
0.10.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
When using moonshot, setting the value of response_format to json_object results in a call error. The error message is: "[moonshot] Error: API request failed with status code 400: {\"error\":{\"message\":\"Invalid request: the
response_format
field in the request (expected type object) is illegal, and string is not acceptable\",\"type\":\"invalid_request_error\"}}"✔️ Expected Behavior
No error
❌ Actual Behavior
"[moonshot] Error: API request failed with status code 400: {\"error\":{\"message\":\"Invalid request: the
response_format
field in the request (expected type object) is illegal, and string is not acceptable\",\"type\":\"invalid_request_error\"}}"