Skip to content

Commit d758def

Browse files
Merge pull request #1529 from openai/release-please--branches--master--changes--next--components--openai
release: 5.1.1
2 parents b7d5408 + 1649e58 commit d758def

17 files changed

+70
-62
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-
".": "5.1.0"
2+
".": "5.1.1"
33
}

CHANGELOG.md

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

3+
## 5.1.1 (2025-06-05)
4+
5+
Full Changelog: [v5.1.0...v5.1.1](https://github.com/openai/openai-node/compare/v5.1.0...v5.1.1)
6+
7+
### Bug Fixes
8+
9+
* **assistants:** handle thread.run.incomplete while streaming ([8f5e7f3](https://github.com/openai/openai-node/commit/8f5e7f3ffaad7bdd0424743eb68a63f918dbabb8))
10+
11+
12+
### Chores
13+
14+
* **docs:** use top-level-await in example snippets ([065d3b0](https://github.com/openai/openai-node/commit/065d3b08b29e10d7af58bb66816245f71f386833))
15+
* **internal:** fix readablestream types in node 20 ([771ae81](https://github.com/openai/openai-node/commit/771ae818c32d855778c3847d9005efb80b0a8cd5))
16+
317
## 5.1.0 (2025-06-03)
418

519
Full Changelog: [v5.0.2...v5.1.0](https://github.com/openai/openai-node/compare/v5.0.2...v5.1.0)

README.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -132,22 +132,18 @@ a subclass of `APIError` will be thrown:
132132

133133
<!-- prettier-ignore -->
134134
```ts
135-
async function main() {
136-
const job = await client.fineTuning.jobs
137-
.create({ model: 'gpt-4o', training_file: 'file-abc123' })
138-
.catch(async (err) => {
139-
if (err instanceof OpenAI.APIError) {
140-
console.log(err.request_id);
141-
console.log(err.status); // 400
142-
console.log(err.name); // BadRequestError
143-
console.log(err.headers); // {server: 'nginx', ...}
144-
} else {
145-
throw err;
146-
}
147-
});
148-
}
149-
150-
main();
135+
const job = await client.fineTuning.jobs
136+
.create({ model: 'gpt-4o', training_file: 'file-abc123' })
137+
.catch(async (err) => {
138+
if (err instanceof OpenAI.APIError) {
139+
console.log(err.request_id);
140+
console.log(err.status); // 400
141+
console.log(err.name); // BadRequestError
142+
console.log(err.headers); // {server: 'nginx', ...}
143+
} else {
144+
throw err;
145+
}
146+
});
151147
```
152148

153149
Error codes are as follows:

ecosystem-tests/cli.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -562,11 +562,6 @@ async function withChdir<R>(newDir: string, fn: () => Promise<R>): Promise<R> {
562562
}
563563
}
564564

565-
function checkNever(x: never, detail: any = x): never {
566-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
567-
throw new Error(`checkNever: impossible to call: ${detail}`);
568-
}
569-
570565
async function pathExists(path: string) {
571566
try {
572567
await fs.access(path);

ecosystem-tests/proxy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ async function startProxy() {
1919

2020
await new Promise<void>((resolve) => proxy.listen(0, '127.0.0.1', resolve));
2121

22-
console.log(proxy.address()!.toString())
22+
console.log(proxy.address()!.toString());
2323

2424
return () => {
25-
proxy.close()
26-
}
25+
proxy.close();
26+
};
2727
}

eslint.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default tseslint.config(
1010
parserOptions: { sourceType: 'module' },
1111
},
1212
files: ['**/*.ts', '**/*.mts', '**/*.cts', '**/*.js', '**/*.mjs', '**/*.cjs'],
13-
ignores: ['dist/', 'ecosystem-tests/'],
13+
ignores: ['dist/'],
1414
plugins: {
1515
'@typescript-eslint': tseslint.plugin,
1616
'unused-imports': unusedImports,
@@ -34,7 +34,7 @@ export default tseslint.config(
3434
},
3535
},
3636
{
37-
files: ['tests/**', 'examples/**'],
37+
files: ['tests/**', 'examples/**', 'ecosystem-tests/**'],
3838
rules: {
3939
'no-restricted-imports': 'off',
4040
},

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openai/openai",
3-
"version": "5.1.0",
3+
"version": "5.1.1",
44
"exports": {
55
".": "./index.ts",
66
"./helpers/zod": "./helpers/zod.ts",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openai",
3-
"version": "5.1.0",
3+
"version": "5.1.1",
44
"description": "The official TypeScript library for the OpenAI API",
55
"author": "OpenAI <[email protected]>",
66
"types": "dist/index.d.ts",

scripts/build

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ npm exec tsc-multi
3737
# when building .mjs
3838
node scripts/utils/fix-index-exports.cjs
3939
cp tsconfig.dist-src.json dist/src/tsconfig.json
40-
cp src/internal/shim-types.d.ts dist/internal/shim-types.d.ts
41-
cp src/internal/shim-types.d.ts dist/internal/shim-types.d.mts
4240

4341
node scripts/utils/postprocess-files.cjs
4442

scripts/lint

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ node scripts/utils/attw-report.cjs
1919

2020
echo "==> Running publint"
2121
./node_modules/.bin/publint dist
22+
echo "==> Running jsr publish --dry-run"
23+
(cd dist-deno && npx jsr publish --dry-run --allow-dirty)

0 commit comments

Comments
 (0)