Skip to content

Commit 331eb4e

Browse files
authored
Merge pull request #277 from openai/release-please--branches--master--changes--next--components--openai
chore(next => master): release 4.5.0
2 parents dafdf63 + fbbe740 commit 331eb4e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+8155
-5321
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "4.4.0"
2+
".": "4.5.0"
33
}

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# Changelog
22

3+
## 4.5.0 (2023-09-06)
4+
5+
Full Changelog: [v4.4.0...v4.5.0](https://github.com/openai/openai-node/compare/v4.4.0...v4.5.0)
6+
7+
### Features
8+
9+
* **client:** add files.waitForProcessing() method ([#292](https://github.com/openai/openai-node/issues/292)) ([ef59010](https://github.com/openai/openai-node/commit/ef59010cab0c666fa8a437ec6e27800789aa8705))
10+
* fixes tests where an array has to have unique enum values ([#290](https://github.com/openai/openai-node/issues/290)) ([a10b895](https://github.com/openai/openai-node/commit/a10b8956b3eaae7cdcb90329a8386a41219ca021))
11+
* make docs more readable by eliminating unnecessary escape sequences ([#287](https://github.com/openai/openai-node/issues/287)) ([a068043](https://github.com/openai/openai-node/commit/a06804314d4815d420c97f6f965c926ea70d56df))
12+
13+
14+
### Bug Fixes
15+
16+
* **client:** fix TS errors that appear when users Go to Source in VSCode ([#281](https://github.com/openai/openai-node/issues/281)) ([8dc59bc](https://github.com/openai/openai-node/commit/8dc59bcf924cc991747ca475c714d915e04c6012)), closes [#249](https://github.com/openai/openai-node/issues/249)
17+
* **client:** handle case where the client is instantiated with a undefined baseURL ([#285](https://github.com/openai/openai-node/issues/285)) ([5095cf3](https://github.com/openai/openai-node/commit/5095cf340743e4627b4f0ad2f055ebe332824d23))
18+
* **client:** use explicit file extensions in _shims imports ([#276](https://github.com/openai/openai-node/issues/276)) ([16fe929](https://github.com/openai/openai-node/commit/16fe929688d35c2ebe52c8cf1c1570bafda5f97e))
19+
20+
21+
### Documentation
22+
23+
* **api:** update docstrings ([#286](https://github.com/openai/openai-node/issues/286)) ([664e953](https://github.com/openai/openai-node/commit/664e9532c8acfbf981e9a788ab40c111ebe2fda0))
24+
* **readme:** add link to api.md ([#291](https://github.com/openai/openai-node/issues/291)) ([0d1cce2](https://github.com/openai/openai-node/commit/0d1cce26cdc6567c10c8d72bbc72a788ffb8f2be))
25+
326
## 4.4.0 (2023-09-01)
427

528
Full Changelog: [v4.3.1...v4.4.0](https://github.com/openai/openai-node/compare/v4.3.1...v4.4.0)

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ yarn add openai
1818

1919
## Usage
2020

21-
The full API of this library can be found in [API.md file](https://github.com/openai/openai-node/blob/master/api.md). The code below shows how to get started using the chat completions API.
21+
The full API of this library can be found in [api.md file](https://github.com/openai/openai-node/blob/master/api.md). The code below shows how to get started using the chat completions API.
2222

2323
```js
2424
import OpenAI from 'openai';
@@ -39,9 +39,6 @@ async function main() {
3939
main();
4040
```
4141

42-
> [!IMPORTANT]
43-
> Previous versions of this SDK used a `Configuration` class. See the [v3 to v4 migration guide](https://github.com/openai/openai-node/discussions/217).
44-
4542
## Streaming Responses
4643

4744
We provide support for streaming responses using Server Sent Events (SSE).
@@ -92,6 +89,9 @@ main();
9289

9390
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
9491

92+
> [!IMPORTANT]
93+
> Previous versions of this SDK used a `Configuration` class. See the [v3 to v4 migration guide](https://github.com/openai/openai-node/discussions/217).
94+
9595
## File Uploads
9696

9797
Request parameters that correspond to file uploads can be passed in many different forms:
@@ -309,6 +309,8 @@ We are keen for your feedback; please open an [issue](https://www.github.com/ope
309309

310310
## Requirements
311311

312+
TypeScript >= 4.5 is supported.
313+
312314
The following runtimes are supported:
313315

314316
- Node.js 16 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Methods:
6262
- <code title="get /files">client.files.<a href="./src/resources/files.ts">list</a>() -> FileObjectsPage</code>
6363
- <code title="delete /files/{file_id}">client.files.<a href="./src/resources/files.ts">del</a>(fileId) -> FileDeleted</code>
6464
- <code title="get /files/{file_id}/content">client.files.<a href="./src/resources/files.ts">retrieveContent</a>(fileId) -> string</code>
65+
- <code>client.files.<a href="./src/resources/files.ts">waitForProcessing</a>(id, { pollInterval = 5000, maxWait = 30 _ 60 _ 1000 }) -> Promise&lt;FileObject&gt;</code>
6566

6667
# Images
6768

build

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ rm -rf dist; mkdir dist
1212
# Copy src to dist/src and build from dist/src into dist, so that
1313
# the source map for index.js.map will refer to ./src/index.ts etc
1414
cp -rp src README.md dist
15+
rm dist/src/_shims/*-deno.*
1516
for file in LICENSE CHANGELOG.md; do
1617
if [ -e "${file}" ]; then cp "${file}" dist; fi
1718
done
@@ -37,14 +38,14 @@ node scripts/fix-index-exports.cjs
3738
# index.d.mts the default import will work (even though both files have
3839
# the same export default statement)
3940
cp dist/index.d.ts dist/index.d.mts
40-
41-
SED=(sed -i)
42-
if [[ "$OSTYPE" == "darwin"* ]]; then SED=(sed -i ''); fi
41+
cp tsconfig.dist-src.json dist/src/tsconfig.json
4342

4443
# strip out lib="dom" and types="node" references; these are needed at build time,
4544
# but would pollute the user's TS environment
46-
REFERENCE_SUBS='s/^ *\/\/\/ *<reference *lib="dom".*//g;s/^ *\/\/\/ *<reference *types="node".*//g'
47-
find dist -type f -exec "${SED[@]}" "${REFERENCE_SUBS}" {} +
45+
find dist -type f -exec node scripts/remove-triple-slash-references.js {} +
46+
# strip out `unknown extends RequestInit ? never :` from dist/src/_shims;
47+
# these cause problems when viewing the .ts source files in go to definition
48+
find dist/src/_shims -type f -exec node scripts/replace-shim-guards.js {} +
4849

4950
npm exec prettier -- --loglevel=warn --write .
5051

ecosystem-tests/bun/bun.lockb

384 Bytes
Binary file not shown.

ecosystem-tests/bun/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"devDependencies": {
99
"fastest-levenshtein": "^1.0.16",
1010
"bun-types": "latest",
11-
"typescript": "^5.1.0"
11+
"typescript": "5.0.4"
1212
}
1313
}

ecosystem-tests/cli.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ const projects = {
4848
await run('npm', ['test']);
4949
}
5050
},
51+
'node-ts-cjs-ts4.5': async () => {
52+
await installPackage();
53+
await run('npm', ['run', 'tsc']);
54+
},
5155
'node-ts-cjs-dom': async () => {
5256
await installPackage();
5357
await run('npm', ['run', 'tsc']);
@@ -296,8 +300,7 @@ async function withRetry(fn: () => Promise<void>, identifier: string, retryAmoun
296300
try {
297301
return await fn();
298302
} catch (err) {
299-
retryAmount--;
300-
if (retryAmount === 0) throw err;
303+
if (--retryAmount <= 0) throw err;
301304
console.error(`${identifier} failed due to ${err}; retries left ${retryAmount}`);
302305
}
303306
} while (retryAmount > 0);

0 commit comments

Comments
 (0)