Commit 55f07f31

Stainless Bot <107565488+stainless-bot@users.noreply.github.com>
2024-04-25 02:33:44
fix(api): change timestamps to unix integers (#1367)
1 parent 9a1f013
Changed files (5)
src/openai/resources/batches.py
@@ -65,8 +65,9 @@ class Batches(SyncAPIResource):
               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.
 
@@ -252,8 +253,9 @@ class AsyncBatches(AsyncAPIResource):
               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.
 
src/openai/types/beta/vector_stores/vector_store_file.py
@@ -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
src/openai/types/beta/vector_store.py
@@ -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."""
 
@@ -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."""
 
src/openai/types/batch.py
@@ -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
@@ -41,13 +41,13 @@ 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
@@ -55,19 +55,19 @@ class Batch(BaseModel):
 
     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
src/openai/types/batch_create_params.py
@@ -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]]