Skip to content

Commit fbc0e15

Browse files
fix(api): change timestamps to unix integers (#1367)
1 parent 4204e63 commit fbc0e15

File tree

5 files changed

+27
-18
lines changed

5 files changed

+27
-18
lines changed

src/openai/resources/batches.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ def create(
6565
See [upload file](https://platform.openai.com/docs/api-reference/files/create)
6666
for how to upload a file.
6767
68-
Your input file must be formatted as a JSONL file, and must be uploaded with the
69-
purpose `batch`.
68+
Your input file must be formatted as a
69+
[JSONL file](https://platform.openai.com/docs/api-reference/batch/requestInput),
70+
and must be uploaded with the purpose `batch`.
7071
7172
metadata: Optional custom metadata for the batch.
7273
@@ -252,8 +253,9 @@ async def create(
252253
See [upload file](https://platform.openai.com/docs/api-reference/files/create)
253254
for how to upload a file.
254255
255-
Your input file must be formatted as a JSONL file, and must be uploaded with the
256-
purpose `batch`.
256+
Your input file must be formatted as a
257+
[JSONL file](https://platform.openai.com/docs/api-reference/batch/requestInput),
258+
and must be uploaded with the purpose `batch`.
257259
258260
metadata: Optional custom metadata for the batch.
259261

src/openai/types/batch.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Batch(BaseModel):
2424
completion_window: str
2525
"""The time frame within which the batch should be processed."""
2626

27-
created_at: str
27+
created_at: int
2828
"""The Unix timestamp (in seconds) for when the batch was created."""
2929

3030
endpoint: str
@@ -41,33 +41,33 @@ class Batch(BaseModel):
4141
]
4242
"""The current status of the batch."""
4343

44-
cancelled_at: Optional[str] = None
44+
cancelled_at: Optional[int] = None
4545
"""The Unix timestamp (in seconds) for when the batch was cancelled."""
4646

47-
cancelling_at: Optional[str] = None
47+
cancelling_at: Optional[int] = None
4848
"""The Unix timestamp (in seconds) for when the batch started cancelling."""
4949

50-
completed_at: Optional[str] = None
50+
completed_at: Optional[int] = None
5151
"""The Unix timestamp (in seconds) for when the batch was completed."""
5252

5353
error_file_id: Optional[str] = None
5454
"""The ID of the file containing the outputs of requests with errors."""
5555

5656
errors: Optional[Errors] = None
5757

58-
expired_at: Optional[str] = None
58+
expired_at: Optional[int] = None
5959
"""The Unix timestamp (in seconds) for when the batch expired."""
6060

61-
expires_at: Optional[str] = None
61+
expires_at: Optional[int] = None
6262
"""The Unix timestamp (in seconds) for when the batch will expire."""
6363

64-
failed_at: Optional[str] = None
64+
failed_at: Optional[int] = None
6565
"""The Unix timestamp (in seconds) for when the batch failed."""
6666

67-
finalizing_at: Optional[str] = None
67+
finalizing_at: Optional[int] = None
6868
"""The Unix timestamp (in seconds) for when the batch started finalizing."""
6969

70-
in_progress_at: Optional[str] = None
70+
in_progress_at: Optional[int] = None
7171
"""The Unix timestamp (in seconds) for when the batch started processing."""
7272

7373
metadata: Optional[builtins.object] = None

src/openai/types/batch_create_params.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ class BatchCreateParams(TypedDict, total=False):
2727
See [upload file](https://platform.openai.com/docs/api-reference/files/create)
2828
for how to upload a file.
2929
30-
Your input file must be formatted as a JSONL file, and must be uploaded with the
31-
purpose `batch`.
30+
Your input file must be formatted as a
31+
[JSONL file](https://platform.openai.com/docs/api-reference/batch/requestInput),
32+
and must be uploaded with the purpose `batch`.
3233
"""
3334

3435
metadata: Optional[Dict[str, str]]

src/openai/types/beta/vector_store.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ class VectorStore(BaseModel):
4040
id: str
4141
"""The identifier, which can be referenced in API endpoints."""
4242

43-
bytes: int
44-
"""The byte size of the vector store."""
45-
4643
created_at: int
4744
"""The Unix timestamp (in seconds) for when the vector store was created."""
4845

@@ -72,6 +69,9 @@ class VectorStore(BaseModel):
7269
for use.
7370
"""
7471

72+
usage_bytes: int
73+
"""The total number of bytes used by the files in the vector store."""
74+
7575
expires_after: Optional[ExpiresAfter] = None
7676
"""The expiration policy for a vector store."""
7777

src/openai/types/beta/vector_stores/vector_store_file.py

+6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ class VectorStoreFile(BaseModel):
3939
vector store file is ready for use.
4040
"""
4141

42+
usage_bytes: int
43+
"""The total vector store usage in bytes.
44+
45+
Note that this may be different from the original file size.
46+
"""
47+
4248
vector_store_id: str
4349
"""
4450
The ID of the

0 commit comments

Comments
 (0)