openai 4.7.1 → 4.9.0
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 +16 -0
- package/README.md +4 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/{src/_shims/ReadableStream-node.ts → _shims/auto/runtime-bun.d.ts} +2 -3
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +99 -0
- package/_shims/{ReadableStream.js → auto/types.js} +0 -2
- package/{src/_shims/ReadableStream.js → _shims/auto/types.mjs} +0 -2
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +79 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +87 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +54 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +35 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +39 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +35 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +70 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +63 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +82 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +170 -218
- package/core.d.ts.map +1 -1
- package/core.js +679 -737
- package/core.js.map +1 -1
- package/core.mjs +673 -688
- package/core.mjs.map +1 -1
- package/error.d.ts +32 -34
- package/error.js +95 -109
- package/error.js.map +1 -1
- package/error.mjs +92 -94
- package/error.mjs.map +1 -1
- package/index.d.mts +164 -175
- package/index.d.ts +164 -175
- package/index.d.ts.map +1 -1
- package/index.js +110 -161
- package/index.mjs +88 -109
- package/package.json +31 -58
- package/pagination.d.ts +31 -41
- package/pagination.js +52 -48
- package/pagination.mjs +50 -46
- package/resource.d.ts +10 -10
- package/resource.js +12 -12
- package/resource.mjs +10 -10
- package/resources/audio/audio.d.ts +12 -12
- package/resources/audio/audio.js +33 -50
- package/resources/audio/audio.mjs +11 -11
- package/resources/audio/index.d.ts +4 -4
- package/resources/audio/index.js +9 -24
- package/resources/audio/index.mjs +4 -4
- package/resources/audio/transcriptions.d.ts +44 -44
- package/resources/audio/transcriptions.js +13 -12
- package/resources/audio/transcriptions.mjs +9 -8
- package/resources/audio/translations.d.ts +38 -38
- package/resources/audio/translations.js +13 -12
- package/resources/audio/translations.mjs +9 -8
- package/resources/chat/chat.d.ts +17 -17
- package/resources/chat/chat.js +30 -47
- package/resources/chat/chat.mjs +8 -8
- package/resources/chat/completions.d.ts +330 -353
- package/resources/chat/completions.js +10 -13
- package/resources/chat/completions.mjs +7 -10
- package/resources/chat/index.d.ts +3 -17
- package/resources/chat/index.js +7 -17
- package/resources/chat/index.mjs +3 -3
- package/resources/completions.d.ts +216 -232
- package/resources/completions.js +10 -13
- package/resources/completions.mjs +7 -10
- package/resources/edits.d.ts +73 -73
- package/resources/edits.js +16 -15
- package/resources/edits.mjs +13 -12
- package/resources/embeddings.d.ts +73 -76
- package/resources/embeddings.js +12 -11
- package/resources/embeddings.mjs +9 -8
- package/resources/files.d.ts +91 -96
- package/resources/files.js +64 -65
- package/resources/files.mjs +57 -58
- package/resources/fine-tunes.d.ts +277 -290
- package/resources/fine-tunes.js +49 -50
- package/resources/fine-tunes.mjs +45 -46
- package/resources/fine-tuning/fine-tuning.d.ts +12 -12
- package/resources/fine-tuning/fine-tuning.js +32 -49
- package/resources/fine-tuning/fine-tuning.mjs +10 -10
- package/resources/fine-tuning/index.d.ts +3 -12
- package/resources/fine-tuning/index.js +9 -29
- package/resources/fine-tuning/index.mjs +3 -3
- package/resources/fine-tuning/jobs.d.ts +173 -179
- package/resources/fine-tuning/jobs.js +50 -47
- package/resources/fine-tuning/jobs.mjs +45 -42
- package/resources/images.d.ts +116 -119
- package/resources/images.js +25 -24
- package/resources/images.mjs +21 -20
- package/resources/index.d.ts +12 -37
- package/resources/index.js +29 -113
- package/resources/index.mjs +12 -12
- package/resources/models.d.ts +41 -40
- package/resources/models.js +30 -28
- package/resources/models.mjs +26 -24
- package/resources/moderations.d.ts +153 -156
- package/resources/moderations.js +12 -11
- package/resources/moderations.mjs +9 -8
- package/shims/node.d.ts +29 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +99 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +79 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +79 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +62 -0
- package/src/_shims/web-runtime.ts +91 -0
- package/src/_shims/web-types.d.ts +82 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +35 -18
- package/src/error.ts +3 -3
- package/src/index.ts +6 -6
- package/src/pagination.ts +1 -1
- package/src/resource.ts +1 -1
- package/src/resources/audio/audio.ts +4 -4
- package/src/resources/audio/index.ts +3 -3
- package/src/resources/audio/transcriptions.ts +4 -4
- package/src/resources/audio/translations.ts +4 -4
- package/src/resources/chat/chat.ts +3 -3
- package/src/resources/chat/completions.ts +6 -6
- package/src/resources/chat/index.ts +2 -2
- package/src/resources/completions.ts +5 -5
- package/src/resources/edits.ts +4 -4
- package/src/resources/embeddings.ts +3 -3
- package/src/resources/files.ts +7 -7
- package/src/resources/fine-tunes.ts +7 -7
- package/src/resources/fine-tuning/fine-tuning.ts +3 -3
- package/src/resources/fine-tuning/index.ts +2 -2
- package/src/resources/fine-tuning/jobs.ts +6 -6
- package/src/resources/images.ts +4 -4
- package/src/resources/index.ts +11 -11
- package/src/resources/models.ts +4 -4
- package/src/resources/moderations.ts +3 -3
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/streaming.ts +1 -1
- package/src/uploads.ts +12 -16
- package/src/version.ts +1 -1
- package/streaming.d.ts +9 -8
- package/streaming.d.ts.map +1 -1
- package/streaming.js +194 -185
- package/streaming.mjs +192 -183
- package/uploads.d.ts +23 -39
- package/uploads.d.ts.map +1 -1
- package/uploads.js +115 -157
- package/uploads.js.map +1 -1
- package/uploads.mjs +111 -133
- package/uploads.mjs.map +1 -1
- package/version.d.ts +2 -2
- package/version.js +4 -4
- package/version.mjs +2 -2
- package/_shims/ReadableStream-node.d.ts +0 -6
- package/_shims/ReadableStream-node.d.ts.map +0 -1
- package/_shims/ReadableStream-node.js +0 -14
- package/_shims/ReadableStream-node.js.map +0 -1
- package/_shims/ReadableStream-node.mjs +0 -3
- package/_shims/ReadableStream-node.mjs.map +0 -1
- package/_shims/ReadableStream.d.ts +0 -38
- package/_shims/ReadableStream.mjs +0 -7
- package/_shims/agent-node.d.ts +0 -7
- package/_shims/agent-node.d.ts.map +0 -1
- package/_shims/agent-node.js +0 -28
- package/_shims/agent-node.js.map +0 -1
- package/_shims/agent-node.mjs +0 -16
- package/_shims/agent-node.mjs.map +0 -1
- package/_shims/agent.d.ts +0 -9
- package/_shims/agent.d.ts.map +0 -1
- package/_shims/agent.js +0 -14
- package/_shims/agent.js.map +0 -1
- package/_shims/agent.mjs +0 -10
- package/_shims/agent.mjs.map +0 -1
- package/_shims/fetch-node.d.ts +0 -64
- package/_shims/fetch-node.js +0 -12
- package/_shims/fetch-node.mjs +0 -14
- package/_shims/fetch.d.ts +0 -60
- package/_shims/fetch.js +0 -13
- package/_shims/fetch.mjs +0 -15
- package/_shims/fileFromPath-node.d.ts +0 -17
- package/_shims/fileFromPath-node.d.ts.map +0 -1
- package/_shims/fileFromPath-node.js +0 -17
- package/_shims/fileFromPath-node.js.map +0 -1
- package/_shims/fileFromPath-node.mjs +0 -13
- package/_shims/fileFromPath-node.mjs.map +0 -1
- package/_shims/fileFromPath.d.ts +0 -22
- package/_shims/fileFromPath.d.ts.map +0 -1
- package/_shims/fileFromPath.js +0 -16
- package/_shims/fileFromPath.js.map +0 -1
- package/_shims/fileFromPath.mjs +0 -12
- package/_shims/fileFromPath.mjs.map +0 -1
- package/_shims/form-data-node.d.ts +0 -45
- package/_shims/form-data-node.js +0 -11
- package/_shims/form-data-node.mjs +0 -9
- package/_shims/form-data.d.ts +0 -43
- package/_shims/form-data.js +0 -17
- package/_shims/form-data.mjs +0 -20
- package/_shims/getMultipartRequestOptions-node.d.ts +0 -10
- package/_shims/getMultipartRequestOptions-node.d.ts.map +0 -1
- package/_shims/getMultipartRequestOptions-node.js +0 -22
- package/_shims/getMultipartRequestOptions-node.js.map +0 -1
- package/_shims/getMultipartRequestOptions-node.mjs +0 -18
- package/_shims/getMultipartRequestOptions-node.mjs.map +0 -1
- package/_shims/getMultipartRequestOptions.d.ts +0 -10
- package/_shims/getMultipartRequestOptions.d.ts.map +0 -1
- package/_shims/getMultipartRequestOptions.js +0 -12
- package/_shims/getMultipartRequestOptions.js.map +0 -1
- package/_shims/getMultipartRequestOptions.mjs +0 -8
- package/_shims/getMultipartRequestOptions.mjs.map +0 -1
- package/_shims/node-readable-node.d.ts +0 -8
- package/_shims/node-readable-node.d.ts.map +0 -1
- package/_shims/node-readable-node.js +0 -9
- package/_shims/node-readable-node.js.map +0 -1
- package/_shims/node-readable-node.mjs +0 -5
- package/_shims/node-readable-node.mjs.map +0 -1
- package/_shims/node-readable.d.ts +0 -23
- package/_shims/node-readable.d.ts.map +0 -1
- package/_shims/node-readable.js +0 -11
- package/_shims/node-readable.js.map +0 -1
- package/_shims/node-readable.mjs +0 -7
- package/_shims/node-readable.mjs.map +0 -1
- package/src/_shims/ReadableStream.d.ts +0 -38
- package/src/_shims/ReadableStream.mjs +0 -7
- package/src/_shims/agent-node.ts +0 -22
- package/src/_shims/agent.ts +0 -12
- package/src/_shims/fetch-node.d.ts +0 -64
- package/src/_shims/fetch-node.js +0 -12
- package/src/_shims/fetch-node.mjs +0 -14
- package/src/_shims/fetch.d.ts +0 -60
- package/src/_shims/fetch.js +0 -13
- package/src/_shims/fetch.mjs +0 -15
- package/src/_shims/fileFromPath-node.ts +0 -29
- package/src/_shims/fileFromPath.ts +0 -29
- package/src/_shims/form-data-node.d.ts +0 -45
- package/src/_shims/form-data-node.js +0 -11
- package/src/_shims/form-data-node.mjs +0 -9
- package/src/_shims/form-data.d.ts +0 -43
- package/src/_shims/form-data.js +0 -17
- package/src/_shims/form-data.mjs +0 -20
- package/src/_shims/getMultipartRequestOptions-node.ts +0 -25
- package/src/_shims/getMultipartRequestOptions.ts +0 -14
- package/src/_shims/node-readable-node.ts +0 -10
- package/src/_shims/node-readable.ts +0 -30
package/pagination.d.ts
CHANGED
|
@@ -1,53 +1,43 @@
|
|
|
1
|
-
import { AbstractPage, Response, APIClient, FinalRequestOptions, PageInfo } from
|
|
1
|
+
import { AbstractPage, Response, APIClient, FinalRequestOptions, PageInfo } from "./core.js";
|
|
2
2
|
export interface PageResponse<Item> {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
data: Array<Item>;
|
|
4
|
+
object: string;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Note: no pagination actually occurs yet, this is for forwards-compatibility.
|
|
8
8
|
*/
|
|
9
9
|
export declare class Page<Item> extends AbstractPage<Item> implements PageResponse<Item> {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
object: string;
|
|
11
|
+
data: Array<Item>;
|
|
12
|
+
constructor(client: APIClient, response: Response, body: PageResponse<Item>, options: FinalRequestOptions);
|
|
13
|
+
getPaginatedItems(): Item[];
|
|
14
|
+
/**
|
|
15
|
+
* This page represents a response that isn't actually paginated at the API level
|
|
16
|
+
* so there will never be any next page params.
|
|
17
|
+
*/
|
|
18
|
+
nextPageParams(): null;
|
|
19
|
+
nextPageInfo(): null;
|
|
20
20
|
}
|
|
21
21
|
export interface CursorPageResponse<Item> {
|
|
22
|
-
|
|
22
|
+
data: Array<Item>;
|
|
23
23
|
}
|
|
24
24
|
export interface CursorPageParams {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Identifier for the last job from the previous pagination request.
|
|
27
|
+
*/
|
|
28
|
+
after?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Number of fine-tuning jobs to retrieve.
|
|
31
|
+
*/
|
|
32
|
+
limit?: number;
|
|
33
33
|
}
|
|
34
|
-
export declare class CursorPage<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
data: Array<Item>;
|
|
43
|
-
constructor(
|
|
44
|
-
client: APIClient,
|
|
45
|
-
response: Response,
|
|
46
|
-
body: CursorPageResponse<Item>,
|
|
47
|
-
options: FinalRequestOptions,
|
|
48
|
-
);
|
|
49
|
-
getPaginatedItems(): Item[];
|
|
50
|
-
nextPageParams(): Partial<CursorPageParams> | null;
|
|
51
|
-
nextPageInfo(): PageInfo | null;
|
|
34
|
+
export declare class CursorPage<Item extends {
|
|
35
|
+
id: string;
|
|
36
|
+
}> extends AbstractPage<Item> implements CursorPageResponse<Item> {
|
|
37
|
+
data: Array<Item>;
|
|
38
|
+
constructor(client: APIClient, response: Response, body: CursorPageResponse<Item>, options: FinalRequestOptions);
|
|
39
|
+
getPaginatedItems(): Item[];
|
|
40
|
+
nextPageParams(): Partial<CursorPageParams> | null;
|
|
41
|
+
nextPageInfo(): PageInfo | null;
|
|
52
42
|
}
|
|
53
|
-
//# sourceMappingURL=pagination.d.ts.map
|
|
43
|
+
//# sourceMappingURL=pagination.d.ts.map
|
package/pagination.js
CHANGED
|
@@ -1,59 +1,63 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
-
Object.defineProperty(exports,
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.CursorPage = exports.Page = void 0;
|
|
5
|
-
const core_1 = require(
|
|
5
|
+
const core_1 = require("./core.js");
|
|
6
6
|
/**
|
|
7
7
|
* Note: no pagination actually occurs yet, this is for forwards-compatibility.
|
|
8
8
|
*/
|
|
9
9
|
class Page extends core_1.AbstractPage {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
10
|
+
constructor(client, response, body, options) {
|
|
11
|
+
super(client, response, body, options);
|
|
12
|
+
this.object = body.object;
|
|
13
|
+
this.data = body.data;
|
|
14
|
+
}
|
|
15
|
+
getPaginatedItems() {
|
|
16
|
+
return this.data;
|
|
17
|
+
}
|
|
18
|
+
// @deprecated Please use `nextPageInfo()` instead
|
|
19
|
+
/**
|
|
20
|
+
* This page represents a response that isn't actually paginated at the API level
|
|
21
|
+
* so there will never be any next page params.
|
|
22
|
+
*/
|
|
23
|
+
nextPageParams() {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
nextPageInfo() {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
29
|
}
|
|
30
30
|
exports.Page = Page;
|
|
31
31
|
class CursorPage extends core_1.AbstractPage {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
32
|
+
constructor(client, response, body, options) {
|
|
33
|
+
super(client, response, body, options);
|
|
34
|
+
this.data = body.data;
|
|
35
|
+
}
|
|
36
|
+
getPaginatedItems() {
|
|
37
|
+
return this.data;
|
|
38
|
+
}
|
|
39
|
+
// @deprecated Please use `nextPageInfo()` instead
|
|
40
|
+
nextPageParams() {
|
|
41
|
+
const info = this.nextPageInfo();
|
|
42
|
+
if (!info)
|
|
43
|
+
return null;
|
|
44
|
+
if ('params' in info)
|
|
45
|
+
return info.params;
|
|
46
|
+
const params = Object.fromEntries(info.url.searchParams);
|
|
47
|
+
if (!Object.keys(params).length)
|
|
48
|
+
return null;
|
|
49
|
+
return params;
|
|
50
|
+
}
|
|
51
|
+
nextPageInfo() {
|
|
52
|
+
var _a, _b;
|
|
53
|
+
if (!((_a = this.data) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
const next = (_b = this.data[this.data.length - 1]) === null || _b === void 0 ? void 0 : _b.id;
|
|
57
|
+
if (!next)
|
|
58
|
+
return null;
|
|
59
|
+
return { params: { after: next } };
|
|
60
|
+
}
|
|
57
61
|
}
|
|
58
62
|
exports.CursorPage = CursorPage;
|
|
59
|
-
//# sourceMappingURL=pagination.js.map
|
|
63
|
+
//# sourceMappingURL=pagination.js.map
|
package/pagination.mjs
CHANGED
|
@@ -1,54 +1,58 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
-
import { AbstractPage } from
|
|
2
|
+
import { AbstractPage } from "./core.mjs";
|
|
3
3
|
/**
|
|
4
4
|
* Note: no pagination actually occurs yet, this is for forwards-compatibility.
|
|
5
5
|
*/
|
|
6
6
|
export class Page extends AbstractPage {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
7
|
+
constructor(client, response, body, options) {
|
|
8
|
+
super(client, response, body, options);
|
|
9
|
+
this.object = body.object;
|
|
10
|
+
this.data = body.data;
|
|
11
|
+
}
|
|
12
|
+
getPaginatedItems() {
|
|
13
|
+
return this.data;
|
|
14
|
+
}
|
|
15
|
+
// @deprecated Please use `nextPageInfo()` instead
|
|
16
|
+
/**
|
|
17
|
+
* This page represents a response that isn't actually paginated at the API level
|
|
18
|
+
* so there will never be any next page params.
|
|
19
|
+
*/
|
|
20
|
+
nextPageParams() {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
nextPageInfo() {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
26
|
}
|
|
27
27
|
export class CursorPage extends AbstractPage {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
28
|
+
constructor(client, response, body, options) {
|
|
29
|
+
super(client, response, body, options);
|
|
30
|
+
this.data = body.data;
|
|
31
|
+
}
|
|
32
|
+
getPaginatedItems() {
|
|
33
|
+
return this.data;
|
|
34
|
+
}
|
|
35
|
+
// @deprecated Please use `nextPageInfo()` instead
|
|
36
|
+
nextPageParams() {
|
|
37
|
+
const info = this.nextPageInfo();
|
|
38
|
+
if (!info)
|
|
39
|
+
return null;
|
|
40
|
+
if ('params' in info)
|
|
41
|
+
return info.params;
|
|
42
|
+
const params = Object.fromEntries(info.url.searchParams);
|
|
43
|
+
if (!Object.keys(params).length)
|
|
44
|
+
return null;
|
|
45
|
+
return params;
|
|
46
|
+
}
|
|
47
|
+
nextPageInfo() {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
if (!((_a = this.data) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
const next = (_b = this.data[this.data.length - 1]) === null || _b === void 0 ? void 0 : _b.id;
|
|
53
|
+
if (!next)
|
|
54
|
+
return null;
|
|
55
|
+
return { params: { after: next } };
|
|
56
|
+
}
|
|
53
57
|
}
|
|
54
|
-
//# sourceMappingURL=pagination.mjs.map
|
|
58
|
+
//# sourceMappingURL=pagination.mjs.map
|
package/resource.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { OpenAI } from
|
|
1
|
+
import type { OpenAI } from "./index.js";
|
|
2
2
|
export declare class APIResource {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
protected client: OpenAI;
|
|
4
|
+
constructor(client: OpenAI);
|
|
5
|
+
protected get: OpenAI['get'];
|
|
6
|
+
protected post: OpenAI['post'];
|
|
7
|
+
protected patch: OpenAI['patch'];
|
|
8
|
+
protected put: OpenAI['put'];
|
|
9
|
+
protected delete: OpenAI['delete'];
|
|
10
|
+
protected getAPIList: OpenAI['getAPIList'];
|
|
11
11
|
}
|
|
12
|
-
//# sourceMappingURL=resource.d.ts.map
|
|
12
|
+
//# sourceMappingURL=resource.d.ts.map
|
package/resource.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
-
Object.defineProperty(exports,
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.APIResource = void 0;
|
|
5
5
|
class APIResource {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
this.get = client.get.bind(client);
|
|
9
|
+
this.post = client.post.bind(client);
|
|
10
|
+
this.patch = client.patch.bind(client);
|
|
11
|
+
this.put = client.put.bind(client);
|
|
12
|
+
this.delete = client.delete.bind(client);
|
|
13
|
+
this.getAPIList = client.getAPIList.bind(client);
|
|
14
|
+
}
|
|
15
15
|
}
|
|
16
16
|
exports.APIResource = APIResource;
|
|
17
|
-
//# sourceMappingURL=resource.js.map
|
|
17
|
+
//# sourceMappingURL=resource.js.map
|
package/resource.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
export class APIResource {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
this.get = client.get.bind(client);
|
|
6
|
+
this.post = client.post.bind(client);
|
|
7
|
+
this.patch = client.patch.bind(client);
|
|
8
|
+
this.put = client.put.bind(client);
|
|
9
|
+
this.delete = client.delete.bind(client);
|
|
10
|
+
this.getAPIList = client.getAPIList.bind(client);
|
|
11
|
+
}
|
|
12
12
|
}
|
|
13
|
-
//# sourceMappingURL=resource.mjs.map
|
|
13
|
+
//# sourceMappingURL=resource.mjs.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { APIResource } from 'openai/resource';
|
|
2
|
-
import { Transcriptions } from
|
|
3
|
-
import { Translations } from
|
|
4
|
-
import * as API from
|
|
2
|
+
import { Transcriptions } from "./transcriptions.js";
|
|
3
|
+
import { Translations } from "./translations.js";
|
|
4
|
+
import * as API from "./index.js";
|
|
5
5
|
export declare class Audio extends APIResource {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
transcriptions: Transcriptions;
|
|
7
|
+
translations: Translations;
|
|
8
8
|
}
|
|
9
9
|
export declare namespace Audio {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
export import Transcriptions = API.Transcriptions;
|
|
11
|
+
export import Transcription = API.Transcription;
|
|
12
|
+
export import TranscriptionCreateParams = API.TranscriptionCreateParams;
|
|
13
|
+
export import Translations = API.Translations;
|
|
14
|
+
export import Translation = API.Translation;
|
|
15
|
+
export import TranslationCreateParams = API.TranslationCreateParams;
|
|
16
16
|
}
|
|
17
|
-
//# sourceMappingURL=audio.d.ts.map
|
|
17
|
+
//# sourceMappingURL=audio.d.ts.map
|
package/resources/audio/audio.js
CHANGED
|
@@ -1,61 +1,44 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
-
var __createBinding =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return m[k];
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
Object.defineProperty(o, k2, desc);
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
8
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
o['default'] = v;
|
|
31
|
-
});
|
|
32
|
-
var __importStar =
|
|
33
|
-
(this && this.__importStar) ||
|
|
34
|
-
function (mod) {
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
35
20
|
if (mod && mod.__esModule) return mod;
|
|
36
21
|
var result = {};
|
|
37
|
-
if (mod != null)
|
|
38
|
-
for (var k in mod)
|
|
39
|
-
if (k !== 'default' && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
40
23
|
__setModuleDefault(result, mod);
|
|
41
24
|
return result;
|
|
42
|
-
|
|
43
|
-
Object.defineProperty(exports,
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
27
|
exports.Audio = void 0;
|
|
45
|
-
const resource_1 = require(
|
|
46
|
-
const transcriptions_1 = require(
|
|
47
|
-
const translations_1 = require(
|
|
48
|
-
const API = __importStar(require(
|
|
28
|
+
const resource_1 = require("openai/resource");
|
|
29
|
+
const transcriptions_1 = require("./transcriptions.js");
|
|
30
|
+
const translations_1 = require("./translations.js");
|
|
31
|
+
const API = __importStar(require("./index.js"));
|
|
49
32
|
class Audio extends resource_1.APIResource {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
this.transcriptions = new transcriptions_1.Transcriptions(this.client);
|
|
36
|
+
this.translations = new translations_1.Translations(this.client);
|
|
37
|
+
}
|
|
55
38
|
}
|
|
56
39
|
exports.Audio = Audio;
|
|
57
40
|
(function (Audio) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
})(
|
|
61
|
-
//# sourceMappingURL=audio.js.map
|
|
41
|
+
Audio.Transcriptions = API.Transcriptions;
|
|
42
|
+
Audio.Translations = API.Translations;
|
|
43
|
+
})(Audio = exports.Audio || (exports.Audio = {}));
|
|
44
|
+
//# sourceMappingURL=audio.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
import { APIResource } from 'openai/resource';
|
|
3
|
-
import { Transcriptions } from
|
|
4
|
-
import { Translations } from
|
|
5
|
-
import * as API from
|
|
3
|
+
import { Transcriptions } from "./transcriptions.mjs";
|
|
4
|
+
import { Translations } from "./translations.mjs";
|
|
5
|
+
import * as API from "./index.mjs";
|
|
6
6
|
export class Audio extends APIResource {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.transcriptions = new Transcriptions(this.client);
|
|
10
|
+
this.translations = new Translations(this.client);
|
|
11
|
+
}
|
|
12
12
|
}
|
|
13
13
|
(function (Audio) {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
Audio.Transcriptions = API.Transcriptions;
|
|
15
|
+
Audio.Translations = API.Translations;
|
|
16
16
|
})(Audio || (Audio = {}));
|
|
17
|
-
//# sourceMappingURL=audio.mjs.map
|
|
17
|
+
//# sourceMappingURL=audio.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Audio } from
|
|
2
|
-
export { Transcription, TranscriptionCreateParams, Transcriptions } from
|
|
3
|
-
export { Translation, TranslationCreateParams, Translations } from
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export { Audio } from "./audio.js";
|
|
2
|
+
export { Transcription, TranscriptionCreateParams, Transcriptions } from "./transcriptions.js";
|
|
3
|
+
export { Translation, TranslationCreateParams, Translations } from "./translations.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
package/resources/audio/index.js
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
-
Object.defineProperty(exports,
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Translations = exports.Transcriptions = exports.Audio = void 0;
|
|
5
|
-
var audio_1 = require(
|
|
6
|
-
Object.defineProperty(exports,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var transcriptions_1 = require('./transcriptions.js');
|
|
13
|
-
Object.defineProperty(exports, 'Transcriptions', {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () {
|
|
16
|
-
return transcriptions_1.Transcriptions;
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
var translations_1 = require('./translations.js');
|
|
20
|
-
Object.defineProperty(exports, 'Translations', {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function () {
|
|
23
|
-
return translations_1.Translations;
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
|
5
|
+
var audio_1 = require("./audio.js");
|
|
6
|
+
Object.defineProperty(exports, "Audio", { enumerable: true, get: function () { return audio_1.Audio; } });
|
|
7
|
+
var transcriptions_1 = require("./transcriptions.js");
|
|
8
|
+
Object.defineProperty(exports, "Transcriptions", { enumerable: true, get: function () { return transcriptions_1.Transcriptions; } });
|
|
9
|
+
var translations_1 = require("./translations.js");
|
|
10
|
+
Object.defineProperty(exports, "Translations", { enumerable: true, get: function () { return translations_1.Translations; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
-
export { Audio } from
|
|
3
|
-
export { Transcriptions } from
|
|
4
|
-
export { Translations } from
|
|
5
|
-
//# sourceMappingURL=index.mjs.map
|
|
2
|
+
export { Audio } from "./audio.mjs";
|
|
3
|
+
export { Transcriptions } from "./transcriptions.mjs";
|
|
4
|
+
export { Translations } from "./translations.mjs";
|
|
5
|
+
//# sourceMappingURL=index.mjs.map
|