Skip to content

Commit c732861

Browse files
authored
Update README.md
1 parent 8e3b68e commit c732861

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ const configuration = new Configuration({
2222
});
2323
const openai = new OpenAIApi(configuration);
2424

25-
const completion = await openai.createCompletion("text-davinci-001", {
25+
const completion = await openai.createCompletion({
26+
model: "text-davinci-002",
2627
prompt: "Hello world",
2728
});
2829
console.log(completion.data.choices[0].text);
@@ -37,8 +38,8 @@ All of the available API request functions additionally contain an optional fina
3738

3839
```javascript
3940
const completion = await openai.createCompletion(
40-
"text-davinci-001",
4141
{
42+
model: "text-davinci-002",
4243
prompt: "Hello world",
4344
},
4445
{
@@ -56,7 +57,8 @@ API requests can potentially return errors due to invalid inputs or other issues
5657

5758
```javascript
5859
try {
59-
const completion = await openai.createCompletion("text-davinci-001", {
60+
const completion = await openai.createCompletion({
61+
model: "text-davinci-002",
6062
prompt: "Hello world",
6163
});
6264
console.log(completion.data.choices[0].text);
@@ -70,6 +72,14 @@ try {
7072
}
7173
```
7274

75+
## Upgrade guide
76+
77+
All breaking changes for major version releases are listed below.
78+
79+
### 3.0.0
80+
81+
- The function signature of `createCompletion(engineId, params)` changed to `createCompletion(params)`. The value previously passed in as the `engineId` argument should now be passed in as `model` in the params object (e.g. `createCompletion({ model: "text-davinci-002, ... })`)
82+
7383
## Thanks
7484

7585
Thank you to [ceifa](https://github.com/ceifa) for creating and maintaining the original unofficial `openai` npm package before we released this official library! ceifa's original package has been renamed to [gpt-x](https://www.npmjs.com/package/gpt-x).

0 commit comments

Comments
 (0)