Skip to content

fix(api): change timestamps to unix integers #1367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/openai/resources/batches.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ def create(
See [upload file](https://platform.openai.com/docs/api-reference/files/create)
for how to upload a file.

Your input file must be formatted as a JSONL file, and must be uploaded with the
purpose `batch`.
Your input file must be formatted as a
[JSONL file](https://platform.openai.com/docs/api-reference/batch/requestInput),
and must be uploaded with the purpose `batch`.

metadata: Optional custom metadata for the batch.

Expand Down Expand Up @@ -252,8 +253,9 @@ async def create(
See [upload file](https://platform.openai.com/docs/api-reference/files/create)
for how to upload a file.

Your input file must be formatted as a JSONL file, and must be uploaded with the
purpose `batch`.
Your input file must be formatted as a
[JSONL file](https://platform.openai.com/docs/api-reference/batch/requestInput),
and must be uploaded with the purpose `batch`.

metadata: Optional custom metadata for the batch.

Expand Down
18 changes: 9 additions & 9 deletions src/openai/types/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Batch(BaseModel):
completion_window: str
"""The time frame within which the batch should be processed."""

created_at: str
created_at: int
"""The Unix timestamp (in seconds) for when the batch was created."""

endpoint: str
Expand All @@ -41,33 +41,33 @@ class Batch(BaseModel):
]
"""The current status of the batch."""

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

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

completed_at: Optional[str] = None
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[str] = None
expired_at: Optional[int] = None
"""The Unix timestamp (in seconds) for when the batch expired."""

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

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

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

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

metadata: Optional[builtins.object] = None
Expand Down
5 changes: 3 additions & 2 deletions src/openai/types/batch_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ class BatchCreateParams(TypedDict, total=False):
See [upload file](https://platform.openai.com/docs/api-reference/files/create)
for how to upload a file.

Your input file must be formatted as a JSONL file, and must be uploaded with the
purpose `batch`.
Your input file must be formatted as a
[JSONL file](https://platform.openai.com/docs/api-reference/batch/requestInput),
and must be uploaded with the purpose `batch`.
"""

metadata: Optional[Dict[str, str]]
Expand Down
6 changes: 3 additions & 3 deletions src/openai/types/beta/vector_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ class VectorStore(BaseModel):
id: str
"""The identifier, which can be referenced in API endpoints."""

bytes: int
"""The byte size of the vector store."""

created_at: int
"""The Unix timestamp (in seconds) for when the vector store was created."""

Expand Down Expand Up @@ -72,6 +69,9 @@ class VectorStore(BaseModel):
for use.
"""

usage_bytes: int
"""The total number of bytes used by the files in the vector store."""

expires_after: Optional[ExpiresAfter] = None
"""The expiration policy for a vector store."""

Expand Down
6 changes: 6 additions & 0 deletions src/openai/types/beta/vector_stores/vector_store_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ class VectorStoreFile(BaseModel):
vector store file is ready for use.
"""

usage_bytes: int
"""The total vector store usage in bytes.

Note that this may be different from the original file size.
"""

vector_store_id: str
"""
The ID of the
Expand Down