Hi everyone,
I’m getting errors while trying to use structured format and the batch api. It looks like this :
{"id": "batch_req_679ba2349f3481909d7d10bd3b8cb82a", "custom_id": "es7cuns533wid6k7dgfi87_6", "response": {"status_code": 400, "request_id": "4a9f1b44c989fac460590df5cced70a7", "body": {"error": {"message": "Missing required parameter: 'response_format.json_schema'.", "type": "invalid_request_error", "param": "response_format.json_schema", "code": "missing_required_parameter"}}}, "error": null}
This is the approach I’m running with, but obviously its not working:
class Individual(BaseModel):
year : int
unite : str
kpi : str
value : str
found : str
class MasterCase(BaseModel):
extraction : list[Individual]
task = {
"custom_id": f"{customid}",
"method": "POST",
"url": "/v1/chat/completions",
"body":{
"model": "gpt-4o",
"temperature": 0.2,
"top_p": 0.1,
"response_format":
{"type": "json_schema",
"schema":to_strict_json_schema(MasterCase)},
"messages": [
{"role": "system", "content": "You are an helpful assistant."},
{"role":"user", "content" : f"{self.question_gpt}"}
],
}
}
Does anyone know where the issue might be ?