We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 032cec6 + eea4632 commit c71e355Copy full SHA for c71e355
README.md
@@ -22,11 +22,11 @@ const configuration = new Configuration({
22
});
23
const openai = new OpenAIApi(configuration);
24
25
-const completion = await openai.createCompletion({
26
- model: "text-davinci-003",
27
- prompt: "Hello world",
+const chatCompletion = await openai.createChatCompletion({
+ model: "gpt-3.5-turbo",
+ messages: [{role: "user", content: "Hello world"}],
28
29
-console.log(completion.data.choices[0].text);
+console.log(chatCompletion.data.choices[0].message);
30
```
31
32
Check out the [full API documentation](https://platform.openai.com/docs/api-reference?lang=node.js) for examples of all the available functions.
0 commit comments