Description:
Currently, the batches.list()
operation in the OpenAI Python SDK does not provide a way to retrieve completed batches in chronological order (oldest to newest). This limitation makes it difficult to process batch items sequentially in a First-In-First-Out (FIFO) manner.
Expected Behavior:
- The API should return completed batches sorted from the oldest to newest, allowing applications to track the last processed batch and resume processing from that point.
- A possible solution could involve supporting an
order
parameter (e.g.,order='asc'
) or ensuring the default ordering is chronological.
Current Behavior:
- The current API behavior returns batch items without a guaranteed ordering, making it challenging to implement efficient batch processing pipelines.
- Even with pagination using
after
orlimit
, there is no documented way to ensure the correct processing order.