Skip to content

Commit

Permalink
fix(api): change timestamps to unix integers (#1367)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Apr 24, 2024
1 parent 4204e63 commit fbc0e15
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 18 deletions.
10 changes: 6 additions & 4 deletions src/openai/resources/batches.py
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
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
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
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
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

0 comments on commit fbc0e15

Please sign in to comment.