openai 3.1.0 → 3.2.1

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.
@@ -0,0 +1,25 @@
1
+ name: Node.js CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ build:
11
+
12
+ runs-on: ubuntu-latest
13
+
14
+ strategy:
15
+ matrix:
16
+ node-version: [16.x, 18.x]
17
+ steps:
18
+ - uses: actions/checkout@v3
19
+ - name: Use Node.js ${{ matrix.node-version }}
20
+ uses: actions/setup-node@v3
21
+ with:
22
+ node-version: ${{ matrix.node-version }}
23
+ cache: 'npm'
24
+ - run: npm ci
25
+ - run: npm run build
@@ -1 +1 @@
1
- 6.2.1
1
+ 6.4.0
package/README.md CHANGED
@@ -23,7 +23,7 @@ const configuration = new Configuration({
23
23
  const openai = new OpenAIApi(configuration);
24
24
 
25
25
  const completion = await openai.createCompletion({
26
- model: "text-davinci-002",
26
+ model: "text-davinci-003",
27
27
  prompt: "Hello world",
28
28
  });
29
29
  console.log(completion.data.choices[0].text);
@@ -39,7 +39,7 @@ All of the available API request functions additionally contain an optional fina
39
39
  ```javascript
40
40
  const completion = await openai.createCompletion(
41
41
  {
42
- model: "text-davinci-002",
42
+ model: "text-davinci-003",
43
43
  prompt: "Hello world",
44
44
  },
45
45
  {
@@ -58,7 +58,7 @@ API requests can potentially return errors due to invalid inputs or other issues
58
58
  ```javascript
59
59
  try {
60
60
  const completion = await openai.createCompletion({
61
- model: "text-davinci-002",
61
+ model: "text-davinci-003",
62
62
  prompt: "Hello world",
63
63
  });
64
64
  console.log(completion.data.choices[0].text);
@@ -72,13 +72,18 @@ try {
72
72
  }
73
73
  ```
74
74
 
75
+ ### Streaming completions
76
+
77
+ Streaming completions (`stream=true`) are not natively supported in this package yet, but [a workaround exists](https://github.com/openai/openai-node/issues/18#issuecomment-1369996933) if needed.
78
+
75
79
  ## Upgrade guide
76
80
 
77
81
  All breaking changes for major version releases are listed below.
78
82
 
79
83
  ### 3.0.0
80
84
 
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, ... })`)
85
+ - 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-003", ... })`)
86
+ - Replace any `createCompletionFromModel(params)` calls with `createCompletion(params)`
82
87
 
83
88
  ## Thanks
84
89