@discomedia/utils 1.0.17 → 1.0.18

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.
@@ -251,7 +251,7 @@ const safeJSON = (text) => {
251
251
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
252
252
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
253
253
 
254
- const VERSION = '5.9.0'; // x-release-please-version
254
+ const VERSION = '5.10.1'; // x-release-please-version
255
255
 
256
256
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
257
257
  const isRunningInBrowser = () => {
@@ -1108,6 +1108,8 @@ class Stream {
1108
1108
  }
1109
1109
  if (sse.event === null ||
1110
1110
  sse.event.startsWith('response.') ||
1111
+ sse.event.startsWith('image_edit.') ||
1112
+ sse.event.startsWith('image_generation.') ||
1111
1113
  sse.event.startsWith('transcript.')) {
1112
1114
  let data;
1113
1115
  try {
@@ -5211,34 +5213,11 @@ class Images extends APIResource {
5211
5213
  createVariation(body, options) {
5212
5214
  return this._client.post('/images/variations', multipartFormRequestOptions({ body, ...options }, this._client));
5213
5215
  }
5214
- /**
5215
- * Creates an edited or extended image given one or more source images and a
5216
- * prompt. This endpoint only supports `gpt-image-1` and `dall-e-2`.
5217
- *
5218
- * @example
5219
- * ```ts
5220
- * const imagesResponse = await client.images.edit({
5221
- * image: fs.createReadStream('path/to/file'),
5222
- * prompt: 'A cute baby sea otter wearing a beret',
5223
- * });
5224
- * ```
5225
- */
5226
5216
  edit(body, options) {
5227
- return this._client.post('/images/edits', multipartFormRequestOptions({ body, ...options }, this._client));
5217
+ return this._client.post('/images/edits', multipartFormRequestOptions({ body, ...options, stream: body.stream ?? false }, this._client));
5228
5218
  }
5229
- /**
5230
- * Creates an image given a prompt.
5231
- * [Learn more](https://platform.openai.com/docs/guides/images).
5232
- *
5233
- * @example
5234
- * ```ts
5235
- * const imagesResponse = await client.images.generate({
5236
- * prompt: 'A cute baby sea otter',
5237
- * });
5238
- * ```
5239
- */
5240
5219
  generate(body, options) {
5241
- return this._client.post('/images/generations', { body, ...options });
5220
+ return this._client.post('/images/generations', { body, ...options, stream: body.stream ?? false });
5242
5221
  }
5243
5222
  }
5244
5223