We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 568c387 + 1f56b8d commit d2f2331Copy full SHA for d2f2331
src/resources/images.ts
@@ -16,7 +16,14 @@ export class Images extends APIResource {
16
* });
17
* ```
18
*/
19
- create(body: ImageCreateParams, options?: RequestOptions): APIPromise<ImageFile> {
+ create<Body extends ImageCreateParams>(
20
+ body: Body,
21
+ options?: RequestOptions,
22
+ ): APIPromise<
23
+ Omit<ImageFile, 'data'> & {
24
+ data: Body['response_format'] extends 'base64' ? ImageDataB64[] : ImageDataURL[];
25
+ }
26
+ > {
27
return this._client.post('/images/generations', { body, ...options });
28
}
29
0 commit comments