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

feat(api): adding file purposes #831

Merged
merged 1 commit into from
May 8, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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