forked from openai/openai-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
batch.py
85 lines (57 loc) · 2.72 KB
/
batch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import builtins
from typing import List, Optional
from typing_extensions import Literal
from .._models import BaseModel
from .batch_error import BatchError
from .batch_request_counts import BatchRequestCounts
__all__ = ["Batch", "Errors"]
class Errors(BaseModel):
data: Optional[List[BatchError]] = None
object: Optional[str] = None
"""The object type, which is always `list`."""
class Batch(BaseModel):
id: str
completion_window: str
"""The time frame within which the batch should be processed."""
created_at: int
"""The Unix timestamp (in seconds) for when the batch was created."""
endpoint: str
"""The OpenAI API endpoint used by the batch."""
input_file_id: str
"""The ID of the input file for the batch."""
object: Literal["batch"]
"""The object type, which is always `batch`."""
status: Literal[
"validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "cancelled"
]
"""The current status of the batch."""
cancelled_at: Optional[int] = None
"""The Unix timestamp (in seconds) for when the batch was cancelled."""
cancelling_at: Optional[int] = None
"""The Unix timestamp (in seconds) for when the batch started cancelling."""
completed_at: Optional[int] = None
"""The Unix timestamp (in seconds) for when the batch was completed."""
error_file_id: Optional[str] = None
"""The ID of the file containing the outputs of requests with errors."""
errors: Optional[Errors] = None
expired_at: Optional[int] = None
"""The Unix timestamp (in seconds) for when the batch expired."""
expires_at: Optional[int] = None
"""The Unix timestamp (in seconds) for when the batch will expire."""
failed_at: Optional[int] = None
"""The Unix timestamp (in seconds) for when the batch failed."""
finalizing_at: Optional[int] = None
"""The Unix timestamp (in seconds) for when the batch started finalizing."""
in_progress_at: Optional[int] = None
"""The Unix timestamp (in seconds) for when the batch started processing."""
metadata: Optional[builtins.object] = None
"""Set of 16 key-value pairs that can be attached to an object.
This can be useful for storing additional information about the object in a
structured format. Keys can be a maximum of 64 characters long and values can be
a maximum of 512 characters long.
"""
output_file_id: Optional[str] = None
"""The ID of the file containing the outputs of successfully executed requests."""
request_counts: Optional[BatchRequestCounts] = None
"""The request counts for different statuses within the batch."""