diff --git a/.stats.yml b/.stats.yml index 2371b7b8d..185585b67 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 68 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-285bce7dcdae7eea5fe84a8d6e5af2c1473d65ea193109370fb2257851eef7eb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-8ff62fa1091460d68fbd36d72c17d91b709917bebf2983c9c4de5784bc384a2e.yml diff --git a/api.md b/api.md index 25f08b130..9594a101c 100644 --- a/api.md +++ b/api.md @@ -76,6 +76,7 @@ Types: - FileContent - FileDeleted - FileObject +- FilePurpose Methods: diff --git a/src/index.ts b/src/index.ts index 5f7dffd67..97ffb596d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -277,6 +277,7 @@ export namespace OpenAI { export import FileContent = API.FileContent; export import FileDeleted = API.FileDeleted; export import FileObject = API.FileObject; + export import FilePurpose = API.FilePurpose; export import FileObjectsPage = API.FileObjectsPage; export import FileCreateParams = API.FileCreateParams; export import FileListParams = API.FileListParams; diff --git a/src/resources/files.ts b/src/resources/files.ts index a2d3aaa44..ba01a9041 100644 --- a/src/resources/files.ts +++ b/src/resources/files.ts @@ -183,6 +183,18 @@ export interface FileObject { status_details?: string; } +/** + * The intended purpose of the uploaded file. + * + * Use "assistants" for + * [Assistants](https://platform.openai.com/docs/api-reference/assistants) and + * [Message](https://platform.openai.com/docs/api-reference/messages) files, + * "vision" for Assistants image file inputs, "batch" for + * [Batch API](https://platform.openai.com/docs/guides/batch), and "fine-tune" for + * [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning). + */ +export type FilePurpose = 'assistants' | 'batch' | 'fine-tune' | 'vision'; + export interface FileCreateParams { /** * The File object (not file name) to be uploaded. @@ -199,7 +211,7 @@ export interface FileCreateParams { * [Batch API](https://platform.openai.com/docs/guides/batch), and "fine-tune" for * [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning). */ - purpose: 'assistants' | 'batch' | 'fine-tune' | 'vision'; + purpose: FilePurpose; } export interface FileListParams { @@ -213,6 +225,7 @@ export namespace Files { export import FileContent = FilesAPI.FileContent; export import FileDeleted = FilesAPI.FileDeleted; export import FileObject = FilesAPI.FileObject; + export import FilePurpose = FilesAPI.FilePurpose; export import FileObjectsPage = FilesAPI.FileObjectsPage; export import FileCreateParams = FilesAPI.FileCreateParams; export import FileListParams = FilesAPI.FileListParams; diff --git a/src/resources/index.ts b/src/resources/index.ts index 8d952e2db..a78808584 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -27,6 +27,7 @@ export { FileContent, FileDeleted, FileObject, + FilePurpose, FileCreateParams, FileListParams, FileObjectsPage, diff --git a/src/resources/uploads/uploads.ts b/src/resources/uploads/uploads.ts index ceb2b6d23..1c3ed708d 100644 --- a/src/resources/uploads/uploads.ts +++ b/src/resources/uploads/uploads.ts @@ -143,7 +143,7 @@ export interface UploadCreateParams { * See the * [documentation on File purposes](https://platform.openai.com/docs/api-reference/files/create#files-create-purpose). */ - purpose: 'assistants' | 'batch' | 'fine-tune' | 'vision'; + purpose: FilesAPI.FilePurpose; } export interface UploadCompleteParams {