@@ -12,7 +12,7 @@ describe('resource messages', () => {
12
12
test ( 'create: only required params' , async ( ) => {
13
13
const responsePromise = client . messages . create ( {
14
14
max_tokens : 1024 ,
15
- messages : [ { role : 'user ' , content : 'Hello, world ' } ] ,
15
+ messages : [ { content : 'Hello, world ' , role : 'user ' } ] ,
16
16
model : 'claude-3-5-sonnet-20240620' ,
17
17
} ) ;
18
18
const rawResponse = await responsePromise . asResponse ( ) ;
@@ -27,47 +27,47 @@ describe('resource messages', () => {
27
27
test ( 'create: required and optional params' , async ( ) => {
28
28
const response = await client . messages . create ( {
29
29
max_tokens : 1024 ,
30
- messages : [ { role : 'user ' , content : 'Hello, world ' } ] ,
30
+ messages : [ { content : 'Hello, world ' , role : 'user ' } ] ,
31
31
model : 'claude-3-5-sonnet-20240620' ,
32
32
metadata : { user_id : '13803d75-b4b5-4c3e-b2a2-6f21399b021b' } ,
33
33
stop_sequences : [ 'string' , 'string' , 'string' ] ,
34
34
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' } ] ,
36
36
temperature : 1 ,
37
37
tool_choice : { type : 'auto' } ,
38
38
tools : [
39
39
{
40
- description : 'Get the current weather in a given location' ,
41
- name : 'x' ,
42
40
input_schema : {
43
41
type : 'object' ,
44
42
properties : {
45
43
location : { description : 'The city and state, e.g. San Francisco, CA' , type : 'string' } ,
46
44
unit : { description : 'Unit for the output - one of (celsius, fahrenheit)' , type : 'string' } ,
47
45
} ,
48
46
} ,
47
+ name : 'x' ,
48
+ description : 'Get the current weather in a given location' ,
49
49
} ,
50
50
{
51
- description : 'Get the current weather in a given location' ,
52
- name : 'x' ,
53
51
input_schema : {
54
52
type : 'object' ,
55
53
properties : {
56
54
location : { description : 'The city and state, e.g. San Francisco, CA' , type : 'string' } ,
57
55
unit : { description : 'Unit for the output - one of (celsius, fahrenheit)' , type : 'string' } ,
58
56
} ,
59
57
} ,
58
+ name : 'x' ,
59
+ description : 'Get the current weather in a given location' ,
60
60
} ,
61
61
{
62
- description : 'Get the current weather in a given location' ,
63
- name : 'x' ,
64
62
input_schema : {
65
63
type : 'object' ,
66
64
properties : {
67
65
location : { description : 'The city and state, e.g. San Francisco, CA' , type : 'string' } ,
68
66
unit : { description : 'Unit for the output - one of (celsius, fahrenheit)' , type : 'string' } ,
69
67
} ,
70
68
} ,
69
+ name : 'x' ,
70
+ description : 'Get the current weather in a given location' ,
71
71
} ,
72
72
] ,
73
73
top_k : 5 ,
0 commit comments