Skip to content

Commit

Permalink
feat: type BatchStatus for all possible states
Browse files Browse the repository at this point in the history
  • Loading branch information
tucnak committed Nov 25, 2024
1 parent 74ed75f commit df33c7e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ const (
BatchEndpointEmbeddings BatchEndpoint = "/v1/embeddings"
)

type BatchStatus string

const (
BatchStatusValidating BatchStatus = "validating"
BatchStatusFailed BatchStatus = "failed"
BatchStatusInProgress BatchStatus = "in_progress"
BatchStatusFinalizing BatchStatus = "finalizing"
BatchStatusCompleted BatchStatus = "completed"
BatchStatusExpired BatchStatus = "expired"
BatchStatusCancelling BatchStatus = "cancelling"
BatchStatusCancelled BatchStatus = "cancelled"
)

type BatchLineItem interface {
MarshalBatchLineItem() []byte
}
Expand Down Expand Up @@ -74,7 +87,7 @@ type Batch struct {
} `json:"errors"`
InputFileID string `json:"input_file_id"`
CompletionWindow string `json:"completion_window"`
Status string `json:"status"`
Status BatchStatus `json:"status"`
OutputFileID *string `json:"output_file_id"`
ErrorFileID *string `json:"error_file_id"`
CreatedAt int `json:"created_at"`
Expand Down

0 comments on commit df33c7e

Please sign in to comment.