go-openai icon indicating copy to clipboard operation
go-openai copied to clipboard

feat: type BatchStatus for all possible states

Open tucnak opened this issue 11 months ago • 2 comments

The OpenAI API reference on Batch API is peculiar insofar it doesn't enumerate possible states for batch status. I was surprised to learn that neither did this library (which is surprising considering it's defining EmbeddingModel among other things) so I simply used the enumeration from OpenAI's Python SDK.

    status: Literal[
        "validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "cancelled"
    ]
    """The current status of the batch."""

This PR introduces a breaking change: Batch.Status before a string now a BatchStatus.

tucnak avatar Nov 25 '24 16:11 tucnak