Skip to content

Commit 872da9c

Browse files
chore(examples): minor formatting changes (#491)
1 parent f66dd9b commit 872da9c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/api-resources/messages.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('resource messages', () => {
1212
test('create: only required params', async () => {
1313
const responsePromise = client.messages.create({
1414
max_tokens: 1024,
15-
messages: [{ role: 'user', content: 'Hello, world' }],
15+
messages: [{ content: 'Hello, world', role: 'user' }],
1616
model: 'claude-3-5-sonnet-20240620',
1717
});
1818
const rawResponse = await responsePromise.asResponse();
@@ -27,47 +27,47 @@ describe('resource messages', () => {
2727
test('create: required and optional params', async () => {
2828
const response = await client.messages.create({
2929
max_tokens: 1024,
30-
messages: [{ role: 'user', content: 'Hello, world' }],
30+
messages: [{ content: 'Hello, world', role: 'user' }],
3131
model: 'claude-3-5-sonnet-20240620',
3232
metadata: { user_id: '13803d75-b4b5-4c3e-b2a2-6f21399b021b' },
3333
stop_sequences: ['string', 'string', 'string'],
3434
stream: false,
35-
system: [{ type: 'text', text: "Today's date is 2024-06-01." }],
35+
system: [{ text: "Today's date is 2024-06-01.", type: 'text' }],
3636
temperature: 1,
3737
tool_choice: { type: 'auto' },
3838
tools: [
3939
{
40-
description: 'Get the current weather in a given location',
41-
name: 'x',
4240
input_schema: {
4341
type: 'object',
4442
properties: {
4543
location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' },
4644
unit: { description: 'Unit for the output - one of (celsius, fahrenheit)', type: 'string' },
4745
},
4846
},
47+
name: 'x',
48+
description: 'Get the current weather in a given location',
4949
},
5050
{
51-
description: 'Get the current weather in a given location',
52-
name: 'x',
5351
input_schema: {
5452
type: 'object',
5553
properties: {
5654
location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' },
5755
unit: { description: 'Unit for the output - one of (celsius, fahrenheit)', type: 'string' },
5856
},
5957
},
58+
name: 'x',
59+
description: 'Get the current weather in a given location',
6060
},
6161
{
62-
description: 'Get the current weather in a given location',
63-
name: 'x',
6462
input_schema: {
6563
type: 'object',
6664
properties: {
6765
location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' },
6866
unit: { description: 'Unit for the output - one of (celsius, fahrenheit)', type: 'string' },
6967
},
7068
},
69+
name: 'x',
70+
description: 'Get the current weather in a given location',
7171
},
7272
],
7373
top_k: 5,

0 commit comments

Comments
 (0)