/
opt
/
canhelp
/
node_modules
/
openai
/
resources
/
/opt/canhelp/node_modules/openai/resources
mkdir
upload
Name
Size
Mode
Actions
audio/
-
0755
rm
beta/
-
0755
rm
chat/
-
0755
rm
containers/
-
0755
rm
conversations/
-
0755
rm
evals/
-
0755
rm
fine-tuning/
-
0755
rm
graders/
-
0755
rm
realtime/
-
0755
rm
responses/
-
0755
rm
skills/
-
0755
rm
uploads/
-
0755
rm
vector-stores/
-
0755
rm
webhooks/
-
0755
rm
audio.d.mts
71
0644
edit
dl
rm
audio.d.mts.map
115
0644
edit
dl
rm
audio.d.ts
69
0644
edit
dl
rm
audio.d.ts.map
114
0644
edit
dl
rm
audio.js
306
0644
edit
dl
rm
audio.js.map
139
0644
edit
dl
rm
audio.mjs
156
0644
edit
dl
rm
audio.mjs.map
124
0644
edit
dl
rm
batches.d.mts
9667
0644
edit
dl
rm
batches.d.mts.map
3499
0644
edit
dl
rm
batches.d.ts
9660
0644
edit
dl
rm
batches.d.ts.map
3498
0644
edit
dl
rm
batches.js
1442
0644
edit
dl
rm
batches.js.map
834
0644
edit
dl
rm
batches.mjs
1269
0644
edit
dl
rm
batches.mjs.map
835
0644
edit
dl
rm
beta.d.mts
69
0644
edit
dl
rm
beta.d.mts.map
113
0644
edit
dl
rm
beta.d.ts
67
0644
edit
dl
rm
beta.d.ts.map
112
0644
edit
dl
rm
beta.js
304
0644
edit
dl
rm
beta.js.map
137
0644
edit
dl
rm
beta.mjs
154
0644
edit
dl
rm
beta.mjs.map
122
0644
edit
dl
rm
chat.d.mts
69
0644
edit
dl
rm
chat.d.mts.map
113
0644
edit
dl
rm
chat.d.ts
67
0644
edit
dl
rm
chat.d.ts.map
112
0644
edit
dl
rm
chat.js
304
0644
edit
dl
rm
chat.js.map
137
0644
edit
dl
rm
chat.mjs
154
0644
edit
dl
rm
chat.mjs.map
122
0644
edit
dl
rm
completions.d.mts
13780
0644
edit
dl
rm
completions.d.mts.map
3829
0644
edit
dl
rm
completions.d.ts
13773
0644
edit
dl
rm
completions.d.ts.map
3828
0644
edit
dl
rm
completions.js
670
0644
edit
dl
rm
completions.js.map
385
0644
edit
dl
rm
completions.mjs
526
0644
edit
dl
rm
completions.mjs.map
382
0644
edit
dl
rm
containers.d.mts
81
0644
edit
dl
rm
containers.d.mts.map
125
0644
edit
dl
rm
containers.d.ts
79
0644
edit
dl
rm
containers.d.ts.map
124
0644
edit
dl
rm
containers.js
316
0644
edit
dl
rm
containers.js.map
149
0644
edit
dl
rm
containers.mjs
166
0644
edit
dl
rm
containers.mjs.map
134
0644
edit
dl
rm
conversations.d.mts
87
0644
edit
dl
rm
conversations.d.mts.map
131
0644
edit
dl
rm
conversations.d.ts
85
0644
edit
dl
rm
conversations.d.ts.map
130
0644
edit
dl
rm
conversations.js
322
0644
edit
dl
rm
conversations.js.map
155
0644
edit
dl
rm
conversations.mjs
172
0644
edit
dl
rm
conversations.mjs.map
140
0644
edit
dl
rm
embeddings.d.mts
4248
0644
edit
dl
rm
embeddings.d.mts.map
1444
0644
edit
dl
rm
embeddings.d.ts
4244
0644
edit
dl
rm
embeddings.d.ts.map
1443
0644
edit
dl
rm
embeddings.js
2610
0644
edit
dl
rm
embeddings.js.map
1264
0644
edit
dl
rm
embeddings.mjs
2448
0644
edit
dl
rm
embeddings.mjs.map
1260
0644
edit
dl
rm
evals.d.mts
71
0644
edit
dl
rm
evals.d.mts.map
115
0644
edit
dl
rm
evals.d.ts
69
0644
edit
dl
rm
evals.d.ts.map
114
0644
edit
dl
rm
evals.js
306
0644
edit
dl
rm
evals.js.map
139
0644
edit
dl
rm
evals.mjs
156
0644
edit
dl
rm
evals.mjs.map
124
0644
edit
dl
rm
files.d.mts
6619
0644
edit
dl
rm
files.d.mts.map
2435
0644
edit
dl
rm
files.d.ts
6613
0644
edit
dl
rm
files.d.ts.map
2434
0644
edit
dl
rm
files.js
3770
0644
edit
dl
rm
files.js.map
1919
0644
edit
dl
rm
files.mjs
3577
0644
edit
dl
rm
files.mjs.map
1934
0644
edit
dl
rm
fine-tuning.d.mts
83
0644
edit
dl
rm
fine-tuning.d.mts.map
127
0644
edit
dl
rm
fine-tuning.d.ts
81
0644
edit
dl
rm
fine-tuning.d.ts.map
126
0644
edit
dl
rm
fine-tuning.js
318
0644
edit
dl
rm
fine-tuning.js.map
151
0644
edit
dl
rm
fine-tuning.mjs
168
0644
edit
dl
rm
fine-tuning.mjs.map
136
0644
edit
dl
rm
graders.d.mts
75
0644
edit
dl
rm
graders.d.mts.map
119
0644
edit
dl
rm
graders.d.ts
73
0644
edit
dl
rm
graders.d.ts.map
118
0644
edit
dl
rm
graders.js
310
0644
edit
dl
rm
graders.js.map
143
0644
edit
dl
rm
graders.mjs
160
0644
edit
dl
rm
graders.mjs.map
128
0644
edit
dl
rm
images.d.mts
26175
0644
edit
dl
rm
images.d.mts.map
8416
0644
edit
dl
rm
images.d.ts
26168
0644
edit
dl
rm
images.d.ts.map
8415
0644
edit
dl
rm
images.js
1280
0644
edit
dl
rm
images.js.map
808
0644
edit
dl
rm
images.mjs
1139
0644
edit
dl
rm
images.mjs.map
804
0644
edit
dl
rm
index.d.mts
3967
0644
edit
dl
rm
index.d.mts.map
2454
0644
edit
dl
rm
index.d.ts
3943
0644
edit
dl
rm
index.d.ts.map
2453
0644
edit
dl
rm
index.js
4210
0644
edit
dl
rm
index.js.map
882
0644
edit
dl
rm
index.mjs
1207
0644
edit
dl
rm
index.mjs.map
557
0644
edit
dl
rm
models.d.mts
1779
0644
edit
dl
rm
models.d.mts.map
995
0644
edit
dl
rm
models.d.ts
1774
0644
edit
dl
rm
models.d.ts.map
994
0644
edit
dl
rm
models.js
1280
0644
edit
dl
rm
models.js.map
645
0644
edit
dl
rm
models.mjs
1104
0644
edit
dl
rm
models.mjs.map
645
0644
edit
dl
rm
moderations.d.mts
10303
0644
edit
dl
rm
moderations.d.mts.map
3527
0644
edit
dl
rm
moderations.d.ts
10299
0644
edit
dl
rm
moderations.d.ts.map
3526
0644
edit
dl
rm
moderations.js
757
0644
edit
dl
rm
moderations.js.map
352
0644
edit
dl
rm
moderations.mjs
613
0644
edit
dl
rm
moderations.mjs.map
351
0644
edit
dl
rm
realtime.d.mts
77
0644
edit
dl
rm
realtime.d.mts.map
121
0644
edit
dl
rm
realtime.d.ts
75
0644
edit
dl
rm
realtime.d.ts.map
120
0644
edit
dl
rm
realtime.js
312
0644
edit
dl
rm
realtime.js.map
145
0644
edit
dl
rm
realtime.mjs
162
0644
edit
dl
rm
realtime.mjs.map
130
0644
edit
dl
rm
responses.d.mts
79
0644
edit
dl
rm
responses.d.mts.map
123
0644
edit
dl
rm
responses.d.ts
77
0644
edit
dl
rm
responses.d.ts.map
122
0644
edit
dl
rm
responses.js
314
0644
edit
dl
rm
responses.js.map
147
0644
edit
dl
rm
responses.mjs
164
0644
edit
dl
rm
responses.mjs.map
132
0644
edit
dl
rm
shared.d.mts
12511
0644
edit
dl
rm
shared.d.mts.map
3990
0644
edit
dl
rm
shared.d.ts
12510
0644
edit
dl
rm
shared.d.ts.map
3989
0644
edit
dl
rm
shared.js
198
0644
edit
dl
rm
shared.js.map
126
0644
edit
dl
rm
shared.mjs
133
0644
edit
dl
rm
shared.mjs.map
126
0644
edit
dl
rm
skills.d.mts
73
0644
edit
dl
rm
skills.d.mts.map
117
0644
edit
dl
rm
skills.d.ts
71
0644
edit
dl
rm
skills.d.ts.map
116
0644
edit
dl
rm
skills.js
308
0644
edit
dl
rm
skills.js.map
141
0644
edit
dl
rm
skills.mjs
158
0644
edit
dl
rm
skills.mjs.map
126
0644
edit
dl
rm
uploads.d.mts
75
0644
edit
dl
rm
uploads.d.mts.map
119
0644
edit
dl
rm
uploads.d.ts
73
0644
edit
dl
rm
uploads.d.ts.map
118
0644
edit
dl
rm
uploads.js
310
0644
edit
dl
rm
uploads.js.map
143
0644
edit
dl
rm
uploads.mjs
160
0644
edit
dl
rm
uploads.mjs.map
128
0644
edit
dl
rm
vector-stores.d.mts
87
0644
edit
dl
rm
vector-stores.d.mts.map
131
0644
edit
dl
rm
vector-stores.d.ts
85
0644
edit
dl
rm
vector-stores.d.ts.map
130
0644
edit
dl
rm
vector-stores.js
322
0644
edit
dl
rm
vector-stores.js.map
155
0644
edit
dl
rm
vector-stores.mjs
172
0644
edit
dl
rm
vector-stores.mjs.map
140
0644
edit
dl
rm
videos.d.mts
9152
0644
edit
dl
rm
videos.d.mts.map
4543
0644
edit
dl
rm
videos.d.ts
9146
0644
edit
dl
rm
videos.d.ts.map
4542
0644
edit
dl
rm
videos.js
3194
0644
edit
dl
rm
videos.js.map
2135
0644
edit
dl
rm
videos.mjs
2965
0644
edit
dl
rm
videos.mjs.map
2123
0644
edit
dl
rm
webhooks.d.mts
77
0644
edit
dl
rm
webhooks.d.mts.map
121
0644
edit
dl
rm
webhooks.d.ts
75
0644
edit
dl
rm
webhooks.d.ts.map
120
0644
edit
dl
rm
webhooks.js
312
0644
edit
dl
rm
webhooks.js.map
145
0644
edit
dl
rm
webhooks.mjs
162
0644
edit
dl
rm
webhooks.mjs.map
130
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/openai/resources/images.d.mts
(26175B)
import { APIResource } from "../core/resource.mjs"; import * as ImagesAPI from "./images.mjs"; import { APIPromise } from "../core/api-promise.mjs"; import { Stream } from "../core/streaming.mjs"; import { type Uploadable } from "../core/uploads.mjs"; import { RequestOptions } from "../internal/request-options.mjs"; /** * Given a prompt and/or an input image, the model will generate a new image. */ export declare class Images extends APIResource { /** * Creates a variation of a given image. This endpoint only supports `dall-e-2`. * * @example * ```ts * const imagesResponse = await client.images.createVariation({ * image: fs.createReadStream('otter.png'), * }); * ``` */ createVariation(body: ImageCreateVariationParams, options?: RequestOptions): APIPromise<ImagesResponse>; /** * Creates an edited or extended image given one or more source images and a * prompt. This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, * `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`. * * @example * ```ts * const imagesResponse = await client.images.edit({ * image: fs.createReadStream('path/to/file'), * prompt: 'A cute baby sea otter wearing a beret', * }); * ``` */ edit(body: ImageEditParamsNonStreaming, options?: RequestOptions): APIPromise<ImagesResponse>; edit(body: ImageEditParamsStreaming, options?: RequestOptions): APIPromise<Stream<ImageEditStreamEvent>>; edit(body: ImageEditParamsBase, options?: RequestOptions): APIPromise<Stream<ImageEditStreamEvent> | ImagesResponse>; /** * Creates an image given a prompt. * [Learn more](https://platform.openai.com/docs/guides/images). * * @example * ```ts * const imagesResponse = await client.images.generate({ * prompt: 'A cute baby sea otter', * }); * ``` */ generate(body: ImageGenerateParamsNonStreaming, options?: RequestOptions): APIPromise<ImagesResponse>; generate(body: ImageGenerateParamsStreaming, options?: RequestOptions): APIPromise<Stream<ImageGenStreamEvent>>; generate(body: ImageGenerateParamsBase, options?: RequestOptions): APIPromise<Stream<ImageGenStreamEvent> | ImagesResponse>; } /** * Represents the content or the URL of an image generated by the OpenAI API. */ export interface Image { /** * The base64-encoded JSON of the generated image. Returned by default for the GPT * image models, and only present if `response_format` is set to `b64_json` for * `dall-e-2` and `dall-e-3`. */ b64_json?: string; /** * For `dall-e-3` only, the revised prompt that was used to generate the image. */ revised_prompt?: string; /** * When using `dall-e-2` or `dall-e-3`, the URL of the generated image if * `response_format` is set to `url` (default value). Unsupported for the GPT image * models. */ url?: string; } /** * Emitted when image editing has completed and the final image is available. */ export interface ImageEditCompletedEvent { /** * Base64-encoded final edited image data, suitable for rendering as an image. */ b64_json: string; /** * The background setting for the edited image. */ background: 'transparent' | 'opaque' | 'auto'; /** * The Unix timestamp when the event was created. */ created_at: number; /** * The output format for the edited image. */ output_format: 'png' | 'webp' | 'jpeg'; /** * The quality setting for the edited image. */ quality: 'low' | 'medium' | 'high' | 'auto'; /** * The size of the edited image. */ size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; /** * The type of the event. Always `image_edit.completed`. */ type: 'image_edit.completed'; /** * For the GPT image models only, the token usage information for the image * generation. */ usage: ImageEditCompletedEvent.Usage; } export declare namespace ImageEditCompletedEvent { /** * For the GPT image models only, the token usage information for the image * generation. */ interface Usage { /** * The number of tokens (images and text) in the input prompt. */ input_tokens: number; /** * The input tokens detailed information for the image generation. */ input_tokens_details: Usage.InputTokensDetails; /** * The number of image tokens in the output image. */ output_tokens: number; /** * The total number of tokens (images and text) used for the image generation. */ total_tokens: number; } namespace Usage { /** * The input tokens detailed information for the image generation. */ interface InputTokensDetails { /** * The number of image tokens in the input prompt. */ image_tokens: number; /** * The number of text tokens in the input prompt. */ text_tokens: number; } } } /** * Emitted when a partial image is available during image editing streaming. */ export interface ImageEditPartialImageEvent { /** * Base64-encoded partial image data, suitable for rendering as an image. */ b64_json: string; /** * The background setting for the requested edited image. */ background: 'transparent' | 'opaque' | 'auto'; /** * The Unix timestamp when the event was created. */ created_at: number; /** * The output format for the requested edited image. */ output_format: 'png' | 'webp' | 'jpeg'; /** * 0-based index for the partial image (streaming). */ partial_image_index: number; /** * The quality setting for the requested edited image. */ quality: 'low' | 'medium' | 'high' | 'auto'; /** * The size of the requested edited image. */ size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; /** * The type of the event. Always `image_edit.partial_image`. */ type: 'image_edit.partial_image'; } /** * Emitted when a partial image is available during image editing streaming. */ export type ImageEditStreamEvent = ImageEditPartialImageEvent | ImageEditCompletedEvent; /** * Emitted when image generation has completed and the final image is available. */ export interface ImageGenCompletedEvent { /** * Base64-encoded image data, suitable for rendering as an image. */ b64_json: string; /** * The background setting for the generated image. */ background: 'transparent' | 'opaque' | 'auto'; /** * The Unix timestamp when the event was created. */ created_at: number; /** * The output format for the generated image. */ output_format: 'png' | 'webp' | 'jpeg'; /** * The quality setting for the generated image. */ quality: 'low' | 'medium' | 'high' | 'auto'; /** * The size of the generated image. */ size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; /** * The type of the event. Always `image_generation.completed`. */ type: 'image_generation.completed'; /** * For the GPT image models only, the token usage information for the image * generation. */ usage: ImageGenCompletedEvent.Usage; } export declare namespace ImageGenCompletedEvent { /** * For the GPT image models only, the token usage information for the image * generation. */ interface Usage { /** * The number of tokens (images and text) in the input prompt. */ input_tokens: number; /** * The input tokens detailed information for the image generation. */ input_tokens_details: Usage.InputTokensDetails; /** * The number of image tokens in the output image. */ output_tokens: number; /** * The total number of tokens (images and text) used for the image generation. */ total_tokens: number; } namespace Usage { /** * The input tokens detailed information for the image generation. */ interface InputTokensDetails { /** * The number of image tokens in the input prompt. */ image_tokens: number; /** * The number of text tokens in the input prompt. */ text_tokens: number; } } } /** * Emitted when a partial image is available during image generation streaming. */ export interface ImageGenPartialImageEvent { /** * Base64-encoded partial image data, suitable for rendering as an image. */ b64_json: string; /** * The background setting for the requested image. */ background: 'transparent' | 'opaque' | 'auto'; /** * The Unix timestamp when the event was created. */ created_at: number; /** * The output format for the requested image. */ output_format: 'png' | 'webp' | 'jpeg'; /** * 0-based index for the partial image (streaming). */ partial_image_index: number; /** * The quality setting for the requested image. */ quality: 'low' | 'medium' | 'high' | 'auto'; /** * The size of the requested image. */ size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; /** * The type of the event. Always `image_generation.partial_image`. */ type: 'image_generation.partial_image'; } /** * Emitted when a partial image is available during image generation streaming. */ export type ImageGenStreamEvent = ImageGenPartialImageEvent | ImageGenCompletedEvent; export type ImageModel = 'gpt-image-1.5' | 'dall-e-2' | 'dall-e-3' | 'gpt-image-1' | 'gpt-image-1-mini'; /** * The response from the image generation endpoint. */ export interface ImagesResponse { /** * The Unix timestamp (in seconds) of when the image was created. */ created: number; /** * The background parameter used for the image generation. Either `transparent` or * `opaque`. */ background?: 'transparent' | 'opaque'; /** * The list of generated images. */ data?: Array<Image>; /** * The output format of the image generation. Either `png`, `webp`, or `jpeg`. */ output_format?: 'png' | 'webp' | 'jpeg'; /** * The quality of the image generated. Either `low`, `medium`, or `high`. */ quality?: 'low' | 'medium' | 'high'; /** * The size of the image generated. Either `1024x1024`, `1024x1536`, or * `1536x1024`. */ size?: '1024x1024' | '1024x1536' | '1536x1024'; /** * For `gpt-image-1` only, the token usage information for the image generation. */ usage?: ImagesResponse.Usage; } export declare namespace ImagesResponse { /** * For `gpt-image-1` only, the token usage information for the image generation. */ interface Usage { /** * The number of tokens (images and text) in the input prompt. */ input_tokens: number; /** * The input tokens detailed information for the image generation. */ input_tokens_details: Usage.InputTokensDetails; /** * The number of output tokens generated by the model. */ output_tokens: number; /** * The total number of tokens (images and text) used for the image generation. */ total_tokens: number; /** * The output token details for the image generation. */ output_tokens_details?: Usage.OutputTokensDetails; } namespace Usage { /** * The input tokens detailed information for the image generation. */ interface InputTokensDetails { /** * The number of image tokens in the input prompt. */ image_tokens: number; /** * The number of text tokens in the input prompt. */ text_tokens: number; } /** * The output token details for the image generation. */ interface OutputTokensDetails { /** * The number of image output tokens generated by the model. */ image_tokens: number; /** * The number of text output tokens generated by the model. */ text_tokens: number; } } } export interface ImageCreateVariationParams { /** * The image to use as the basis for the variation(s). Must be a valid PNG file, * less than 4MB, and square. */ image: Uploadable; /** * The model to use for image generation. Only `dall-e-2` is supported at this * time. */ model?: (string & {}) | ImageModel | null; /** * The number of images to generate. Must be between 1 and 10. */ n?: number | null; /** * The format in which the generated images are returned. Must be one of `url` or * `b64_json`. URLs are only valid for 60 minutes after the image has been * generated. */ response_format?: 'url' | 'b64_json' | null; /** * The size of the generated images. Must be one of `256x256`, `512x512`, or * `1024x1024`. */ size?: '256x256' | '512x512' | '1024x1024' | null; /** * A unique identifier representing your end-user, which can help OpenAI to monitor * and detect abuse. * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). */ user?: string; } export type ImageEditParams = ImageEditParamsNonStreaming | ImageEditParamsStreaming; export interface ImageEditParamsBase { /** * The image(s) to edit. Must be a supported image file or an array of images. * * For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and * `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg` file less than * 50MB. You can provide up to 16 images. `chatgpt-image-latest` follows the same * input constraints as GPT image models. * * For `dall-e-2`, you can only provide one image, and it should be a square `png` * file less than 4MB. */ image: Uploadable | Array<Uploadable>; /** * A text description of the desired image(s). The maximum length is 1000 * characters for `dall-e-2`, and 32000 characters for the GPT image models. */ prompt: string; /** * Allows to set transparency for the background of the generated image(s). This * parameter is only supported for the GPT image models. Must be one of * `transparent`, `opaque` or `auto` (default value). When `auto` is used, the * model will automatically determine the best background for the image. * * If `transparent`, the output format needs to support transparency, so it should * be set to either `png` (default value) or `webp`. */ background?: 'transparent' | 'opaque' | 'auto' | null; /** * Control how much effort the model will exert to match the style and features, * especially facial features, of input images. This parameter is only supported * for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for * `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. */ input_fidelity?: 'high' | 'low' | null; /** * An additional image whose fully transparent areas (e.g. where alpha is zero) * indicate where `image` should be edited. If there are multiple images provided, * the mask will be applied on the first image. Must be a valid PNG file, less than * 4MB, and have the same dimensions as `image`. */ mask?: Uploadable; /** * The model to use for image generation. Defaults to `gpt-image-1.5`. */ model?: (string & {}) | ImageModel | null; /** * The number of images to generate. Must be between 1 and 10. */ n?: number | null; /** * The compression level (0-100%) for the generated images. This parameter is only * supported for the GPT image models with the `webp` or `jpeg` output formats, and * defaults to 100. */ output_compression?: number | null; /** * The format in which the generated images are returned. This parameter is only * supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The * default value is `png`. */ output_format?: 'png' | 'jpeg' | 'webp' | null; /** * The number of partial images to generate. This parameter is used for streaming * responses that return partial images. Value must be between 0 and 3. When set to * 0, the response will be a single image sent in one streaming event. * * Note that the final image may be sent before the full number of partial images * are generated if the full image is generated more quickly. */ partial_images?: number | null; /** * The quality of the image that will be generated for GPT image models. Defaults * to `auto`. */ quality?: 'standard' | 'low' | 'medium' | 'high' | 'auto' | null; /** * The format in which the generated images are returned. Must be one of `url` or * `b64_json`. URLs are only valid for 60 minutes after the image has been * generated. This parameter is only supported for `dall-e-2` (default is `url` for * `dall-e-2`), as GPT image models always return base64-encoded images. */ response_format?: 'url' | 'b64_json' | null; /** * The size of the generated images. Must be one of `1024x1024`, `1536x1024` * (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image * models, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. */ size?: '256x256' | '512x512' | '1024x1024' | '1536x1024' | '1024x1536' | 'auto' | null; /** * Edit the image in streaming mode. Defaults to `false`. See the * [Image generation guide](https://platform.openai.com/docs/guides/image-generation) * for more information. */ stream?: boolean | null; /** * A unique identifier representing your end-user, which can help OpenAI to monitor * and detect abuse. * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). */ user?: string; } export declare namespace ImageEditParams { type ImageEditParamsNonStreaming = ImagesAPI.ImageEditParamsNonStreaming; type ImageEditParamsStreaming = ImagesAPI.ImageEditParamsStreaming; } export interface ImageEditParamsNonStreaming extends ImageEditParamsBase { /** * Edit the image in streaming mode. Defaults to `false`. See the * [Image generation guide](https://platform.openai.com/docs/guides/image-generation) * for more information. */ stream?: false | null; } export interface ImageEditParamsStreaming extends ImageEditParamsBase { /** * Edit the image in streaming mode. Defaults to `false`. See the * [Image generation guide](https://platform.openai.com/docs/guides/image-generation) * for more information. */ stream: true; } export type ImageGenerateParams = ImageGenerateParamsNonStreaming | ImageGenerateParamsStreaming; export interface ImageGenerateParamsBase { /** * A text description of the desired image(s). The maximum length is 32000 * characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 * characters for `dall-e-3`. */ prompt: string; /** * Allows to set transparency for the background of the generated image(s). This * parameter is only supported for the GPT image models. Must be one of * `transparent`, `opaque` or `auto` (default value). When `auto` is used, the * model will automatically determine the best background for the image. * * If `transparent`, the output format needs to support transparency, so it should * be set to either `png` (default value) or `webp`. */ background?: 'transparent' | 'opaque' | 'auto' | null; /** * The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT * image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to * `dall-e-2` unless a parameter specific to the GPT image models is used. */ model?: (string & {}) | ImageModel | null; /** * Control the content-moderation level for images generated by the GPT image * models. Must be either `low` for less restrictive filtering or `auto` (default * value). */ moderation?: 'low' | 'auto' | null; /** * The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only * `n=1` is supported. */ n?: number | null; /** * The compression level (0-100%) for the generated images. This parameter is only * supported for the GPT image models with the `webp` or `jpeg` output formats, and * defaults to 100. */ output_compression?: number | null; /** * The format in which the generated images are returned. This parameter is only * supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. */ output_format?: 'png' | 'jpeg' | 'webp' | null; /** * The number of partial images to generate. This parameter is used for streaming * responses that return partial images. Value must be between 0 and 3. When set to * 0, the response will be a single image sent in one streaming event. * * Note that the final image may be sent before the full number of partial images * are generated if the full image is generated more quickly. */ partial_images?: number | null; /** * The quality of the image that will be generated. * * - `auto` (default value) will automatically select the best quality for the * given model. * - `high`, `medium` and `low` are supported for the GPT image models. * - `hd` and `standard` are supported for `dall-e-3`. * - `standard` is the only option for `dall-e-2`. */ quality?: 'standard' | 'hd' | 'low' | 'medium' | 'high' | 'auto' | null; /** * The format in which generated images with `dall-e-2` and `dall-e-3` are * returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes * after the image has been generated. This parameter isn't supported for the GPT * image models, which always return base64-encoded images. */ response_format?: 'url' | 'b64_json' | null; /** * The size of the generated images. Must be one of `1024x1024`, `1536x1024` * (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image * models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of * `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. */ size?: 'auto' | '1024x1024' | '1536x1024' | '1024x1536' | '256x256' | '512x512' | '1792x1024' | '1024x1792' | null; /** * Generate the image in streaming mode. Defaults to `false`. See the * [Image generation guide](https://platform.openai.com/docs/guides/image-generation) * for more information. This parameter is only supported for the GPT image models. */ stream?: boolean | null; /** * The style of the generated images. This parameter is only supported for * `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean * towards generating hyper-real and dramatic images. Natural causes the model to * produce more natural, less hyper-real looking images. */ style?: 'vivid' | 'natural' | null; /** * A unique identifier representing your end-user, which can help OpenAI to monitor * and detect abuse. * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). */ user?: string; } export declare namespace ImageGenerateParams { type ImageGenerateParamsNonStreaming = ImagesAPI.ImageGenerateParamsNonStreaming; type ImageGenerateParamsStreaming = ImagesAPI.ImageGenerateParamsStreaming; } export interface ImageGenerateParamsNonStreaming extends ImageGenerateParamsBase { /** * Generate the image in streaming mode. Defaults to `false`. See the * [Image generation guide](https://platform.openai.com/docs/guides/image-generation) * for more information. This parameter is only supported for the GPT image models. */ stream?: false | null; } export interface ImageGenerateParamsStreaming extends ImageGenerateParamsBase { /** * Generate the image in streaming mode. Defaults to `false`. See the * [Image generation guide](https://platform.openai.com/docs/guides/image-generation) * for more information. This parameter is only supported for the GPT image models. */ stream: true; } export declare namespace Images { export { type Image as Image, type ImageEditCompletedEvent as ImageEditCompletedEvent, type ImageEditPartialImageEvent as ImageEditPartialImageEvent, type ImageEditStreamEvent as ImageEditStreamEvent, type ImageGenCompletedEvent as ImageGenCompletedEvent, type ImageGenPartialImageEvent as ImageGenPartialImageEvent, type ImageGenStreamEvent as ImageGenStreamEvent, type ImageModel as ImageModel, type ImagesResponse as ImagesResponse, type ImageCreateVariationParams as ImageCreateVariationParams, type ImageEditParams as ImageEditParams, type ImageEditParamsNonStreaming as ImageEditParamsNonStreaming, type ImageEditParamsStreaming as ImageEditParamsStreaming, type ImageGenerateParams as ImageGenerateParams, type ImageGenerateParamsNonStreaming as ImageGenerateParamsNonStreaming, type ImageGenerateParamsStreaming as ImageGenerateParamsStreaming, }; } //# sourceMappingURL=images.d.mts.map
Save
cmd:
run