openai 3.0.1 → 3.2.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.
- package/.github/ISSUE_TEMPLATE/bug_report.yml +56 -0
- package/.github/ISSUE_TEMPLATE/config.yml +7 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +20 -0
- package/.github/workflows/test.yml +25 -0
- package/.openapi-generator/VERSION +1 -1
- package/README.md +9 -4
- package/api.ts +941 -41
- package/base.ts +5 -4
- package/common.ts +6 -4
- package/configuration.ts +1 -1
- package/dist/api.d.ts +606 -32
- package/dist/api.js +557 -6
- package/dist/base.d.ts +3 -4
- package/dist/base.js +1 -3
- package/dist/common.d.ts +4 -4
- package/dist/common.js +3 -1
- package/dist/configuration.d.ts +1 -1
- package/dist/configuration.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/index.ts +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Create a report to help us improve
|
|
3
|
+
labels: ["bug"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Thanks for taking the time to fill out this bug report!
|
|
9
|
+
- type: textarea
|
|
10
|
+
id: what-happened
|
|
11
|
+
attributes:
|
|
12
|
+
label: Describe the bug
|
|
13
|
+
description: A clear and concise description of what the bug is, and any additional context.
|
|
14
|
+
placeholder: Tell us what you see!
|
|
15
|
+
validations:
|
|
16
|
+
required: true
|
|
17
|
+
- type: textarea
|
|
18
|
+
id: repro-steps
|
|
19
|
+
attributes:
|
|
20
|
+
label: To Reproduce
|
|
21
|
+
description: Steps to reproduce the behavior.
|
|
22
|
+
placeholder: |
|
|
23
|
+
1. Fetch a '...'
|
|
24
|
+
2. Update the '....'
|
|
25
|
+
3. See error
|
|
26
|
+
validations:
|
|
27
|
+
required: true
|
|
28
|
+
- type: textarea
|
|
29
|
+
id: code-snippets
|
|
30
|
+
attributes:
|
|
31
|
+
label: Code snippets
|
|
32
|
+
description: If applicable, add code snippets to help explain your problem.
|
|
33
|
+
render: JavaScript
|
|
34
|
+
validations:
|
|
35
|
+
required: false
|
|
36
|
+
- type: input
|
|
37
|
+
id: os
|
|
38
|
+
attributes:
|
|
39
|
+
label: OS
|
|
40
|
+
placeholder: macOS
|
|
41
|
+
validations:
|
|
42
|
+
required: true
|
|
43
|
+
- type: input
|
|
44
|
+
id: language-version
|
|
45
|
+
attributes:
|
|
46
|
+
label: Node version
|
|
47
|
+
placeholder: Node v16.14.2
|
|
48
|
+
validations:
|
|
49
|
+
required: true
|
|
50
|
+
- type: input
|
|
51
|
+
id: lib-version
|
|
52
|
+
attributes:
|
|
53
|
+
label: Library version
|
|
54
|
+
placeholder: openai v3.0.1
|
|
55
|
+
validations:
|
|
56
|
+
required: true
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: OpenAI support
|
|
4
|
+
url: https://help.openai.com/
|
|
5
|
+
about: |
|
|
6
|
+
Please only file issues here that you believe represent actual bugs or feature requests for the OpenAI Node library.
|
|
7
|
+
If you're having general trouble with the OpenAI API, please visit our help center to get support.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Suggest an idea for this library
|
|
3
|
+
labels: ["feature-request"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Thanks for taking the time to fill out this feature request!
|
|
9
|
+
- type: textarea
|
|
10
|
+
id: feature
|
|
11
|
+
attributes:
|
|
12
|
+
label: Describe the feature or improvement you're requesting
|
|
13
|
+
description: A clear and concise description of what you want to happen.
|
|
14
|
+
validations:
|
|
15
|
+
required: true
|
|
16
|
+
- type: textarea
|
|
17
|
+
id: context
|
|
18
|
+
attributes:
|
|
19
|
+
label: Additional context
|
|
20
|
+
description: Add any other context about the feature request here.
|
|
@@ -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.
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
|