Skip to content

Commit

Permalink
fix(api): change timestamps to unix integers (#798)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Apr 24, 2024
1 parent 49fcc86 commit 7271a6c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
23 changes: 12 additions & 11 deletions src/resources/batches.ts
Expand Up @@ -57,7 +57,7 @@ export interface Batch {
/**
* The Unix timestamp (in seconds) for when the batch was created.
*/
created_at: string;
created_at: number;

/**
* The OpenAI API endpoint used by the batch.
Expand Down Expand Up @@ -90,17 +90,17 @@ export interface Batch {
/**
* The Unix timestamp (in seconds) for when the batch was cancelled.
*/
cancelled_at?: string;
cancelled_at?: number;

/**
* The Unix timestamp (in seconds) for when the batch started cancelling.
*/
cancelling_at?: string;
cancelling_at?: number;

/**
* The Unix timestamp (in seconds) for when the batch was completed.
*/
completed_at?: string;
completed_at?: number;

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

/**
* The Unix timestamp (in seconds) for when the batch will expire.
*/
expires_at?: string;
expires_at?: number;

/**
* The Unix timestamp (in seconds) for when the batch failed.
*/
failed_at?: string;
failed_at?: number;

/**
* The Unix timestamp (in seconds) for when the batch started finalizing.
*/
finalizing_at?: string;
finalizing_at?: number;

/**
* The Unix timestamp (in seconds) for when the batch started processing.
*/
in_progress_at?: string;
in_progress_at?: number;

/**
* Set of 16 key-value pairs that can be attached to an object. This can be useful
Expand Down Expand Up @@ -225,8 +225,9 @@ export interface BatchCreateParams {
* 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`.
*/
input_file_id: string;

Expand Down
6 changes: 6 additions & 0 deletions src/resources/beta/vector-stores/files.ts
Expand Up @@ -203,6 +203,12 @@ export interface VectorStoreFile {
*/
status: 'in_progress' | 'completed' | 'cancelled' | 'failed';

/**
* The total vector store usage in bytes. Note that this may be different from the
* original file size.
*/
usage_bytes: number;

/**
* The ID of the
* [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
Expand Down
10 changes: 5 additions & 5 deletions src/resources/beta/vector-stores/vector-stores.ts
Expand Up @@ -93,11 +93,6 @@ export interface VectorStore {
*/
id: string;

/**
* The byte size of the vector store.
*/
bytes: number;

/**
* The Unix timestamp (in seconds) for when the vector store was created.
*/
Expand Down Expand Up @@ -135,6 +130,11 @@ export interface VectorStore {
*/
status: 'expired' | 'in_progress' | 'completed';

/**
* The total number of bytes used by the files in the vector store.
*/
usage_bytes: number;

/**
* The expiration policy for a vector store.
*/
Expand Down

0 comments on commit 7271a6c

Please sign in to comment.