[Fix] Correct OpenAI batch response format (#5554)
This commit is contained in:
@@ -672,6 +672,17 @@ class BatchRequestInput(OpenAIBaseModel):
|
||||
body: Union[ChatCompletionRequest, ]
|
||||
|
||||
|
||||
class BatchResponseData(OpenAIBaseModel):
|
||||
# HTTP status code of the response.
|
||||
status_code: int = 200
|
||||
|
||||
# An unique identifier for the API request.
|
||||
request_id: str
|
||||
|
||||
# The body of the response.
|
||||
body: Union[ChatCompletionResponse, ]
|
||||
|
||||
|
||||
class BatchRequestOutput(OpenAIBaseModel):
|
||||
"""
|
||||
The per-line object of the batch output and error files
|
||||
@@ -683,7 +694,7 @@ class BatchRequestOutput(OpenAIBaseModel):
|
||||
# inputs.
|
||||
custom_id: str
|
||||
|
||||
response: Optional[ChatCompletionResponse]
|
||||
response: Optional[BatchResponseData]
|
||||
|
||||
# For requests that failed with a non-HTTP error, this will contain more
|
||||
# information on the cause of the failure.
|
||||
|
||||
Reference in New Issue
Block a user