Skip to content

Commit

Permalink
feat(api): adding file purposes (#831)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed May 8, 2024
1 parent 7196ac9 commit a62b877
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 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: 64
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-edb5af3ade0cd27cf366b0654b90c7a81c43c433e11fc3f6e621e2c779de10d4.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-2e14236d4015bf3b956290ea8b656224a0c7b206a356c6af2a7ae43fdbceb04c.yml
18 changes: 9 additions & 9 deletions src/resources/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,11 @@ export interface FileObject {
object: 'file';

/**
* The intended purpose of the file. Supported values are `fine-tune`,
* `fine-tune-results`, `assistants`, and `assistants_output`.
* The intended purpose of the file. Supported values are `assistants`,
* `assistants_output`, `batch`, `batch_output`, `fine-tune`, and
* `fine-tune-results`.
*/
purpose: 'fine-tune' | 'fine-tune-results' | 'assistants' | 'assistants_output';
purpose: 'assistants' | 'assistants_output' | 'batch' | 'batch_output' | 'fine-tune' | 'fine-tune-results';

/**
* @deprecated: Deprecated. The current status of the file, which can be either
Expand All @@ -175,14 +176,13 @@ export interface FileCreateParams {
/**
* The intended purpose of the uploaded file.
*
* Use "fine-tune" for
* [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning) and
* "assistants" for
* Use "assistants" for
* [Assistants](https://platform.openai.com/docs/api-reference/assistants) and
* [Messages](https://platform.openai.com/docs/api-reference/messages). This allows
* us to validate the format of the uploaded file is correct for fine-tuning.
* [Messages](https://platform.openai.com/docs/api-reference/messages), "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).
*/
purpose: 'fine-tune' | 'assistants';
purpose: 'assistants' | 'batch' | 'fine-tune';
}

export interface FileListParams {
Expand Down
4 changes: 2 additions & 2 deletions tests/api-resources/files.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('resource files', () => {
test('create: only required params', async () => {
const responsePromise = openai.files.create({
file: await toFile(Buffer.from('# my file contents'), 'README.md'),
purpose: 'fine-tune',
purpose: 'assistants',
});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
Expand All @@ -26,7 +26,7 @@ describe('resource files', () => {
test('create: required and optional params', async () => {
const response = await openai.files.create({
file: await toFile(Buffer.from('# my file contents'), 'README.md'),
purpose: 'fine-tune',
purpose: 'assistants',
});
});

Expand Down

0 comments on commit a62b877

Please sign in to comment.