openai 2.0.5 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 5.4.0
1
+ 6.0.0
package/README.md CHANGED
@@ -22,7 +22,8 @@ const configuration = new Configuration({
22
22
  });
23
23
  const openai = new OpenAIApi(configuration);
24
24
 
25
- const completion = await openai.createCompletion("text-davinci-001", {
25
+ const completion = await openai.createCompletion({
26
+ model: "text-davinci-002",
26
27
  prompt: "Hello world",
27
28
  });
28
29
  console.log(completion.data.choices[0].text);
@@ -37,8 +38,8 @@ All of the available API request functions additionally contain an optional fina
37
38
 
38
39
  ```javascript
39
40
  const completion = await openai.createCompletion(
40
- "text-davinci-001",
41
41
  {
42
+ model: "text-davinci-002",
42
43
  prompt: "Hello world",
43
44
  },
44
45
  {
@@ -56,7 +57,8 @@ API requests can potentially return errors due to invalid inputs or other issues
56
57
 
57
58
  ```javascript
58
59
  try {
59
- const completion = await openai.createCompletion("text-davinci-001", {
60
+ const completion = await openai.createCompletion({
61
+ model: "text-davinci-002",
60
62
  prompt: "Hello world",
61
63
  });
62
64
  console.log(completion.data.choices[0].text);
@@ -70,6 +72,14 @@ try {
70
72
  }
71
73
  ```
72
74
 
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
+
73
83
  ## Thanks
74
84
 
75
85
  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).