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