I copied the official curl to execute it, but I get Missing required parameter: ‘response_format.json_schema’.
error, I don’t know what’s going on。
my request body is
{
"model": "gpt-4o-2024-08-06",
"messages": [
{
"role": "system",
"content": "Determine if the user input violates specific guidelines and explain if they do."
},
{
"role": "user",
"content": "How do I prepare for a job interview?"
}
],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "content_compliance",
"description": "Determines if content is violating specific moderation rules",
"schema": {
"type": "object",
"properties": {
"is_violating": {
"type": "boolean",
"description": "Indicates if the content is violating guidelines"
},
"category": {
"type": ["string", "null"],
"description": "Type of violation, if the content is violating guidelines. Null otherwise.",
"enum": ["violence", "sexual", "self_harm"]
},
"explanation_if_violating": {
"type": ["string", "null"],
"description": "Explanation of why the content is violating"
}
},
"required": ["is_violating", "category", "explanation_if_violating"],
"additionalProperties": false
},
"strict": true
}
}
}
but i receive the error response
{
"error": {
"message": "Missing required parameter: 'response_format.json_schema'. (request id: 2024112100110225126189709725161)",
"type": "invalid_request_error",
"param": "response_format.json_schema",
"code": "missing_required_parameter"
}
}
can anyone tell me what it is?