Skip to content

Commit

Permalink
chore(types): define FilePurpose enum (#997)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Aug 15, 2024
1 parent 19a5ba3 commit 19b941b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Types:
- <code><a href="./src/resources/files.ts">FileContent</a></code>
- <code><a href="./src/resources/files.ts">FileDeleted</a></code>
- <code><a href="./src/resources/files.ts">FileObject</a></code>
- <code><a href="./src/resources/files.ts">FilePurpose</a></code>

Methods:

Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
15 changes: 14 additions & 1 deletion src/resources/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 {
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export {
FileContent,
FileDeleted,
FileObject,
FilePurpose,
FileCreateParams,
FileListParams,
FileObjectsPage,
Expand Down
2 changes: 1 addition & 1 deletion src/resources/uploads/uploads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 19b941b

Please sign in to comment.