File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const configuration = new Configuration({
22
22
});
23
23
const openai = new OpenAIApi (configuration);
24
24
25
- const completion = await openai .createCompletion (" davinci" , {
25
+ const completion = await openai .createCompletion (" text- davinci-001 " , {
26
26
prompt: " Hello world" ,
27
27
});
28
28
console .log (completion .data .choices [0 ].text );
@@ -37,10 +37,9 @@ All of the available API request functions additionally contain an optional fina
37
37
38
38
``` javascript
39
39
const completion = await openai .createCompletion (
40
- " davinci" ,
40
+ " text- davinci-001 " ,
41
41
{
42
- prompt: " Once upon a time" ,
43
- max_tokens: 5 ,
42
+ prompt: " Hello world" ,
44
43
},
45
44
{
46
45
timeout: 1000 ,
@@ -57,7 +56,7 @@ API requests can potentially return errors due to invalid inputs or other issues
57
56
58
57
``` javascript
59
58
try {
60
- const completion = await openai .createCompletion (" davinci" , {
59
+ const completion = await openai .createCompletion (" text- davinci-001 " , {
61
60
prompt: " Hello world" ,
62
61
});
63
62
console .log (completion .data .choices [0 ].text );
You can’t perform that action at this time.
0 commit comments