Open
Description
The support for batch requests is incomplete. Specifically, the OpenAI API reference specifies that the output files containing the results of the batched operations contain request output objects in the format described here: https://platform.openai.com/docs/api-reference/batch/request-output
However, the struct types corresponding to these objects are missing from this library.
Draft solution
type BatchRequestOutputError struct {
Code string `json:"code"`
Message string `json:"message"`
}
type BatchRequestChatCompletionResponse struct {
StatusCode int `json:"status_code"`
RequestId string `json:"request_id"`
Body ChatCompletionResponse `json:"body"`
}
type BatchRequestChatCompletionOutput {
Id string `json:"id"`
CustomId string `json:"custom_id"`
Response *BatchRequestChatCompletionResponse `json:"response"`
Error *BatchRequestOutputError `json:"error"`
}
and similarly for any other supported batch request types.
Alternatively, these wrapper types could be implemented with generics (they were invented for this, after all), but AFAIK generics are not used elsewhere in the project, so you may not want to introduce them for such a trivial addition.