File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,15 @@ const openai = new OpenAI();
7
7
8
8
async function main ( ) {
9
9
// Explicit non streaming params type:
10
- const params : OpenAI . Chat . CompletionCreateParams = {
10
+ const params : OpenAI . Chat . ChatCompletionCreateParams = {
11
11
model : 'gpt-4' ,
12
12
messages : [ { role : 'user' , content : 'Say this is a test!' } ] ,
13
13
} ;
14
14
const completion = await openai . chat . completions . create ( params ) ;
15
15
console . log ( completion . choices [ 0 ] ?. message ?. content ) ;
16
16
17
17
// Explicit streaming params type:
18
- const streaming_params : OpenAI . Chat . CompletionCreateParams = {
18
+ const streaming_params : OpenAI . Chat . ChatCompletionCreateParams = {
19
19
model : 'gpt-4' ,
20
20
messages : [ { role : 'user' , content : 'Say this is a test!' } ] ,
21
21
stream : true ,
You can’t perform that action at this time.
0 commit comments