Skip to content

Commit 80dee2f

Browse files
chore: break long lines in snippets into multiline
1 parent a6f3dea commit 80dee2f

File tree

26 files changed

+352
-61
lines changed

26 files changed

+352
-61
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ await client.files.create({ file: fs.createReadStream('input.jsonl'), purpose: '
111111
await client.files.create({ file: new File(['my bytes'], 'input.jsonl'), purpose: 'fine-tune' });
112112

113113
// You can also pass a `fetch` `Response`:
114-
await client.files.create({ file: await fetch('https://somesite/input.jsonl'), purpose: 'fine-tune' });
114+
await client.files.create({
115+
file: await fetch('https://somesite/input.jsonl'),
116+
purpose: 'fine-tune',
117+
});
115118

116119
// Finally, if none of the above are convenient, you can use our `toFile` helper:
117120
await client.files.create({

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ describe('resource assistants', () => {
3434
file_search: {
3535
vector_store_ids: ['string'],
3636
vector_stores: [
37-
{ chunking_strategy: { type: 'auto' }, file_ids: ['string'], metadata: { foo: 'string' } },
37+
{
38+
chunking_strategy: { type: 'auto' },
39+
file_ids: ['string'],
40+
metadata: { foo: 'string' },
41+
},
3842
],
3943
},
4044
},
@@ -80,7 +84,12 @@ describe('resource assistants', () => {
8084
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
8185
await expect(
8286
client.beta.assistants.list(
83-
{ after: 'after', before: 'before', limit: 0, order: 'asc' },
87+
{
88+
after: 'after',
89+
before: 'before',
90+
limit: 0,
91+
order: 'asc',
92+
},
8493
{ path: '/_stainless_unknown_path' },
8594
),
8695
).rejects.toThrow(OpenAI.NotFoundError);

tests/api-resources/beta/chatkit/sessions.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ const client = new OpenAI({
99

1010
describe('resource sessions', () => {
1111
test('create: only required params', async () => {
12-
const responsePromise = client.beta.chatkit.sessions.create({ user: 'x', workflow: { id: 'id' } });
12+
const responsePromise = client.beta.chatkit.sessions.create({
13+
user: 'x',
14+
workflow: { id: 'id' },
15+
});
1316
const rawResponse = await responsePromise.asResponse();
1417
expect(rawResponse).toBeInstanceOf(Response);
1518
const response = await responsePromise;
@@ -30,7 +33,11 @@ describe('resource sessions', () => {
3033
},
3134
chatkit_configuration: {
3235
automatic_thread_titling: { enabled: true },
33-
file_upload: { enabled: true, max_file_size: 1, max_files: 1 },
36+
file_upload: {
37+
enabled: true,
38+
max_file_size: 1,
39+
max_files: 1,
40+
},
3441
history: { enabled: true, recent_threads: 1 },
3542
},
3643
expires_after: { anchor: 'created_at', seconds: 1 },

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ describe('resource threads', () => {
3434
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
3535
await expect(
3636
client.beta.chatkit.threads.list(
37-
{ after: 'after', before: 'before', limit: 0, order: 'asc', user: 'x' },
37+
{
38+
after: 'after',
39+
before: 'before',
40+
limit: 0,
41+
order: 'asc',
42+
user: 'x',
43+
},
3844
{ path: '/_stainless_unknown_path' },
3945
),
4046
).rejects.toThrow(OpenAI.NotFoundError);
@@ -67,7 +73,12 @@ describe('resource threads', () => {
6773
await expect(
6874
client.beta.chatkit.threads.listItems(
6975
'cthr_123',
70-
{ after: 'after', before: 'before', limit: 0, order: 'asc' },
76+
{
77+
after: 'after',
78+
before: 'before',
79+
limit: 0,
80+
order: 'asc',
81+
},
7182
{ path: '/_stainless_unknown_path' },
7283
),
7384
).rejects.toThrow(OpenAI.NotFoundError);

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ describe('resource messages', () => {
8080
await expect(
8181
client.beta.threads.messages.list(
8282
'thread_id',
83-
{ after: 'after', before: 'before', limit: 0, order: 'asc', run_id: 'run_id' },
83+
{
84+
after: 'after',
85+
before: 'before',
86+
limit: 0,
87+
order: 'asc',
88+
run_id: 'run_id',
89+
},
8490
{ path: '/_stainless_unknown_path' },
8591
),
8692
).rejects.toThrow(OpenAI.NotFoundError);

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,12 @@ describe('resource runs', () => {
9898
await expect(
9999
client.beta.threads.runs.list(
100100
'thread_id',
101-
{ after: 'after', before: 'before', limit: 0, order: 'asc' },
101+
{
102+
after: 'after',
103+
before: 'before',
104+
limit: 0,
105+
order: 'asc',
106+
},
102107
{ path: '/_stainless_unknown_path' },
103108
),
104109
).rejects.toThrow(OpenAI.NotFoundError);

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ describe('resource threads', () => {
3838
file_search: {
3939
vector_store_ids: ['string'],
4040
vector_stores: [
41-
{ chunking_strategy: { type: 'auto' }, file_ids: ['string'], metadata: { foo: 'string' } },
41+
{
42+
chunking_strategy: { type: 'auto' },
43+
file_ids: ['string'],
44+
metadata: { foo: 'string' },
45+
},
4246
],
4347
},
4448
},
@@ -119,7 +123,11 @@ describe('resource threads', () => {
119123
file_search: {
120124
vector_store_ids: ['string'],
121125
vector_stores: [
122-
{ chunking_strategy: { type: 'auto' }, file_ids: ['string'], metadata: { foo: 'string' } },
126+
{
127+
chunking_strategy: { type: 'auto' },
128+
file_ids: ['string'],
129+
metadata: { foo: 'string' },
130+
},
123131
],
124132
},
125133
},

tests/api-resources/chat/completions/completions.test.ts

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,24 @@ describe('resource completions', () => {
2424

2525
test('create: required and optional params', async () => {
2626
const response = await client.chat.completions.create({
27-
messages: [{ content: 'string', role: 'developer', name: 'name' }],
27+
messages: [
28+
{
29+
content: 'string',
30+
role: 'developer',
31+
name: 'name',
32+
},
33+
],
2834
model: 'gpt-4o',
2935
audio: { format: 'wav', voice: 'ash' },
3036
frequency_penalty: -2,
3137
function_call: 'none',
32-
functions: [{ name: 'name', description: 'description', parameters: { foo: 'bar' } }],
38+
functions: [
39+
{
40+
name: 'name',
41+
description: 'description',
42+
parameters: { foo: 'bar' },
43+
},
44+
],
3345
logit_bias: { foo: 0 },
3446
logprobs: true,
3547
max_completion_tokens: 0,
@@ -55,7 +67,12 @@ describe('resource completions', () => {
5567
tool_choice: 'none',
5668
tools: [
5769
{
58-
function: { name: 'name', description: 'description', parameters: { foo: 'bar' }, strict: true },
70+
function: {
71+
name: 'name',
72+
description: 'description',
73+
parameters: { foo: 'bar' },
74+
strict: true,
75+
},
5976
type: 'function',
6077
},
6178
],
@@ -66,7 +83,12 @@ describe('resource completions', () => {
6683
web_search_options: {
6784
search_context_size: 'low',
6885
user_location: {
69-
approximate: { city: 'city', country: 'country', region: 'region', timezone: 'timezone' },
86+
approximate: {
87+
city: 'city',
88+
country: 'country',
89+
region: 'region',
90+
timezone: 'timezone',
91+
},
7092
type: 'approximate',
7193
},
7294
},
@@ -114,7 +136,13 @@ describe('resource completions', () => {
114136
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
115137
await expect(
116138
client.chat.completions.list(
117-
{ after: 'after', limit: 0, metadata: { foo: 'string' }, model: 'model', order: 'asc' },
139+
{
140+
after: 'after',
141+
limit: 0,
142+
metadata: { foo: 'string' },
143+
model: 'model',
144+
order: 'asc',
145+
},
118146
{ path: '/_stainless_unknown_path' },
119147
),
120148
).rejects.toThrow(OpenAI.NotFoundError);

tests/api-resources/chat/completions/messages.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ describe('resource messages', () => {
2424
await expect(
2525
client.chat.completions.messages.list(
2626
'completion_id',
27-
{ after: 'after', limit: 0, order: 'asc' },
27+
{
28+
after: 'after',
29+
limit: 0,
30+
order: 'asc',
31+
},
2832
{ path: '/_stainless_unknown_path' },
2933
),
3034
).rejects.toThrow(OpenAI.NotFoundError);

tests/api-resources/containers/containers.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ describe('resource containers', () => {
5454
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
5555
await expect(
5656
client.containers.list(
57-
{ after: 'after', limit: 0, order: 'asc' },
57+
{
58+
after: 'after',
59+
limit: 0,
60+
order: 'asc',
61+
},
5862
{ path: '/_stainless_unknown_path' },
5963
),
6064
).rejects.toThrow(OpenAI.NotFoundError);

0 commit comments

Comments
 (0)