Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevnayak committed Jan 20, 2022
1 parent b0f0c6e commit a963425
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const configuration = new Configuration({
});
const openai = new OpenAIApi(configuration);

const completion = await openai.createCompletion("davinci", {
const completion = await openai.createCompletion("text-davinci-001", {
prompt: "Hello world",
});
console.log(completion.data.choices[0].text);
Expand All @@ -37,10 +37,9 @@ All of the available API request functions additionally contain an optional fina

```javascript
const completion = await openai.createCompletion(
"davinci",
"text-davinci-001",
{
prompt: "Once upon a time",
max_tokens: 5,
prompt: "Hello world",
},
{
timeout: 1000,
Expand All @@ -57,7 +56,7 @@ API requests can potentially return errors due to invalid inputs or other issues

```javascript
try {
const completion = await openai.createCompletion("davinci", {
const completion = await openai.createCompletion("text-davinci-001", {
prompt: "Hello world",
});
console.log(completion.data.choices[0].text);
Expand Down

0 comments on commit a963425

Please sign in to comment.