@@ -10,7 +10,7 @@ const openai = new OpenAI({
10
10
11
11
describe ( 'resource messages' , ( ) => {
12
12
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 ' , {
14
14
content : 'string' ,
15
15
role : 'user' ,
16
16
} ) ;
@@ -24,20 +24,20 @@ describe('resource messages', () => {
24
24
} ) ;
25
25
26
26
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 ' , {
28
28
content : 'string' ,
29
29
role : 'user' ,
30
30
attachments : [
31
31
{
32
- file_id : 'string ' ,
32
+ file_id : 'file_id ' ,
33
33
tools : [ { type : 'code_interpreter' } , { type : 'code_interpreter' } , { type : 'code_interpreter' } ] ,
34
34
} ,
35
35
{
36
- file_id : 'string ' ,
36
+ file_id : 'file_id ' ,
37
37
tools : [ { type : 'code_interpreter' } , { type : 'code_interpreter' } , { type : 'code_interpreter' } ] ,
38
38
} ,
39
39
{
40
- file_id : 'string ' ,
40
+ file_id : 'file_id ' ,
41
41
tools : [ { type : 'code_interpreter' } , { type : 'code_interpreter' } , { type : 'code_interpreter' } ] ,
42
42
} ,
43
43
] ,
@@ -46,7 +46,7 @@ describe('resource messages', () => {
46
46
} ) ;
47
47
48
48
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 ' ) ;
50
50
const rawResponse = await responsePromise . asResponse ( ) ;
51
51
expect ( rawResponse ) . toBeInstanceOf ( Response ) ;
52
52
const response = await responsePromise ;
@@ -59,12 +59,12 @@ describe('resource messages', () => {
59
59
test ( 'retrieve: request options instead of params are passed correctly' , async ( ) => {
60
60
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
61
61
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' } ) ,
63
63
) . rejects . toThrow ( OpenAI . NotFoundError ) ;
64
64
} ) ;
65
65
66
66
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 ' , { } ) ;
68
68
const rawResponse = await responsePromise . asResponse ( ) ;
69
69
expect ( rawResponse ) . toBeInstanceOf ( Response ) ;
70
70
const response = await responsePromise ;
@@ -75,7 +75,7 @@ describe('resource messages', () => {
75
75
} ) ;
76
76
77
77
test ( 'list' , async ( ) => {
78
- const responsePromise = openai . beta . threads . messages . list ( 'string ' ) ;
78
+ const responsePromise = openai . beta . threads . messages . list ( 'thread_id ' ) ;
79
79
const rawResponse = await responsePromise . asResponse ( ) ;
80
80
expect ( rawResponse ) . toBeInstanceOf ( Response ) ;
81
81
const response = await responsePromise ;
@@ -88,23 +88,23 @@ describe('resource messages', () => {
88
88
test ( 'list: request options instead of params are passed correctly' , async ( ) => {
89
89
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
90
90
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' } ) ,
92
92
) . rejects . toThrow ( OpenAI . NotFoundError ) ;
93
93
} ) ;
94
94
95
95
test ( 'list: request options and params are passed correctly' , async ( ) => {
96
96
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
97
97
await expect (
98
98
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 ' } ,
101
101
{ path : '/_stainless_unknown_path' } ,
102
102
) ,
103
103
) . rejects . toThrow ( OpenAI . NotFoundError ) ;
104
104
} ) ;
105
105
106
106
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 ' ) ;
108
108
const rawResponse = await responsePromise . asResponse ( ) ;
109
109
expect ( rawResponse ) . toBeInstanceOf ( Response ) ;
110
110
const response = await responsePromise ;
@@ -117,7 +117,7 @@ describe('resource messages', () => {
117
117
test ( 'del: request options instead of params are passed correctly' , async ( ) => {
118
118
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
119
119
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' } ) ,
121
121
) . rejects . toThrow ( OpenAI . NotFoundError ) ;
122
122
} ) ;
123
123
} ) ;
0 commit comments