Skip to content

Commit acc7803

Browse files
docs(examples): update example values (#933)
1 parent fe84709 commit acc7803

16 files changed

+153
-142
lines changed

tests/api-resources/audio/speech.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('resource speech', () => {
1111
// binary tests are currently broken
1212
test.skip('create: required and optional params', async () => {
1313
const response = await openai.audio.speech.create({
14-
input: 'string',
14+
input: 'input',
1515
model: 'string',
1616
voice: 'alloy',
1717
response_format: 'mp3',

tests/api-resources/audio/transcriptions.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ describe('resource transcriptions', () => {
2727
const response = await openai.audio.transcriptions.create({
2828
file: await toFile(Buffer.from('# my file contents'), 'README.md'),
2929
model: 'whisper-1',
30-
language: 'string',
31-
prompt: 'string',
30+
language: 'language',
31+
prompt: 'prompt',
3232
response_format: 'json',
3333
temperature: 0,
3434
timestamp_granularities: ['word', 'segment'],

tests/api-resources/audio/translations.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ describe('resource translations', () => {
2727
const response = await openai.audio.translations.create({
2828
file: await toFile(Buffer.from('# my file contents'), 'README.md'),
2929
model: 'whisper-1',
30-
prompt: 'string',
31-
response_format: 'string',
30+
prompt: 'prompt',
31+
response_format: 'response_format',
3232
temperature: 0,
3333
});
3434
});

tests/api-resources/batches.test.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('resource batches', () => {
1313
const responsePromise = openai.batches.create({
1414
completion_window: '24h',
1515
endpoint: '/v1/chat/completions',
16-
input_file_id: 'string',
16+
input_file_id: 'input_file_id',
1717
});
1818
const rawResponse = await responsePromise.asResponse();
1919
expect(rawResponse).toBeInstanceOf(Response);
@@ -28,13 +28,13 @@ describe('resource batches', () => {
2828
const response = await openai.batches.create({
2929
completion_window: '24h',
3030
endpoint: '/v1/chat/completions',
31-
input_file_id: 'string',
31+
input_file_id: 'input_file_id',
3232
metadata: { foo: 'string' },
3333
});
3434
});
3535

3636
test('retrieve', async () => {
37-
const responsePromise = openai.batches.retrieve('string');
37+
const responsePromise = openai.batches.retrieve('batch_id');
3838
const rawResponse = await responsePromise.asResponse();
3939
expect(rawResponse).toBeInstanceOf(Response);
4040
const response = await responsePromise;
@@ -46,7 +46,7 @@ describe('resource batches', () => {
4646

4747
test('retrieve: request options instead of params are passed correctly', async () => {
4848
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
49-
await expect(openai.batches.retrieve('string', { path: '/_stainless_unknown_path' })).rejects.toThrow(
49+
await expect(openai.batches.retrieve('batch_id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
5050
OpenAI.NotFoundError,
5151
);
5252
});
@@ -72,12 +72,12 @@ describe('resource batches', () => {
7272
test('list: request options and params are passed correctly', async () => {
7373
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
7474
await expect(
75-
openai.batches.list({ after: 'string', limit: 0 }, { path: '/_stainless_unknown_path' }),
75+
openai.batches.list({ after: 'after', limit: 0 }, { path: '/_stainless_unknown_path' }),
7676
).rejects.toThrow(OpenAI.NotFoundError);
7777
});
7878

7979
test('cancel', async () => {
80-
const responsePromise = openai.batches.cancel('string');
80+
const responsePromise = openai.batches.cancel('batch_id');
8181
const rawResponse = await responsePromise.asResponse();
8282
expect(rawResponse).toBeInstanceOf(Response);
8383
const response = await responsePromise;
@@ -89,7 +89,7 @@ describe('resource batches', () => {
8989

9090
test('cancel: request options instead of params are passed correctly', async () => {
9191
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
92-
await expect(openai.batches.cancel('string', { path: '/_stainless_unknown_path' })).rejects.toThrow(
92+
await expect(openai.batches.cancel('batch_id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
9393
OpenAI.NotFoundError,
9494
);
9595
});

tests/api-resources/beta/assistants.test.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ describe('resource assistants', () => {
2323
test('create: required and optional params', async () => {
2424
const response = await openai.beta.assistants.create({
2525
model: 'gpt-4-turbo',
26-
description: 'string',
27-
instructions: 'string',
26+
description: 'description',
27+
instructions: 'instructions',
2828
metadata: {},
29-
name: 'string',
29+
name: 'name',
3030
response_format: 'none',
3131
temperature: 1,
3232
tool_resources: {
@@ -44,7 +44,7 @@ describe('resource assistants', () => {
4444
});
4545

4646
test('retrieve', async () => {
47-
const responsePromise = openai.beta.assistants.retrieve('string');
47+
const responsePromise = openai.beta.assistants.retrieve('assistant_id');
4848
const rawResponse = await responsePromise.asResponse();
4949
expect(rawResponse).toBeInstanceOf(Response);
5050
const response = await responsePromise;
@@ -57,12 +57,12 @@ describe('resource assistants', () => {
5757
test('retrieve: request options instead of params are passed correctly', async () => {
5858
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
5959
await expect(
60-
openai.beta.assistants.retrieve('string', { path: '/_stainless_unknown_path' }),
60+
openai.beta.assistants.retrieve('assistant_id', { path: '/_stainless_unknown_path' }),
6161
).rejects.toThrow(OpenAI.NotFoundError);
6262
});
6363

6464
test('update', async () => {
65-
const responsePromise = openai.beta.assistants.update('string', {});
65+
const responsePromise = openai.beta.assistants.update('assistant_id', {});
6666
const rawResponse = await responsePromise.asResponse();
6767
expect(rawResponse).toBeInstanceOf(Response);
6868
const response = await responsePromise;
@@ -94,14 +94,14 @@ describe('resource assistants', () => {
9494
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
9595
await expect(
9696
openai.beta.assistants.list(
97-
{ after: 'string', before: 'string', limit: 0, order: 'asc' },
97+
{ after: 'after', before: 'before', limit: 0, order: 'asc' },
9898
{ path: '/_stainless_unknown_path' },
9999
),
100100
).rejects.toThrow(OpenAI.NotFoundError);
101101
});
102102

103103
test('del', async () => {
104-
const responsePromise = openai.beta.assistants.del('string');
104+
const responsePromise = openai.beta.assistants.del('assistant_id');
105105
const rawResponse = await responsePromise.asResponse();
106106
expect(rawResponse).toBeInstanceOf(Response);
107107
const response = await responsePromise;
@@ -113,8 +113,8 @@ describe('resource assistants', () => {
113113

114114
test('del: request options instead of params are passed correctly', async () => {
115115
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
116-
await expect(openai.beta.assistants.del('string', { path: '/_stainless_unknown_path' })).rejects.toThrow(
117-
OpenAI.NotFoundError,
118-
);
116+
await expect(
117+
openai.beta.assistants.del('assistant_id', { path: '/_stainless_unknown_path' }),
118+
).rejects.toThrow(OpenAI.NotFoundError);
119119
});
120120
});

tests/api-resources/beta/threads/messages.test.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const openai = new OpenAI({
1010

1111
describe('resource messages', () => {
1212
test('create: only required params', async () => {
13-
const responsePromise = openai.beta.threads.messages.create('string', {
13+
const responsePromise = openai.beta.threads.messages.create('thread_id', {
1414
content: 'string',
1515
role: 'user',
1616
});
@@ -24,20 +24,20 @@ describe('resource messages', () => {
2424
});
2525

2626
test('create: required and optional params', async () => {
27-
const response = await openai.beta.threads.messages.create('string', {
27+
const response = await openai.beta.threads.messages.create('thread_id', {
2828
content: 'string',
2929
role: 'user',
3030
attachments: [
3131
{
32-
file_id: 'string',
32+
file_id: 'file_id',
3333
tools: [{ type: 'code_interpreter' }, { type: 'code_interpreter' }, { type: 'code_interpreter' }],
3434
},
3535
{
36-
file_id: 'string',
36+
file_id: 'file_id',
3737
tools: [{ type: 'code_interpreter' }, { type: 'code_interpreter' }, { type: 'code_interpreter' }],
3838
},
3939
{
40-
file_id: 'string',
40+
file_id: 'file_id',
4141
tools: [{ type: 'code_interpreter' }, { type: 'code_interpreter' }, { type: 'code_interpreter' }],
4242
},
4343
],
@@ -46,7 +46,7 @@ describe('resource messages', () => {
4646
});
4747

4848
test('retrieve', async () => {
49-
const responsePromise = openai.beta.threads.messages.retrieve('string', 'string');
49+
const responsePromise = openai.beta.threads.messages.retrieve('thread_id', 'message_id');
5050
const rawResponse = await responsePromise.asResponse();
5151
expect(rawResponse).toBeInstanceOf(Response);
5252
const response = await responsePromise;
@@ -59,12 +59,12 @@ describe('resource messages', () => {
5959
test('retrieve: request options instead of params are passed correctly', async () => {
6060
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
6161
await expect(
62-
openai.beta.threads.messages.retrieve('string', 'string', { path: '/_stainless_unknown_path' }),
62+
openai.beta.threads.messages.retrieve('thread_id', 'message_id', { path: '/_stainless_unknown_path' }),
6363
).rejects.toThrow(OpenAI.NotFoundError);
6464
});
6565

6666
test('update', async () => {
67-
const responsePromise = openai.beta.threads.messages.update('string', 'string', {});
67+
const responsePromise = openai.beta.threads.messages.update('thread_id', 'message_id', {});
6868
const rawResponse = await responsePromise.asResponse();
6969
expect(rawResponse).toBeInstanceOf(Response);
7070
const response = await responsePromise;
@@ -75,7 +75,7 @@ describe('resource messages', () => {
7575
});
7676

7777
test('list', async () => {
78-
const responsePromise = openai.beta.threads.messages.list('string');
78+
const responsePromise = openai.beta.threads.messages.list('thread_id');
7979
const rawResponse = await responsePromise.asResponse();
8080
expect(rawResponse).toBeInstanceOf(Response);
8181
const response = await responsePromise;
@@ -88,23 +88,23 @@ describe('resource messages', () => {
8888
test('list: request options instead of params are passed correctly', async () => {
8989
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
9090
await expect(
91-
openai.beta.threads.messages.list('string', { path: '/_stainless_unknown_path' }),
91+
openai.beta.threads.messages.list('thread_id', { path: '/_stainless_unknown_path' }),
9292
).rejects.toThrow(OpenAI.NotFoundError);
9393
});
9494

9595
test('list: request options and params are passed correctly', async () => {
9696
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
9797
await expect(
9898
openai.beta.threads.messages.list(
99-
'string',
100-
{ after: 'string', before: 'string', limit: 0, order: 'asc', run_id: 'string' },
99+
'thread_id',
100+
{ after: 'after', before: 'before', limit: 0, order: 'asc', run_id: 'run_id' },
101101
{ path: '/_stainless_unknown_path' },
102102
),
103103
).rejects.toThrow(OpenAI.NotFoundError);
104104
});
105105

106106
test('del', async () => {
107-
const responsePromise = openai.beta.threads.messages.del('string', 'string');
107+
const responsePromise = openai.beta.threads.messages.del('thread_id', 'message_id');
108108
const rawResponse = await responsePromise.asResponse();
109109
expect(rawResponse).toBeInstanceOf(Response);
110110
const response = await responsePromise;
@@ -117,7 +117,7 @@ describe('resource messages', () => {
117117
test('del: request options instead of params are passed correctly', async () => {
118118
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
119119
await expect(
120-
openai.beta.threads.messages.del('string', 'string', { path: '/_stainless_unknown_path' }),
120+
openai.beta.threads.messages.del('thread_id', 'message_id', { path: '/_stainless_unknown_path' }),
121121
).rejects.toThrow(OpenAI.NotFoundError);
122122
});
123123
});

0 commit comments

Comments
 (0)