Skip to content

Commit 80d7697

Browse files
committed
fix(api): change timestamps to unix integers (#798)
1 parent 7d2fd6c commit 80d7697

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

src/resources/batches.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export interface Batch {
5757
/**
5858
* The Unix timestamp (in seconds) for when the batch was created.
5959
*/
60-
created_at: string;
60+
created_at: number;
6161

6262
/**
6363
* The OpenAI API endpoint used by the batch.
@@ -90,17 +90,17 @@ export interface Batch {
9090
/**
9191
* The Unix timestamp (in seconds) for when the batch was cancelled.
9292
*/
93-
cancelled_at?: string;
93+
cancelled_at?: number;
9494

9595
/**
9696
* The Unix timestamp (in seconds) for when the batch started cancelling.
9797
*/
98-
cancelling_at?: string;
98+
cancelling_at?: number;
9999

100100
/**
101101
* The Unix timestamp (in seconds) for when the batch was completed.
102102
*/
103-
completed_at?: string;
103+
completed_at?: number;
104104

105105
/**
106106
* The ID of the file containing the outputs of requests with errors.
@@ -112,27 +112,27 @@ export interface Batch {
112112
/**
113113
* The Unix timestamp (in seconds) for when the batch expired.
114114
*/
115-
expired_at?: string;
115+
expired_at?: number;
116116

117117
/**
118118
* The Unix timestamp (in seconds) for when the batch will expire.
119119
*/
120-
expires_at?: string;
120+
expires_at?: number;
121121

122122
/**
123123
* The Unix timestamp (in seconds) for when the batch failed.
124124
*/
125-
failed_at?: string;
125+
failed_at?: number;
126126

127127
/**
128128
* The Unix timestamp (in seconds) for when the batch started finalizing.
129129
*/
130-
finalizing_at?: string;
130+
finalizing_at?: number;
131131

132132
/**
133133
* The Unix timestamp (in seconds) for when the batch started processing.
134134
*/
135-
in_progress_at?: string;
135+
in_progress_at?: number;
136136

137137
/**
138138
* Set of 16 key-value pairs that can be attached to an object. This can be useful
@@ -225,8 +225,9 @@ export interface BatchCreateParams {
225225
* See [upload file](https://platform.openai.com/docs/api-reference/files/create)
226226
* for how to upload a file.
227227
*
228-
* Your input file must be formatted as a JSONL file, and must be uploaded with the
229-
* purpose `batch`.
228+
* Your input file must be formatted as a
229+
* [JSONL file](https://platform.openai.com/docs/api-reference/batch/requestInput),
230+
* and must be uploaded with the purpose `batch`.
230231
*/
231232
input_file_id: string;
232233

src/resources/beta/vector-stores/files.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,12 @@ export interface VectorStoreFile {
203203
*/
204204
status: 'in_progress' | 'completed' | 'cancelled' | 'failed';
205205

206+
/**
207+
* The total vector store usage in bytes. Note that this may be different from the
208+
* original file size.
209+
*/
210+
usage_bytes: number;
211+
206212
/**
207213
* The ID of the
208214
* [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)

src/resources/beta/vector-stores/vector-stores.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,6 @@ export interface VectorStore {
9393
*/
9494
id: string;
9595

96-
/**
97-
* The byte size of the vector store.
98-
*/
99-
bytes: number;
100-
10196
/**
10297
* The Unix timestamp (in seconds) for when the vector store was created.
10398
*/
@@ -135,6 +130,11 @@ export interface VectorStore {
135130
*/
136131
status: 'expired' | 'in_progress' | 'completed';
137132

133+
/**
134+
* The total number of bytes used by the files in the vector store.
135+
*/
136+
usage_bytes: number;
137+
138138
/**
139139
* The expiration policy for a vector store.
140140
*/

0 commit comments

Comments
 (0)