diff --git a/tests/api-resources/audio/speech.test.ts b/tests/api-resources/audio/speech.test.ts index 18302ce9a..7509c19ca 100644 --- a/tests/api-resources/audio/speech.test.ts +++ b/tests/api-resources/audio/speech.test.ts @@ -11,7 +11,7 @@ describe('resource speech', () => { // binary tests are currently broken test.skip('create: required and optional params', async () => { const response = await openai.audio.speech.create({ - input: 'string', + input: 'input', model: 'string', voice: 'alloy', response_format: 'mp3', diff --git a/tests/api-resources/audio/transcriptions.test.ts b/tests/api-resources/audio/transcriptions.test.ts index 3fc4ca22b..938ddd2b3 100644 --- a/tests/api-resources/audio/transcriptions.test.ts +++ b/tests/api-resources/audio/transcriptions.test.ts @@ -27,8 +27,8 @@ describe('resource transcriptions', () => { const response = await openai.audio.transcriptions.create({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), model: 'whisper-1', - language: 'string', - prompt: 'string', + language: 'language', + prompt: 'prompt', response_format: 'json', temperature: 0, timestamp_granularities: ['word', 'segment'], diff --git a/tests/api-resources/audio/translations.test.ts b/tests/api-resources/audio/translations.test.ts index 0853bedfb..3f05bc90f 100644 --- a/tests/api-resources/audio/translations.test.ts +++ b/tests/api-resources/audio/translations.test.ts @@ -27,8 +27,8 @@ describe('resource translations', () => { const response = await openai.audio.translations.create({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), model: 'whisper-1', - prompt: 'string', - response_format: 'string', + prompt: 'prompt', + response_format: 'response_format', temperature: 0, }); }); diff --git a/tests/api-resources/batches.test.ts b/tests/api-resources/batches.test.ts index 2cd845de6..2861298a8 100644 --- a/tests/api-resources/batches.test.ts +++ b/tests/api-resources/batches.test.ts @@ -13,7 +13,7 @@ describe('resource batches', () => { const responsePromise = openai.batches.create({ completion_window: '24h', endpoint: '/v1/chat/completions', - input_file_id: 'string', + input_file_id: 'input_file_id', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -28,13 +28,13 @@ describe('resource batches', () => { const response = await openai.batches.create({ completion_window: '24h', endpoint: '/v1/chat/completions', - input_file_id: 'string', + input_file_id: 'input_file_id', metadata: { foo: 'string' }, }); }); test('retrieve', async () => { - const responsePromise = openai.batches.retrieve('string'); + const responsePromise = openai.batches.retrieve('batch_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -46,7 +46,7 @@ describe('resource batches', () => { test('retrieve: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(openai.batches.retrieve('string', { path: '/_stainless_unknown_path' })).rejects.toThrow( + await expect(openai.batches.retrieve('batch_id', { path: '/_stainless_unknown_path' })).rejects.toThrow( OpenAI.NotFoundError, ); }); @@ -72,12 +72,12 @@ describe('resource batches', () => { test('list: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.batches.list({ after: 'string', limit: 0 }, { path: '/_stainless_unknown_path' }), + openai.batches.list({ after: 'after', limit: 0 }, { path: '/_stainless_unknown_path' }), ).rejects.toThrow(OpenAI.NotFoundError); }); test('cancel', async () => { - const responsePromise = openai.batches.cancel('string'); + const responsePromise = openai.batches.cancel('batch_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -89,7 +89,7 @@ describe('resource batches', () => { test('cancel: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(openai.batches.cancel('string', { path: '/_stainless_unknown_path' })).rejects.toThrow( + await expect(openai.batches.cancel('batch_id', { path: '/_stainless_unknown_path' })).rejects.toThrow( OpenAI.NotFoundError, ); }); diff --git a/tests/api-resources/beta/assistants.test.ts b/tests/api-resources/beta/assistants.test.ts index 4049f09b3..44ee2921d 100644 --- a/tests/api-resources/beta/assistants.test.ts +++ b/tests/api-resources/beta/assistants.test.ts @@ -23,10 +23,10 @@ describe('resource assistants', () => { test('create: required and optional params', async () => { const response = await openai.beta.assistants.create({ model: 'gpt-4-turbo', - description: 'string', - instructions: 'string', + description: 'description', + instructions: 'instructions', metadata: {}, - name: 'string', + name: 'name', response_format: 'none', temperature: 1, tool_resources: { @@ -44,7 +44,7 @@ describe('resource assistants', () => { }); test('retrieve', async () => { - const responsePromise = openai.beta.assistants.retrieve('string'); + const responsePromise = openai.beta.assistants.retrieve('assistant_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -57,12 +57,12 @@ describe('resource assistants', () => { test('retrieve: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.beta.assistants.retrieve('string', { path: '/_stainless_unknown_path' }), + openai.beta.assistants.retrieve('assistant_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(OpenAI.NotFoundError); }); test('update', async () => { - const responsePromise = openai.beta.assistants.update('string', {}); + const responsePromise = openai.beta.assistants.update('assistant_id', {}); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -94,14 +94,14 @@ describe('resource assistants', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( openai.beta.assistants.list( - { after: 'string', before: 'string', limit: 0, order: 'asc' }, + { after: 'after', before: 'before', limit: 0, order: 'asc' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(OpenAI.NotFoundError); }); test('del', async () => { - const responsePromise = openai.beta.assistants.del('string'); + const responsePromise = openai.beta.assistants.del('assistant_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -113,8 +113,8 @@ describe('resource assistants', () => { test('del: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(openai.beta.assistants.del('string', { path: '/_stainless_unknown_path' })).rejects.toThrow( - OpenAI.NotFoundError, - ); + await expect( + openai.beta.assistants.del('assistant_id', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(OpenAI.NotFoundError); }); }); diff --git a/tests/api-resources/beta/threads/messages.test.ts b/tests/api-resources/beta/threads/messages.test.ts index 01268586c..0f2877af1 100644 --- a/tests/api-resources/beta/threads/messages.test.ts +++ b/tests/api-resources/beta/threads/messages.test.ts @@ -10,7 +10,7 @@ const openai = new OpenAI({ describe('resource messages', () => { test('create: only required params', async () => { - const responsePromise = openai.beta.threads.messages.create('string', { + const responsePromise = openai.beta.threads.messages.create('thread_id', { content: 'string', role: 'user', }); @@ -24,20 +24,20 @@ describe('resource messages', () => { }); test('create: required and optional params', async () => { - const response = await openai.beta.threads.messages.create('string', { + const response = await openai.beta.threads.messages.create('thread_id', { content: 'string', role: 'user', attachments: [ { - file_id: 'string', + file_id: 'file_id', tools: [{ type: 'code_interpreter' }, { type: 'code_interpreter' }, { type: 'code_interpreter' }], }, { - file_id: 'string', + file_id: 'file_id', tools: [{ type: 'code_interpreter' }, { type: 'code_interpreter' }, { type: 'code_interpreter' }], }, { - file_id: 'string', + file_id: 'file_id', tools: [{ type: 'code_interpreter' }, { type: 'code_interpreter' }, { type: 'code_interpreter' }], }, ], @@ -46,7 +46,7 @@ describe('resource messages', () => { }); test('retrieve', async () => { - const responsePromise = openai.beta.threads.messages.retrieve('string', 'string'); + const responsePromise = openai.beta.threads.messages.retrieve('thread_id', 'message_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -59,12 +59,12 @@ describe('resource messages', () => { test('retrieve: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.beta.threads.messages.retrieve('string', 'string', { path: '/_stainless_unknown_path' }), + openai.beta.threads.messages.retrieve('thread_id', 'message_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(OpenAI.NotFoundError); }); test('update', async () => { - const responsePromise = openai.beta.threads.messages.update('string', 'string', {}); + const responsePromise = openai.beta.threads.messages.update('thread_id', 'message_id', {}); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -75,7 +75,7 @@ describe('resource messages', () => { }); test('list', async () => { - const responsePromise = openai.beta.threads.messages.list('string'); + const responsePromise = openai.beta.threads.messages.list('thread_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -88,7 +88,7 @@ describe('resource messages', () => { test('list: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.beta.threads.messages.list('string', { path: '/_stainless_unknown_path' }), + openai.beta.threads.messages.list('thread_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(OpenAI.NotFoundError); }); @@ -96,15 +96,15 @@ describe('resource messages', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( openai.beta.threads.messages.list( - 'string', - { after: 'string', before: 'string', limit: 0, order: 'asc', run_id: 'string' }, + 'thread_id', + { after: 'after', before: 'before', limit: 0, order: 'asc', run_id: 'run_id' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(OpenAI.NotFoundError); }); test('del', async () => { - const responsePromise = openai.beta.threads.messages.del('string', 'string'); + const responsePromise = openai.beta.threads.messages.del('thread_id', 'message_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -117,7 +117,7 @@ describe('resource messages', () => { test('del: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.beta.threads.messages.del('string', 'string', { path: '/_stainless_unknown_path' }), + openai.beta.threads.messages.del('thread_id', 'message_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(OpenAI.NotFoundError); }); }); diff --git a/tests/api-resources/beta/threads/runs/runs.test.ts b/tests/api-resources/beta/threads/runs/runs.test.ts index 5aba82ff8..b422a9a3f 100644 --- a/tests/api-resources/beta/threads/runs/runs.test.ts +++ b/tests/api-resources/beta/threads/runs/runs.test.ts @@ -10,7 +10,7 @@ const openai = new OpenAI({ describe('resource runs', () => { test('create: only required params', async () => { - const responsePromise = openai.beta.threads.runs.create('string', { assistant_id: 'string' }); + const responsePromise = openai.beta.threads.runs.create('thread_id', { assistant_id: 'assistant_id' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -21,16 +21,16 @@ describe('resource runs', () => { }); test('create: required and optional params', async () => { - const response = await openai.beta.threads.runs.create('string', { - assistant_id: 'string', - additional_instructions: 'string', + const response = await openai.beta.threads.runs.create('thread_id', { + assistant_id: 'assistant_id', + additional_instructions: 'additional_instructions', additional_messages: [ { role: 'user', content: 'string', attachments: [ { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -38,7 +38,7 @@ describe('resource runs', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -46,7 +46,7 @@ describe('resource runs', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -61,7 +61,7 @@ describe('resource runs', () => { content: 'string', attachments: [ { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -69,7 +69,7 @@ describe('resource runs', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -77,7 +77,7 @@ describe('resource runs', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -92,7 +92,7 @@ describe('resource runs', () => { content: 'string', attachments: [ { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -100,7 +100,7 @@ describe('resource runs', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -108,7 +108,7 @@ describe('resource runs', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -119,7 +119,7 @@ describe('resource runs', () => { metadata: {}, }, ], - instructions: 'string', + instructions: 'instructions', max_completion_tokens: 256, max_prompt_tokens: 256, metadata: {}, @@ -136,7 +136,7 @@ describe('resource runs', () => { }); test('retrieve', async () => { - const responsePromise = openai.beta.threads.runs.retrieve('string', 'string'); + const responsePromise = openai.beta.threads.runs.retrieve('thread_id', 'run_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -149,12 +149,12 @@ describe('resource runs', () => { test('retrieve: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.beta.threads.runs.retrieve('string', 'string', { path: '/_stainless_unknown_path' }), + openai.beta.threads.runs.retrieve('thread_id', 'run_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(OpenAI.NotFoundError); }); test('update', async () => { - const responsePromise = openai.beta.threads.runs.update('string', 'string', {}); + const responsePromise = openai.beta.threads.runs.update('thread_id', 'run_id', {}); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -165,7 +165,7 @@ describe('resource runs', () => { }); test('list', async () => { - const responsePromise = openai.beta.threads.runs.list('string'); + const responsePromise = openai.beta.threads.runs.list('thread_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -178,7 +178,7 @@ describe('resource runs', () => { test('list: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.beta.threads.runs.list('string', { path: '/_stainless_unknown_path' }), + openai.beta.threads.runs.list('thread_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(OpenAI.NotFoundError); }); @@ -186,15 +186,15 @@ describe('resource runs', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( openai.beta.threads.runs.list( - 'string', - { after: 'string', before: 'string', limit: 0, order: 'asc' }, + 'thread_id', + { after: 'after', before: 'before', limit: 0, order: 'asc' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(OpenAI.NotFoundError); }); test('cancel', async () => { - const responsePromise = openai.beta.threads.runs.cancel('string', 'string'); + const responsePromise = openai.beta.threads.runs.cancel('thread_id', 'run_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -207,12 +207,12 @@ describe('resource runs', () => { test('cancel: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.beta.threads.runs.cancel('string', 'string', { path: '/_stainless_unknown_path' }), + openai.beta.threads.runs.cancel('thread_id', 'run_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(OpenAI.NotFoundError); }); test('submitToolOutputs: only required params', async () => { - const responsePromise = openai.beta.threads.runs.submitToolOutputs('string', 'string', { + const responsePromise = openai.beta.threads.runs.submitToolOutputs('thread_id', 'run_id', { tool_outputs: [{}, {}, {}], }); const rawResponse = await responsePromise.asResponse(); @@ -225,11 +225,11 @@ describe('resource runs', () => { }); test('submitToolOutputs: required and optional params', async () => { - const response = await openai.beta.threads.runs.submitToolOutputs('string', 'string', { + const response = await openai.beta.threads.runs.submitToolOutputs('thread_id', 'run_id', { tool_outputs: [ - { tool_call_id: 'string', output: 'string' }, - { tool_call_id: 'string', output: 'string' }, - { tool_call_id: 'string', output: 'string' }, + { tool_call_id: 'tool_call_id', output: 'output' }, + { tool_call_id: 'tool_call_id', output: 'output' }, + { tool_call_id: 'tool_call_id', output: 'output' }, ], stream: false, }); diff --git a/tests/api-resources/beta/threads/runs/steps.test.ts b/tests/api-resources/beta/threads/runs/steps.test.ts index 76495a1a3..1981d67fd 100644 --- a/tests/api-resources/beta/threads/runs/steps.test.ts +++ b/tests/api-resources/beta/threads/runs/steps.test.ts @@ -10,7 +10,7 @@ const openai = new OpenAI({ describe('resource steps', () => { test('retrieve', async () => { - const responsePromise = openai.beta.threads.runs.steps.retrieve('string', 'string', 'string'); + const responsePromise = openai.beta.threads.runs.steps.retrieve('thread_id', 'run_id', 'step_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -23,14 +23,14 @@ describe('resource steps', () => { test('retrieve: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.beta.threads.runs.steps.retrieve('string', 'string', 'string', { + openai.beta.threads.runs.steps.retrieve('thread_id', 'run_id', 'step_id', { path: '/_stainless_unknown_path', }), ).rejects.toThrow(OpenAI.NotFoundError); }); test('list', async () => { - const responsePromise = openai.beta.threads.runs.steps.list('string', 'string'); + const responsePromise = openai.beta.threads.runs.steps.list('thread_id', 'run_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -43,7 +43,7 @@ describe('resource steps', () => { test('list: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.beta.threads.runs.steps.list('string', 'string', { path: '/_stainless_unknown_path' }), + openai.beta.threads.runs.steps.list('thread_id', 'run_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(OpenAI.NotFoundError); }); @@ -51,9 +51,9 @@ describe('resource steps', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( openai.beta.threads.runs.steps.list( - 'string', - 'string', - { after: 'string', before: 'string', limit: 0, order: 'asc' }, + 'thread_id', + 'run_id', + { after: 'after', before: 'before', limit: 0, order: 'asc' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(OpenAI.NotFoundError); diff --git a/tests/api-resources/beta/threads/threads.test.ts b/tests/api-resources/beta/threads/threads.test.ts index 85f89533c..0d2d93a61 100644 --- a/tests/api-resources/beta/threads/threads.test.ts +++ b/tests/api-resources/beta/threads/threads.test.ts @@ -38,7 +38,7 @@ describe('resource threads', () => { content: 'string', attachments: [ { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -46,7 +46,7 @@ describe('resource threads', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -54,7 +54,7 @@ describe('resource threads', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -69,7 +69,7 @@ describe('resource threads', () => { content: 'string', attachments: [ { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -77,7 +77,7 @@ describe('resource threads', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -85,7 +85,7 @@ describe('resource threads', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -100,7 +100,7 @@ describe('resource threads', () => { content: 'string', attachments: [ { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -108,7 +108,7 @@ describe('resource threads', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -116,7 +116,7 @@ describe('resource threads', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -148,7 +148,7 @@ describe('resource threads', () => { }); test('retrieve', async () => { - const responsePromise = openai.beta.threads.retrieve('string'); + const responsePromise = openai.beta.threads.retrieve('thread_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -161,12 +161,12 @@ describe('resource threads', () => { test('retrieve: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.beta.threads.retrieve('string', { path: '/_stainless_unknown_path' }), + openai.beta.threads.retrieve('thread_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(OpenAI.NotFoundError); }); test('update', async () => { - const responsePromise = openai.beta.threads.update('string', {}); + const responsePromise = openai.beta.threads.update('thread_id', {}); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -177,7 +177,7 @@ describe('resource threads', () => { }); test('del', async () => { - const responsePromise = openai.beta.threads.del('string'); + const responsePromise = openai.beta.threads.del('thread_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -189,13 +189,13 @@ describe('resource threads', () => { test('del: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(openai.beta.threads.del('string', { path: '/_stainless_unknown_path' })).rejects.toThrow( + await expect(openai.beta.threads.del('thread_id', { path: '/_stainless_unknown_path' })).rejects.toThrow( OpenAI.NotFoundError, ); }); test('createAndRun: only required params', async () => { - const responsePromise = openai.beta.threads.createAndRun({ assistant_id: 'string' }); + const responsePromise = openai.beta.threads.createAndRun({ assistant_id: 'assistant_id' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -207,8 +207,8 @@ describe('resource threads', () => { test('createAndRun: required and optional params', async () => { const response = await openai.beta.threads.createAndRun({ - assistant_id: 'string', - instructions: 'string', + assistant_id: 'assistant_id', + instructions: 'instructions', max_completion_tokens: 256, max_prompt_tokens: 256, metadata: {}, @@ -224,7 +224,7 @@ describe('resource threads', () => { content: 'string', attachments: [ { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -232,7 +232,7 @@ describe('resource threads', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -240,7 +240,7 @@ describe('resource threads', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -255,7 +255,7 @@ describe('resource threads', () => { content: 'string', attachments: [ { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -263,7 +263,7 @@ describe('resource threads', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -271,7 +271,7 @@ describe('resource threads', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -286,7 +286,7 @@ describe('resource threads', () => { content: 'string', attachments: [ { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -294,7 +294,7 @@ describe('resource threads', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, @@ -302,7 +302,7 @@ describe('resource threads', () => { ], }, { - file_id: 'string', + file_id: 'file_id', tools: [ { type: 'code_interpreter' }, { type: 'code_interpreter' }, diff --git a/tests/api-resources/beta/vector-stores/file-batches.test.ts b/tests/api-resources/beta/vector-stores/file-batches.test.ts index b8ff697b7..33bfd2ef7 100644 --- a/tests/api-resources/beta/vector-stores/file-batches.test.ts +++ b/tests/api-resources/beta/vector-stores/file-batches.test.ts @@ -50,7 +50,7 @@ describe('resource fileBatches', () => { }); test('cancel', async () => { - const responsePromise = openai.beta.vectorStores.fileBatches.cancel('string', 'string'); + const responsePromise = openai.beta.vectorStores.fileBatches.cancel('vector_store_id', 'batch_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -63,12 +63,14 @@ describe('resource fileBatches', () => { test('cancel: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.beta.vectorStores.fileBatches.cancel('string', 'string', { path: '/_stainless_unknown_path' }), + openai.beta.vectorStores.fileBatches.cancel('vector_store_id', 'batch_id', { + path: '/_stainless_unknown_path', + }), ).rejects.toThrow(OpenAI.NotFoundError); }); test('listFiles', async () => { - const responsePromise = openai.beta.vectorStores.fileBatches.listFiles('string', 'string'); + const responsePromise = openai.beta.vectorStores.fileBatches.listFiles('vector_store_id', 'batch_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -81,7 +83,7 @@ describe('resource fileBatches', () => { test('listFiles: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.beta.vectorStores.fileBatches.listFiles('string', 'string', { + openai.beta.vectorStores.fileBatches.listFiles('vector_store_id', 'batch_id', { path: '/_stainless_unknown_path', }), ).rejects.toThrow(OpenAI.NotFoundError); @@ -91,9 +93,9 @@ describe('resource fileBatches', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( openai.beta.vectorStores.fileBatches.listFiles( - 'string', - 'string', - { after: 'string', before: 'string', filter: 'in_progress', limit: 0, order: 'asc' }, + 'vector_store_id', + 'batch_id', + { after: 'after', before: 'before', filter: 'in_progress', limit: 0, order: 'asc' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(OpenAI.NotFoundError); diff --git a/tests/api-resources/beta/vector-stores/files.test.ts b/tests/api-resources/beta/vector-stores/files.test.ts index 60906dac3..4b21aed30 100644 --- a/tests/api-resources/beta/vector-stores/files.test.ts +++ b/tests/api-resources/beta/vector-stores/files.test.ts @@ -10,7 +10,7 @@ const openai = new OpenAI({ describe('resource files', () => { test('create: only required params', async () => { - const responsePromise = openai.beta.vectorStores.files.create('vs_abc123', { file_id: 'string' }); + const responsePromise = openai.beta.vectorStores.files.create('vs_abc123', { file_id: 'file_id' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -22,7 +22,7 @@ describe('resource files', () => { test('create: required and optional params', async () => { const response = await openai.beta.vectorStores.files.create('vs_abc123', { - file_id: 'string', + file_id: 'file_id', chunking_strategy: { type: 'auto' }, }); }); @@ -48,7 +48,7 @@ describe('resource files', () => { }); test('list', async () => { - const responsePromise = openai.beta.vectorStores.files.list('string'); + const responsePromise = openai.beta.vectorStores.files.list('vector_store_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -61,7 +61,7 @@ describe('resource files', () => { test('list: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.beta.vectorStores.files.list('string', { path: '/_stainless_unknown_path' }), + openai.beta.vectorStores.files.list('vector_store_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(OpenAI.NotFoundError); }); @@ -69,15 +69,15 @@ describe('resource files', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( openai.beta.vectorStores.files.list( - 'string', - { after: 'string', before: 'string', filter: 'in_progress', limit: 0, order: 'asc' }, + 'vector_store_id', + { after: 'after', before: 'before', filter: 'in_progress', limit: 0, order: 'asc' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(OpenAI.NotFoundError); }); test('del', async () => { - const responsePromise = openai.beta.vectorStores.files.del('string', 'string'); + const responsePromise = openai.beta.vectorStores.files.del('vector_store_id', 'file_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -90,7 +90,7 @@ describe('resource files', () => { test('del: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.beta.vectorStores.files.del('string', 'string', { path: '/_stainless_unknown_path' }), + openai.beta.vectorStores.files.del('vector_store_id', 'file_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(OpenAI.NotFoundError); }); }); diff --git a/tests/api-resources/beta/vector-stores/vector-stores.test.ts b/tests/api-resources/beta/vector-stores/vector-stores.test.ts index 445fa9ebf..11dcceef8 100644 --- a/tests/api-resources/beta/vector-stores/vector-stores.test.ts +++ b/tests/api-resources/beta/vector-stores/vector-stores.test.ts @@ -21,7 +21,7 @@ describe('resource vectorStores', () => { }); test('retrieve', async () => { - const responsePromise = openai.beta.vectorStores.retrieve('string'); + const responsePromise = openai.beta.vectorStores.retrieve('vector_store_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -34,12 +34,12 @@ describe('resource vectorStores', () => { test('retrieve: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.beta.vectorStores.retrieve('string', { path: '/_stainless_unknown_path' }), + openai.beta.vectorStores.retrieve('vector_store_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(OpenAI.NotFoundError); }); test('update', async () => { - const responsePromise = openai.beta.vectorStores.update('string', {}); + const responsePromise = openai.beta.vectorStores.update('vector_store_id', {}); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -71,14 +71,14 @@ describe('resource vectorStores', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( openai.beta.vectorStores.list( - { after: 'string', before: 'string', limit: 0, order: 'asc' }, + { after: 'after', before: 'before', limit: 0, order: 'asc' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(OpenAI.NotFoundError); }); test('del', async () => { - const responsePromise = openai.beta.vectorStores.del('string'); + const responsePromise = openai.beta.vectorStores.del('vector_store_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -91,7 +91,7 @@ describe('resource vectorStores', () => { test('del: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.beta.vectorStores.del('string', { path: '/_stainless_unknown_path' }), + openai.beta.vectorStores.del('vector_store_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(OpenAI.NotFoundError); }); }); diff --git a/tests/api-resources/chat/completions.test.ts b/tests/api-resources/chat/completions.test.ts index 56c882d17..66ef2d023 100644 --- a/tests/api-resources/chat/completions.test.ts +++ b/tests/api-resources/chat/completions.test.ts @@ -11,7 +11,7 @@ const openai = new OpenAI({ describe('resource completions', () => { test('create: only required params', async () => { const responsePromise = openai.chat.completions.create({ - messages: [{ content: 'string', role: 'system' }], + messages: [{ content: 'content', role: 'system' }], model: 'gpt-4-turbo', }); const rawResponse = await responsePromise.asResponse(); @@ -25,11 +25,11 @@ describe('resource completions', () => { test('create: required and optional params', async () => { const response = await openai.chat.completions.create({ - messages: [{ content: 'string', role: 'system', name: 'string' }], + messages: [{ content: 'content', role: 'system', name: 'name' }], model: 'gpt-4-turbo', frequency_penalty: -2, function_call: 'none', - functions: [{ description: 'string', name: 'string', parameters: { foo: 'bar' } }], + functions: [{ description: 'description', name: 'name', parameters: { foo: 'bar' } }], logit_bias: { foo: 0 }, logprobs: true, max_tokens: 0, @@ -45,9 +45,18 @@ describe('resource completions', () => { temperature: 1, tool_choice: 'none', tools: [ - { type: 'function', function: { description: 'string', name: 'string', parameters: { foo: 'bar' } } }, - { type: 'function', function: { description: 'string', name: 'string', parameters: { foo: 'bar' } } }, - { type: 'function', function: { description: 'string', name: 'string', parameters: { foo: 'bar' } } }, + { + type: 'function', + function: { description: 'description', name: 'name', parameters: { foo: 'bar' } }, + }, + { + type: 'function', + function: { description: 'description', name: 'name', parameters: { foo: 'bar' } }, + }, + { + type: 'function', + function: { description: 'description', name: 'name', parameters: { foo: 'bar' } }, + }, ], top_logprobs: 0, top_p: 1, diff --git a/tests/api-resources/files.test.ts b/tests/api-resources/files.test.ts index 2fda1c947..55eded995 100644 --- a/tests/api-resources/files.test.ts +++ b/tests/api-resources/files.test.ts @@ -31,7 +31,7 @@ describe('resource files', () => { }); test('retrieve', async () => { - const responsePromise = openai.files.retrieve('string'); + const responsePromise = openai.files.retrieve('file_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -43,7 +43,7 @@ describe('resource files', () => { test('retrieve: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(openai.files.retrieve('string', { path: '/_stainless_unknown_path' })).rejects.toThrow( + await expect(openai.files.retrieve('file_id', { path: '/_stainless_unknown_path' })).rejects.toThrow( OpenAI.NotFoundError, ); }); @@ -69,12 +69,12 @@ describe('resource files', () => { test('list: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.files.list({ purpose: 'string' }, { path: '/_stainless_unknown_path' }), + openai.files.list({ purpose: 'purpose' }, { path: '/_stainless_unknown_path' }), ).rejects.toThrow(OpenAI.NotFoundError); }); test('del', async () => { - const responsePromise = openai.files.del('string'); + const responsePromise = openai.files.del('file_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -86,20 +86,20 @@ describe('resource files', () => { test('del: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(openai.files.del('string', { path: '/_stainless_unknown_path' })).rejects.toThrow( + await expect(openai.files.del('file_id', { path: '/_stainless_unknown_path' })).rejects.toThrow( OpenAI.NotFoundError, ); }); test('content: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(openai.files.content('string', { path: '/_stainless_unknown_path' })).rejects.toThrow( + await expect(openai.files.content('file_id', { path: '/_stainless_unknown_path' })).rejects.toThrow( OpenAI.NotFoundError, ); }); test('retrieveContent', async () => { - const responsePromise = openai.files.retrieveContent('string'); + const responsePromise = openai.files.retrieveContent('file_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -112,7 +112,7 @@ describe('resource files', () => { test('retrieveContent: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.files.retrieveContent('string', { path: '/_stainless_unknown_path' }), + openai.files.retrieveContent('file_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(OpenAI.NotFoundError); }); }); diff --git a/tests/api-resources/fine-tuning/jobs/checkpoints.test.ts b/tests/api-resources/fine-tuning/jobs/checkpoints.test.ts index 1844d7c87..3a01448e2 100644 --- a/tests/api-resources/fine-tuning/jobs/checkpoints.test.ts +++ b/tests/api-resources/fine-tuning/jobs/checkpoints.test.ts @@ -34,7 +34,7 @@ describe('resource checkpoints', () => { await expect( openai.fineTuning.jobs.checkpoints.list( 'ft-AF1WoRqd3aJAHsqc9NY7iL8F', - { after: 'string', limit: 0 }, + { after: 'after', limit: 0 }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(OpenAI.NotFoundError); diff --git a/tests/api-resources/fine-tuning/jobs/jobs.test.ts b/tests/api-resources/fine-tuning/jobs/jobs.test.ts index d2207cd97..c14912c3a 100644 --- a/tests/api-resources/fine-tuning/jobs/jobs.test.ts +++ b/tests/api-resources/fine-tuning/jobs/jobs.test.ts @@ -33,8 +33,8 @@ describe('resource jobs', () => { type: 'wandb', wandb: { project: 'my-wandb-project', - name: 'string', - entity: 'string', + name: 'name', + entity: 'entity', tags: ['custom-tag', 'custom-tag', 'custom-tag'], }, }, @@ -42,8 +42,8 @@ describe('resource jobs', () => { type: 'wandb', wandb: { project: 'my-wandb-project', - name: 'string', - entity: 'string', + name: 'name', + entity: 'entity', tags: ['custom-tag', 'custom-tag', 'custom-tag'], }, }, @@ -51,8 +51,8 @@ describe('resource jobs', () => { type: 'wandb', wandb: { project: 'my-wandb-project', - name: 'string', - entity: 'string', + name: 'name', + entity: 'entity', tags: ['custom-tag', 'custom-tag', 'custom-tag'], }, }, @@ -102,7 +102,7 @@ describe('resource jobs', () => { test('list: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - openai.fineTuning.jobs.list({ after: 'string', limit: 0 }, { path: '/_stainless_unknown_path' }), + openai.fineTuning.jobs.list({ after: 'after', limit: 0 }, { path: '/_stainless_unknown_path' }), ).rejects.toThrow(OpenAI.NotFoundError); }); @@ -147,7 +147,7 @@ describe('resource jobs', () => { await expect( openai.fineTuning.jobs.listEvents( 'ft-AF1WoRqd3aJAHsqc9NY7iL8F', - { after: 'string', limit: 0 }, + { after: 'after', limit: 0 }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(OpenAI.NotFoundError);