You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that the BatchRequestOutput object's error is missing properties and in an error response, that the actual error contents are nested under the body property.
The spec shows that a BatchRequestOutput object will contain id, custom_id, response, and error, and that the error property will have code and message:
However, when I construct a request that's intentionally designed to trigger a non-HTTP error (set max_tokens to 1000000 for a gpt-4o prompt), create/upload a file containing this request via the files endpoint, trigger a batch request with this file, and then retrieve the contents of the resulting Error file to inspect its contents, I see the following discrepancies:
the error property is nulled, and the response.body contains the actual error contents
the error object not only has the code and message properties, but also has type and param properties
request:
{
"custom_id": "request-5",
"method": "POST",
"url": "/v1/chat/completions",
"body": {
"model": "gpt-4o",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What is the capital of Texas?"
}
],
"max_tokens": 1000000
}
}
response:
"id": "batch_req_YTpodqz4ZJ8arId5Bm73lIEt",
"custom_id": "request-5",
"response": {
"status_code": 400,
"request_id": "0538a1cc8f8f8500bbe07250e6aa2b26",
"body": {
"error": {
"message": "This model's maximum context length is 128000 tokens. However, you requested 1000024 tokens (24 in the messages, 1000000 in the completion). Please reduce the length of the messages or completion.",
"type": "invalid_request_error",
"param": "messages",
"code": "context_length_exceeded"
}
}
},
"error": null
}
It appears that the spec should at least add the type and param properties to error, and that error should be 'moved'?
The text was updated successfully, but these errors were encountered:
It appears that the
BatchRequestOutput
object'serror
is missing properties and in an error response, that the actualerror
contents are nested under thebody
property.The spec shows that a
BatchRequestOutput
object will containid
,custom_id
,response
, anderror
, and that theerror
property will havecode
andmessage
:https://github.com/openai/openai-openapi/blob/cd3c3feb77931b5fd1e8b9c1eb5fb1697821a0d0/openapi.yaml#L13726C17-L13755C73
However, when I construct a request that's intentionally designed to trigger a non-HTTP error (set
max_tokens
to 1000000 for agpt-4o
prompt), create/upload a file containing this request via the files endpoint, trigger a batch request with this file, and then retrieve the contents of the resulting Error file to inspect its contents, I see the following discrepancies:error
property is nulled, and theresponse.body
contains the actual error contentserror
object not only has thecode
andmessage
properties, but also hastype
andparam
propertiesrequest:
response:
It appears that the spec should at least add the
type
andparam
properties toerror
, and thaterror
should be 'moved'?The text was updated successfully, but these errors were encountered: