Skip to content
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

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

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 12 additions & 11 deletions src/resources/batches.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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