openai 4.8.0 → 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 +8 -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.mjs +92 -94
- 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 +34 -17
- package/src/error.ts +1 -1
- 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/resources/images.d.ts
CHANGED
|
@@ -1,139 +1,136 @@
|
|
|
1
1
|
import * as Core from 'openai/core';
|
|
2
2
|
import { APIResource } from 'openai/resource';
|
|
3
|
-
import * as API from
|
|
3
|
+
import * as API from "./index.js";
|
|
4
4
|
import { type Uploadable } from 'openai/core';
|
|
5
5
|
export declare class Images extends APIResource {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* Creates an image given a prompt.
|
|
19
|
-
*/
|
|
20
|
-
generate(body: ImageGenerateParams, options?: Core.RequestOptions): Core.APIPromise<ImagesResponse>;
|
|
6
|
+
/**
|
|
7
|
+
* Creates a variation of a given image.
|
|
8
|
+
*/
|
|
9
|
+
createVariation(body: ImageCreateVariationParams, options?: Core.RequestOptions): Core.APIPromise<ImagesResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* Creates an edited or extended image given an original image and a prompt.
|
|
12
|
+
*/
|
|
13
|
+
edit(body: ImageEditParams, options?: Core.RequestOptions): Core.APIPromise<ImagesResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* Creates an image given a prompt.
|
|
16
|
+
*/
|
|
17
|
+
generate(body: ImageGenerateParams, options?: Core.RequestOptions): Core.APIPromise<ImagesResponse>;
|
|
21
18
|
}
|
|
22
19
|
/**
|
|
23
20
|
* Represents the url or the content of an image generated by the OpenAI API.
|
|
24
21
|
*/
|
|
25
22
|
export interface Image {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
/**
|
|
24
|
+
* The base64-encoded JSON of the generated image, if `response_format` is
|
|
25
|
+
* `b64_json`.
|
|
26
|
+
*/
|
|
27
|
+
b64_json?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The URL of the generated image, if `response_format` is `url` (default).
|
|
30
|
+
*/
|
|
31
|
+
url?: string;
|
|
35
32
|
}
|
|
36
33
|
export interface ImagesResponse {
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
created: number;
|
|
35
|
+
data: Array<Image>;
|
|
39
36
|
}
|
|
40
37
|
export interface ImageCreateVariationParams {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
38
|
+
/**
|
|
39
|
+
* The image to use as the basis for the variation(s). Must be a valid PNG file,
|
|
40
|
+
* less than 4MB, and square.
|
|
41
|
+
*/
|
|
42
|
+
image: Uploadable;
|
|
43
|
+
/**
|
|
44
|
+
* The number of images to generate. Must be between 1 and 10.
|
|
45
|
+
*/
|
|
46
|
+
n?: number | null;
|
|
47
|
+
/**
|
|
48
|
+
* The format in which the generated images are returned. Must be one of `url` or
|
|
49
|
+
* `b64_json`.
|
|
50
|
+
*/
|
|
51
|
+
response_format?: 'url' | 'b64_json' | null;
|
|
52
|
+
/**
|
|
53
|
+
* The size of the generated images. Must be one of `256x256`, `512x512`, or
|
|
54
|
+
* `1024x1024`.
|
|
55
|
+
*/
|
|
56
|
+
size?: '256x256' | '512x512' | '1024x1024' | null;
|
|
57
|
+
/**
|
|
58
|
+
* A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
59
|
+
* and detect abuse.
|
|
60
|
+
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).
|
|
61
|
+
*/
|
|
62
|
+
user?: string;
|
|
66
63
|
}
|
|
67
64
|
export interface ImageEditParams {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
65
|
+
/**
|
|
66
|
+
* The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask
|
|
67
|
+
* is not provided, image must have transparency, which will be used as the mask.
|
|
68
|
+
*/
|
|
69
|
+
image: Uploadable;
|
|
70
|
+
/**
|
|
71
|
+
* A text description of the desired image(s). The maximum length is 1000
|
|
72
|
+
* characters.
|
|
73
|
+
*/
|
|
74
|
+
prompt: string;
|
|
75
|
+
/**
|
|
76
|
+
* An additional image whose fully transparent areas (e.g. where alpha is zero)
|
|
77
|
+
* indicate where `image` should be edited. Must be a valid PNG file, less than
|
|
78
|
+
* 4MB, and have the same dimensions as `image`.
|
|
79
|
+
*/
|
|
80
|
+
mask?: Uploadable;
|
|
81
|
+
/**
|
|
82
|
+
* The number of images to generate. Must be between 1 and 10.
|
|
83
|
+
*/
|
|
84
|
+
n?: number | null;
|
|
85
|
+
/**
|
|
86
|
+
* The format in which the generated images are returned. Must be one of `url` or
|
|
87
|
+
* `b64_json`.
|
|
88
|
+
*/
|
|
89
|
+
response_format?: 'url' | 'b64_json' | null;
|
|
90
|
+
/**
|
|
91
|
+
* The size of the generated images. Must be one of `256x256`, `512x512`, or
|
|
92
|
+
* `1024x1024`.
|
|
93
|
+
*/
|
|
94
|
+
size?: '256x256' | '512x512' | '1024x1024' | null;
|
|
95
|
+
/**
|
|
96
|
+
* A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
97
|
+
* and detect abuse.
|
|
98
|
+
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).
|
|
99
|
+
*/
|
|
100
|
+
user?: string;
|
|
104
101
|
}
|
|
105
102
|
export interface ImageGenerateParams {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
103
|
+
/**
|
|
104
|
+
* A text description of the desired image(s). The maximum length is 1000
|
|
105
|
+
* characters.
|
|
106
|
+
*/
|
|
107
|
+
prompt: string;
|
|
108
|
+
/**
|
|
109
|
+
* The number of images to generate. Must be between 1 and 10.
|
|
110
|
+
*/
|
|
111
|
+
n?: number | null;
|
|
112
|
+
/**
|
|
113
|
+
* The format in which the generated images are returned. Must be one of `url` or
|
|
114
|
+
* `b64_json`.
|
|
115
|
+
*/
|
|
116
|
+
response_format?: 'url' | 'b64_json' | null;
|
|
117
|
+
/**
|
|
118
|
+
* The size of the generated images. Must be one of `256x256`, `512x512`, or
|
|
119
|
+
* `1024x1024`.
|
|
120
|
+
*/
|
|
121
|
+
size?: '256x256' | '512x512' | '1024x1024' | null;
|
|
122
|
+
/**
|
|
123
|
+
* A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
124
|
+
* and detect abuse.
|
|
125
|
+
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).
|
|
126
|
+
*/
|
|
127
|
+
user?: string;
|
|
131
128
|
}
|
|
132
129
|
export declare namespace Images {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
130
|
+
export import Image = API.Image;
|
|
131
|
+
export import ImagesResponse = API.ImagesResponse;
|
|
132
|
+
export import ImageCreateVariationParams = API.ImageCreateVariationParams;
|
|
133
|
+
export import ImageEditParams = API.ImageEditParams;
|
|
134
|
+
export import ImageGenerateParams = API.ImageGenerateParams;
|
|
138
135
|
}
|
|
139
|
-
//# sourceMappingURL=images.d.ts.map
|
|
136
|
+
//# sourceMappingURL=images.d.ts.map
|
package/resources/images.js
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
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.Images = void 0;
|
|
5
|
-
const resource_1 = require(
|
|
6
|
-
const core_1 = require(
|
|
5
|
+
const resource_1 = require("openai/resource");
|
|
6
|
+
const core_1 = require("openai/core");
|
|
7
7
|
class Images extends resource_1.APIResource {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Creates a variation of a given image.
|
|
10
|
+
*/
|
|
11
|
+
createVariation(body, options) {
|
|
12
|
+
return this.post('/images/variations', (0, core_1.multipartFormRequestOptions)({ body, ...options }));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Creates an edited or extended image given an original image and a prompt.
|
|
16
|
+
*/
|
|
17
|
+
edit(body, options) {
|
|
18
|
+
return this.post('/images/edits', (0, core_1.multipartFormRequestOptions)({ body, ...options }));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Creates an image given a prompt.
|
|
22
|
+
*/
|
|
23
|
+
generate(body, options) {
|
|
24
|
+
return this.post('/images/generations', { body, ...options });
|
|
25
|
+
}
|
|
26
26
|
}
|
|
27
27
|
exports.Images = Images;
|
|
28
|
-
(function (Images) {
|
|
29
|
-
|
|
28
|
+
(function (Images) {
|
|
29
|
+
})(Images = exports.Images || (exports.Images = {}));
|
|
30
|
+
//# sourceMappingURL=images.js.map
|
package/resources/images.mjs
CHANGED
|
@@ -2,24 +2,25 @@
|
|
|
2
2
|
import { APIResource } from 'openai/resource';
|
|
3
3
|
import { multipartFormRequestOptions } from 'openai/core';
|
|
4
4
|
export class Images extends APIResource {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Creates a variation of a given image.
|
|
7
|
+
*/
|
|
8
|
+
createVariation(body, options) {
|
|
9
|
+
return this.post('/images/variations', multipartFormRequestOptions({ body, ...options }));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Creates an edited or extended image given an original image and a prompt.
|
|
13
|
+
*/
|
|
14
|
+
edit(body, options) {
|
|
15
|
+
return this.post('/images/edits', multipartFormRequestOptions({ body, ...options }));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Creates an image given a prompt.
|
|
19
|
+
*/
|
|
20
|
+
generate(body, options) {
|
|
21
|
+
return this.post('/images/generations', { body, ...options });
|
|
22
|
+
}
|
|
23
23
|
}
|
|
24
|
-
(function (Images) {
|
|
25
|
-
|
|
24
|
+
(function (Images) {
|
|
25
|
+
})(Images || (Images = {}));
|
|
26
|
+
//# sourceMappingURL=images.mjs.map
|
package/resources/index.d.ts
CHANGED
|
@@ -1,37 +1,12 @@
|
|
|
1
|
-
export { Audio } from
|
|
2
|
-
export { Chat } from
|
|
3
|
-
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} from
|
|
12
|
-
|
|
13
|
-
export { Edit, EditCreateParams, Edits } from './edits.js';
|
|
14
|
-
export { FileContent, FileDeleted, FileObject, FileCreateParams, FileObjectsPage, Files } from './files.js';
|
|
15
|
-
export {
|
|
16
|
-
FineTune,
|
|
17
|
-
FineTuneEvent,
|
|
18
|
-
FineTuneEventsListResponse,
|
|
19
|
-
FineTuneCreateParams,
|
|
20
|
-
FineTuneListEventsParams,
|
|
21
|
-
FineTuneListEventsParamsNonStreaming,
|
|
22
|
-
FineTuneListEventsParamsStreaming,
|
|
23
|
-
FineTunesPage,
|
|
24
|
-
FineTunes,
|
|
25
|
-
} from './fine-tunes.js';
|
|
26
|
-
export { FineTuning } from './fine-tuning/fine-tuning.js';
|
|
27
|
-
export {
|
|
28
|
-
Image,
|
|
29
|
-
ImagesResponse,
|
|
30
|
-
ImageCreateVariationParams,
|
|
31
|
-
ImageEditParams,
|
|
32
|
-
ImageGenerateParams,
|
|
33
|
-
Images,
|
|
34
|
-
} from './images.js';
|
|
35
|
-
export { Model, ModelDeleted, ModelsPage, Models } from './models.js';
|
|
36
|
-
export { Moderation, ModerationCreateResponse, ModerationCreateParams, Moderations } from './moderations.js';
|
|
37
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export { Audio } from "./audio/audio.js";
|
|
2
|
+
export { Chat } from "./chat/chat.js";
|
|
3
|
+
export { Completion, CompletionChoice, CompletionUsage, CompletionCreateParams, CompletionCreateParamsNonStreaming, CompletionCreateParamsStreaming, Completions, } from "./completions.js";
|
|
4
|
+
export { CreateEmbeddingResponse, Embedding, EmbeddingCreateParams, Embeddings } from "./embeddings.js";
|
|
5
|
+
export { Edit, EditCreateParams, Edits } from "./edits.js";
|
|
6
|
+
export { FileContent, FileDeleted, FileObject, FileCreateParams, FileObjectsPage, Files } from "./files.js";
|
|
7
|
+
export { FineTune, FineTuneEvent, FineTuneEventsListResponse, FineTuneCreateParams, FineTuneListEventsParams, FineTuneListEventsParamsNonStreaming, FineTuneListEventsParamsStreaming, FineTunesPage, FineTunes, } from "./fine-tunes.js";
|
|
8
|
+
export { FineTuning } from "./fine-tuning/fine-tuning.js";
|
|
9
|
+
export { Image, ImagesResponse, ImageCreateVariationParams, ImageEditParams, ImageGenerateParams, Images, } from "./images.js";
|
|
10
|
+
export { Model, ModelDeleted, ModelsPage, Models } from "./models.js";
|
|
11
|
+
export { Moderation, ModerationCreateResponse, ModerationCreateParams, Moderations } from "./moderations.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
package/resources/index.js
CHANGED
|
@@ -1,114 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
-
Object.defineProperty(exports,
|
|
4
|
-
exports.Moderations =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Object.defineProperty(exports,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Object.defineProperty(exports,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
var completions_1 = require('./completions.js');
|
|
34
|
-
Object.defineProperty(exports, 'Completions', {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
get: function () {
|
|
37
|
-
return completions_1.Completions;
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
var embeddings_1 = require('./embeddings.js');
|
|
41
|
-
Object.defineProperty(exports, 'Embeddings', {
|
|
42
|
-
enumerable: true,
|
|
43
|
-
get: function () {
|
|
44
|
-
return embeddings_1.Embeddings;
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
var edits_1 = require('./edits.js');
|
|
48
|
-
Object.defineProperty(exports, 'Edits', {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return edits_1.Edits;
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
var files_1 = require('./files.js');
|
|
55
|
-
Object.defineProperty(exports, 'FileObjectsPage', {
|
|
56
|
-
enumerable: true,
|
|
57
|
-
get: function () {
|
|
58
|
-
return files_1.FileObjectsPage;
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
Object.defineProperty(exports, 'Files', {
|
|
62
|
-
enumerable: true,
|
|
63
|
-
get: function () {
|
|
64
|
-
return files_1.Files;
|
|
65
|
-
},
|
|
66
|
-
});
|
|
67
|
-
var fine_tunes_1 = require('./fine-tunes.js');
|
|
68
|
-
Object.defineProperty(exports, 'FineTunesPage', {
|
|
69
|
-
enumerable: true,
|
|
70
|
-
get: function () {
|
|
71
|
-
return fine_tunes_1.FineTunesPage;
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
Object.defineProperty(exports, 'FineTunes', {
|
|
75
|
-
enumerable: true,
|
|
76
|
-
get: function () {
|
|
77
|
-
return fine_tunes_1.FineTunes;
|
|
78
|
-
},
|
|
79
|
-
});
|
|
80
|
-
var fine_tuning_1 = require('./fine-tuning/fine-tuning.js');
|
|
81
|
-
Object.defineProperty(exports, 'FineTuning', {
|
|
82
|
-
enumerable: true,
|
|
83
|
-
get: function () {
|
|
84
|
-
return fine_tuning_1.FineTuning;
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
var images_1 = require('./images.js');
|
|
88
|
-
Object.defineProperty(exports, 'Images', {
|
|
89
|
-
enumerable: true,
|
|
90
|
-
get: function () {
|
|
91
|
-
return images_1.Images;
|
|
92
|
-
},
|
|
93
|
-
});
|
|
94
|
-
var models_1 = require('./models.js');
|
|
95
|
-
Object.defineProperty(exports, 'ModelsPage', {
|
|
96
|
-
enumerable: true,
|
|
97
|
-
get: function () {
|
|
98
|
-
return models_1.ModelsPage;
|
|
99
|
-
},
|
|
100
|
-
});
|
|
101
|
-
Object.defineProperty(exports, 'Models', {
|
|
102
|
-
enumerable: true,
|
|
103
|
-
get: function () {
|
|
104
|
-
return models_1.Models;
|
|
105
|
-
},
|
|
106
|
-
});
|
|
107
|
-
var moderations_1 = require('./moderations.js');
|
|
108
|
-
Object.defineProperty(exports, 'Moderations', {
|
|
109
|
-
enumerable: true,
|
|
110
|
-
get: function () {
|
|
111
|
-
return moderations_1.Moderations;
|
|
112
|
-
},
|
|
113
|
-
});
|
|
114
|
-
//# sourceMappingURL=index.js.map
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Moderations = exports.Models = exports.ModelsPage = exports.Images = exports.FineTuning = exports.FineTunes = exports.FineTunesPage = exports.Files = exports.FileObjectsPage = exports.Edits = exports.Embeddings = exports.Completions = exports.Chat = exports.Audio = void 0;
|
|
5
|
+
var audio_1 = require("./audio/audio.js");
|
|
6
|
+
Object.defineProperty(exports, "Audio", { enumerable: true, get: function () { return audio_1.Audio; } });
|
|
7
|
+
var chat_1 = require("./chat/chat.js");
|
|
8
|
+
Object.defineProperty(exports, "Chat", { enumerable: true, get: function () { return chat_1.Chat; } });
|
|
9
|
+
var completions_1 = require("./completions.js");
|
|
10
|
+
Object.defineProperty(exports, "Completions", { enumerable: true, get: function () { return completions_1.Completions; } });
|
|
11
|
+
var embeddings_1 = require("./embeddings.js");
|
|
12
|
+
Object.defineProperty(exports, "Embeddings", { enumerable: true, get: function () { return embeddings_1.Embeddings; } });
|
|
13
|
+
var edits_1 = require("./edits.js");
|
|
14
|
+
Object.defineProperty(exports, "Edits", { enumerable: true, get: function () { return edits_1.Edits; } });
|
|
15
|
+
var files_1 = require("./files.js");
|
|
16
|
+
Object.defineProperty(exports, "FileObjectsPage", { enumerable: true, get: function () { return files_1.FileObjectsPage; } });
|
|
17
|
+
Object.defineProperty(exports, "Files", { enumerable: true, get: function () { return files_1.Files; } });
|
|
18
|
+
var fine_tunes_1 = require("./fine-tunes.js");
|
|
19
|
+
Object.defineProperty(exports, "FineTunesPage", { enumerable: true, get: function () { return fine_tunes_1.FineTunesPage; } });
|
|
20
|
+
Object.defineProperty(exports, "FineTunes", { enumerable: true, get: function () { return fine_tunes_1.FineTunes; } });
|
|
21
|
+
var fine_tuning_1 = require("./fine-tuning/fine-tuning.js");
|
|
22
|
+
Object.defineProperty(exports, "FineTuning", { enumerable: true, get: function () { return fine_tuning_1.FineTuning; } });
|
|
23
|
+
var images_1 = require("./images.js");
|
|
24
|
+
Object.defineProperty(exports, "Images", { enumerable: true, get: function () { return images_1.Images; } });
|
|
25
|
+
var models_1 = require("./models.js");
|
|
26
|
+
Object.defineProperty(exports, "ModelsPage", { enumerable: true, get: function () { return models_1.ModelsPage; } });
|
|
27
|
+
Object.defineProperty(exports, "Models", { enumerable: true, get: function () { return models_1.Models; } });
|
|
28
|
+
var moderations_1 = require("./moderations.js");
|
|
29
|
+
Object.defineProperty(exports, "Moderations", { enumerable: true, get: function () { return moderations_1.Moderations; } });
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
package/resources/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
-
export { Audio } from
|
|
3
|
-
export { Chat } from
|
|
4
|
-
export { Completions } from
|
|
5
|
-
export { Embeddings } from
|
|
6
|
-
export { Edits } from
|
|
7
|
-
export { FileObjectsPage, Files } from
|
|
8
|
-
export { FineTunesPage, FineTunes } from
|
|
9
|
-
export { FineTuning } from
|
|
10
|
-
export { Images } from
|
|
11
|
-
export { ModelsPage, Models } from
|
|
12
|
-
export { Moderations } from
|
|
13
|
-
//# sourceMappingURL=index.mjs.map
|
|
2
|
+
export { Audio } from "./audio/audio.mjs";
|
|
3
|
+
export { Chat } from "./chat/chat.mjs";
|
|
4
|
+
export { Completions, } from "./completions.mjs";
|
|
5
|
+
export { Embeddings } from "./embeddings.mjs";
|
|
6
|
+
export { Edits } from "./edits.mjs";
|
|
7
|
+
export { FileObjectsPage, Files } from "./files.mjs";
|
|
8
|
+
export { FineTunesPage, FineTunes, } from "./fine-tunes.mjs";
|
|
9
|
+
export { FineTuning } from "./fine-tuning/fine-tuning.mjs";
|
|
10
|
+
export { Images, } from "./images.mjs";
|
|
11
|
+
export { ModelsPage, Models } from "./models.mjs";
|
|
12
|
+
export { Moderations } from "./moderations.mjs";
|
|
13
|
+
//# sourceMappingURL=index.mjs.map
|