Skip to content

Commit

Permalink
Merge pull request #313 from openai/release-please--branches--master-…
Browse files Browse the repository at this point in the history
…-changes--next--components--openai
  • Loading branch information
athyuttamre authored Sep 15, 2023
2 parents dfd302c + e7d2d40 commit f52b3f5
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.7.0"
".": "4.7.1"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 4.7.1 (2023-09-15)

Full Changelog: [v4.7.0...v4.7.1](https://github.com/openai/openai-node/compare/v4.7.0...v4.7.1)

### Documentation

* declare Bun 1.0 officially supported ([#314](https://github.com/openai/openai-node/issues/314)) ([a16e268](https://github.com/openai/openai-node/commit/a16e26863390235cb43e2fe0e569298a4f84c32f))

## 4.7.0 (2023-09-14)

Full Changelog: [v4.6.0...v4.7.0](https://github.com/openai/openai-node/compare/v4.6.0...v4.7.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ The following runtimes are supported:

- Node.js 16 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
- Deno v1.28.0 or higher, using `import OpenAI from "npm:openai"`.
Deno Deploy is not yet supported.
- Bun 1.0 or later.
- Cloudflare Workers.
- Vercel Edge Runtime.

Expand Down
2 changes: 0 additions & 2 deletions ecosystem-tests/bun/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ To run:
```bash
bun run index.ts
```

This project was created using `bun init` in bun v0.6.3. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
14 changes: 7 additions & 7 deletions ecosystem-tests/bun/openai.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ test(`streaming works`, async function () {

// @ts-ignore avoid DOM lib for testing purposes
if (typeof File !== 'undefined') {
test.todo('handles builtinFile', async function () {
test('handles builtinFile', async function () {
const file = await fetch(url)
.then((x) => x.arrayBuffer())
// @ts-ignore avoid DOM lib for testing purposes
Expand All @@ -68,14 +68,14 @@ if (typeof File !== 'undefined') {
});
}

test.todo('handles Response', async function () {
test('handles Response', async function () {
const file = await fetch(url);

const result = await client.audio.transcriptions.create({ file, model });
expectSimilar(result.text, correctAnswer, 12);
});

test.todo('handles fs.ReadStream', async function () {
test('handles fs.ReadStream', async function () {
const result = await client.audio.transcriptions.create({
file: fs.createReadStream('sample1.mp3'),
model,
Expand All @@ -87,7 +87,7 @@ const fineTune = `{"prompt": "<prompt text>", "completion": "<ideal generated te

// @ts-ignore avoid DOM lib for testing purposes
if (typeof Blob !== 'undefined') {
test.todo('toFile handles builtin Blob', async function () {
test('toFile handles builtin Blob', async function () {
const result = await client.files.create({
file: await toFile(
// @ts-ignore avoid DOM lib for testing purposes
Expand All @@ -99,7 +99,7 @@ if (typeof Blob !== 'undefined') {
expect(result.status).toEqual('uploaded');
});
}
test.todo('toFile handles Uint8Array', async function () {
test('toFile handles Uint8Array', async function () {
const result = await client.files.create({
file: await toFile(
// @ts-ignore avoid DOM lib for testing purposes
Expand All @@ -110,7 +110,7 @@ test.todo('toFile handles Uint8Array', async function () {
});
expect(result.status).toEqual('uploaded');
});
test.todo('toFile handles ArrayBuffer', async function () {
test('toFile handles ArrayBuffer', async function () {
const result = await client.files.create({
file: await toFile(
// @ts-ignore avoid DOM lib for testing purposes
Expand All @@ -121,7 +121,7 @@ test.todo('toFile handles ArrayBuffer', async function () {
});
expect(result.status).toEqual('uploaded');
});
test.todo('toFile handles DataView', async function () {
test('toFile handles DataView', async function () {
const result = await client.files.create({
file: await toFile(
// @ts-ignore avoid DOM lib for testing purposes
Expand Down
3 changes: 3 additions & 0 deletions ecosystem-tests/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "openai-bun-test",
"module": "index.ts",
"type": "module",
"engines": {
"bun": ">=1.0.0"
},
"scripts": {
"tsc": "tsc"
},
Expand Down
Binary file added ecosystem-tests/bun/sample1.mp3
Binary file not shown.
37 changes: 36 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openai",
"version": "4.7.0",
"version": "4.7.1",
"description": "Client library for the OpenAI API",
"author": "OpenAI <[email protected]>",
"types": "dist/index.d.ts",
Expand All @@ -10,6 +10,41 @@
"license": "Apache-2.0",
"private": false,
"exports": {
"./_shims/node-readable": {
"deno": {
"types": "./dist/_shims/node-readable.d.ts",
"require": "./dist/_shims/node-readable.js",
"default": "./dist/_shims/node-readable.mjs"
},
"bun": {
"types": "./dist/_shims/node-readable-node.d.ts",
"require": "./dist/_shims/node-readable-node.js",
"default": "./dist/_shims/node-readable-node.mjs"
},
"browser": {
"types": "./dist/_shims/node-readable.d.ts",
"require": "./dist/_shims/node-readable.js",
"default": "./dist/_shims/node-readable.mjs"
},
"worker": {
"types": "./dist/_shims/node-readable.d.ts",
"require": "./dist/_shims/node-readable.js",
"default": "./dist/_shims/node-readable.mjs"
},
"workerd": {
"types": "./dist/_shims/node-readable.d.ts",
"require": "./dist/_shims/node-readable.js",
"default": "./dist/_shims/node-readable.mjs"
},
"node": {
"types": "./dist/_shims/node-readable-node.d.ts",
"require": "./dist/_shims/node-readable-node.js",
"default": "./dist/_shims/node-readable-node.mjs"
},
"types": "./dist/_shims/node-readable.d.ts",
"require": "./dist/_shims/node-readable.js",
"default": "./dist/_shims/node-readable.mjs"
},
"./_shims/*": {
"deno": {
"types": "./dist/_shims/*.d.ts",
Expand Down
1 change: 1 addition & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"pull-request-header": "Automated Release PR",
"pull-request-title-pattern": "release: ${version}",
"changelog-sections": [
{
"type": "feat",
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '4.7.0'; // x-release-please-version
export const VERSION = '4.7.1'; // x-release-please-version

0 comments on commit f52b3f5

Please sign in to comment.