Skip to content

Commit ff0be7c

Browse files
Merge branch 'master' into use-undici
2 parents 473142e + 049ce6f commit ff0be7c

34 files changed

+102
-119
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.17.5"
2+
".": "4.19.0"
33
}

CHANGELOG.md

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

3+
## 4.19.0 (2023-11-15)
4+
5+
Full Changelog: [v4.18.0...v4.19.0](https://github.com/openai/openai-node/compare/v4.18.0...v4.19.0)
6+
7+
### Features
8+
9+
* **api:** updates ([#501](https://github.com/openai/openai-node/issues/501)) ([944d58e](https://github.com/openai/openai-node/commit/944d58e5fc46f1a0671aaa2b809d28e67edf6023))
10+
11+
## 4.18.0 (2023-11-14)
12+
13+
Full Changelog: [v4.17.5...v4.18.0](https://github.com/openai/openai-node/compare/v4.17.5...v4.18.0)
14+
15+
### Features
16+
17+
* **api:** add gpt-3.5-turbo-1106 ([#496](https://github.com/openai/openai-node/issues/496)) ([45f7672](https://github.com/openai/openai-node/commit/45f7672ccf4856ac309b08c6c96f0e73ab48b525))
18+
319
## 4.17.5 (2023-11-13)
420

521
Full Changelog: [v4.17.4...v4.17.5](https://github.com/openai/openai-node/compare/v4.17.4...v4.17.5)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ You can import in Deno via:
2121
<!-- x-release-please-start-version -->
2222

2323
```ts
24-
import OpenAI from 'https://deno.land/x/openai@v4.17.5/mod.ts';
24+
import OpenAI from 'https://deno.land/x/openai@v4.19.0/mod.ts';
2525
```
2626

2727
<!-- x-release-please-end -->

build-deno

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This is a build produced from https://github.com/openai/openai-node – please g
1414
Usage:
1515
1616
\`\`\`ts
17-
import OpenAI from "https://deno.land/x/openai@v4.17.5/mod.ts";
17+
import OpenAI from "https://deno.land/x/openai@v4.19.0/mod.ts";
1818
1919
const client = new OpenAI();
2020
\`\`\`

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": "4.17.5",
3+
"version": "4.19.0",
44
"description": "Client library for the OpenAI API",
55
"author": "OpenAI <support@openai.com>",
66
"types": "dist/index.d.ts",

src/core.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -562,27 +562,6 @@ export abstract class APIClient {
562562
}
563563
}
564564

565-
export class APIResource {
566-
protected client: APIClient;
567-
constructor(client: APIClient) {
568-
this.client = client;
569-
570-
this.get = client.get.bind(client);
571-
this.post = client.post.bind(client);
572-
this.patch = client.patch.bind(client);
573-
this.put = client.put.bind(client);
574-
this.delete = client.delete.bind(client);
575-
this.getAPIList = client.getAPIList.bind(client);
576-
}
577-
578-
protected get: APIClient['get'];
579-
protected post: APIClient['post'];
580-
protected patch: APIClient['patch'];
581-
protected put: APIClient['put'];
582-
protected delete: APIClient['delete'];
583-
protected getAPIList: APIClient['getAPIList'];
584-
}
585-
586565
export type PageInfo = { url: URL } | { params: Record<string, unknown> | null };
587566

588567
export abstract class AbstractPage<Item> implements AsyncIterable<Item> {

src/resource.ts

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,9 @@
33
import type { OpenAI } from './index';
44

55
export class APIResource {
6-
protected client: OpenAI;
7-
constructor(client: OpenAI) {
8-
this.client = client;
6+
protected _client: OpenAI;
97

10-
this.get = client.get.bind(client);
11-
this.post = client.post.bind(client);
12-
this.patch = client.patch.bind(client);
13-
this.put = client.put.bind(client);
14-
this.delete = client.delete.bind(client);
15-
this.getAPIList = client.getAPIList.bind(client);
8+
constructor(client: OpenAI) {
9+
this._client = client;
1610
}
17-
18-
protected get: OpenAI['get'];
19-
protected post: OpenAI['post'];
20-
protected patch: OpenAI['patch'];
21-
protected put: OpenAI['put'];
22-
protected delete: OpenAI['delete'];
23-
protected getAPIList: OpenAI['getAPIList'];
2411
}

src/resources/audio/audio.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import * as TranscriptionsAPI from 'openai/resources/audio/transcriptions';
66
import * as TranslationsAPI from 'openai/resources/audio/translations';
77

88
export class Audio extends APIResource {
9-
transcriptions: TranscriptionsAPI.Transcriptions = new TranscriptionsAPI.Transcriptions(this.client);
10-
translations: TranslationsAPI.Translations = new TranslationsAPI.Translations(this.client);
11-
speech: SpeechAPI.Speech = new SpeechAPI.Speech(this.client);
9+
transcriptions: TranscriptionsAPI.Transcriptions = new TranscriptionsAPI.Transcriptions(this._client);
10+
translations: TranslationsAPI.Translations = new TranslationsAPI.Translations(this._client);
11+
speech: SpeechAPI.Speech = new SpeechAPI.Speech(this._client);
1212
}
1313

1414
export namespace Audio {

src/resources/audio/speech.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class Speech extends APIResource {
1010
* Generates audio from the input text.
1111
*/
1212
create(body: SpeechCreateParams, options?: Core.RequestOptions): Core.APIPromise<Response> {
13-
return this.post('/audio/speech', { body, ...options, __binaryResponse: true });
13+
return this._client.post('/audio/speech', { body, ...options, __binaryResponse: true });
1414
}
1515
}
1616

src/resources/audio/transcriptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class Transcriptions extends APIResource {
1010
* Transcribes audio into the input language.
1111
*/
1212
create(body: TranscriptionCreateParams, options?: Core.RequestOptions): Core.APIPromise<Transcription> {
13-
return this.post('/audio/transcriptions', multipartFormRequestOptions({ body, ...options }));
13+
return this._client.post('/audio/transcriptions', multipartFormRequestOptions({ body, ...options }));
1414
}
1515
}
1616

0 commit comments

Comments
 (0)