openai 4.9.0 → 4.9.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.
- package/CHANGELOG.md +8 -0
- package/README.md +9 -9
- package/package.json +1 -1
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.9.1 (2023-09-21)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v4.9.0...v4.9.1](https://github.com/openai/openai-node/compare/v4.9.0...v4.9.1)
|
|
6
|
+
|
|
7
|
+
### Documentation
|
|
8
|
+
|
|
9
|
+
* **README:** fix variable names in some examples ([#327](https://github.com/openai/openai-node/issues/327)) ([5e05b31](https://github.com/openai/openai-node/commit/5e05b31c132545ce166cea92c5f3e4410fd40711))
|
|
10
|
+
|
|
3
11
|
## 4.9.0 (2023-09-20)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v4.8.0...v4.9.0](https://github.com/openai/openai-node/compare/v4.8.0...v4.9.0)
|
package/README.md
CHANGED
|
@@ -28,12 +28,12 @@ const openai = new OpenAI({
|
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
async function main() {
|
|
31
|
-
const
|
|
31
|
+
const chatCompletion = await openai.chat.completions.create({
|
|
32
32
|
messages: [{ role: 'user', content: 'Say this is a test' }],
|
|
33
33
|
model: 'gpt-3.5-turbo',
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
console.log(
|
|
36
|
+
console.log(chatCompletion.choices);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
main();
|
|
@@ -81,7 +81,7 @@ async function main() {
|
|
|
81
81
|
messages: [{ role: 'user', content: 'Say this is a test' }],
|
|
82
82
|
model: 'gpt-3.5-turbo',
|
|
83
83
|
};
|
|
84
|
-
const
|
|
84
|
+
const chatCompletion: OpenAI.Chat.ChatCompletion = await openai.chat.completions.create(params);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
main();
|
|
@@ -226,8 +226,8 @@ You can use `for await … of` syntax to iterate through items across all pages:
|
|
|
226
226
|
async function fetchAllFineTuningJobs(params) {
|
|
227
227
|
const allFineTuningJobs = [];
|
|
228
228
|
// Automatically fetches more pages as needed.
|
|
229
|
-
for await (const
|
|
230
|
-
allFineTuningJobs.push(
|
|
229
|
+
for await (const fineTuningJob of openai.fineTuning.jobs.list({ limit: 20 })) {
|
|
230
|
+
allFineTuningJobs.push(fineTuningJob);
|
|
231
231
|
}
|
|
232
232
|
return allFineTuningJobs;
|
|
233
233
|
}
|
|
@@ -237,8 +237,8 @@ Alternatively, you can make request a single page at a time:
|
|
|
237
237
|
|
|
238
238
|
```ts
|
|
239
239
|
let page = await openai.fineTuning.jobs.list({ limit: 20 });
|
|
240
|
-
for (const
|
|
241
|
-
console.log(
|
|
240
|
+
for (const fineTuningJob of page.data) {
|
|
241
|
+
console.log(fineTuningJob);
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
// Convenience methods are provided for manually paginating:
|
|
@@ -265,11 +265,11 @@ const response = await openai.chat.completions
|
|
|
265
265
|
console.log(response.headers.get('X-My-Header'));
|
|
266
266
|
console.log(response.statusText); // access the underlying Response object
|
|
267
267
|
|
|
268
|
-
const { data:
|
|
268
|
+
const { data: chatCompletion, response: raw } = await openai.chat.completions
|
|
269
269
|
.create({ messages: [{ role: 'user', content: 'Say this is a test' }], model: 'gpt-3.5-turbo' })
|
|
270
270
|
.withResponse();
|
|
271
271
|
console.log(raw.headers.get('X-My-Header'));
|
|
272
|
-
console.log(
|
|
272
|
+
console.log(chatCompletion.choices);
|
|
273
273
|
```
|
|
274
274
|
|
|
275
275
|
## Configuring an HTTP(S) Agent (e.g., for proxies)
|
package/package.json
CHANGED
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '4.9.
|
|
1
|
+
export const VERSION = '4.9.1'; // x-release-please-version
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "4.9.
|
|
1
|
+
export declare const VERSION = "4.9.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '4.9.
|
|
1
|
+
export const VERSION = '4.9.1'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|