@ai-sdk/openai 3.0.0-beta.30 → 3.0.0-beta.32

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.
@@ -2142,6 +2142,7 @@ import {
2142
2142
  } from "@ai-sdk/provider";
2143
2143
  import {
2144
2144
  convertToBase64 as convertToBase642,
2145
+ isNonNullable,
2145
2146
  parseProviderOptions as parseProviderOptions6,
2146
2147
  validateTypes
2147
2148
  } from "@ai-sdk/provider-utils";
@@ -2422,22 +2423,33 @@ async function convertToOpenAIResponsesInput({
2422
2423
  break;
2423
2424
  case "content":
2424
2425
  contentValue = output.value.map((item) => {
2426
+ var _a2;
2425
2427
  switch (item.type) {
2426
2428
  case "text": {
2427
2429
  return { type: "input_text", text: item.text };
2428
2430
  }
2429
- case "media": {
2430
- return item.mediaType.startsWith("image/") ? {
2431
+ case "image-data": {
2432
+ return {
2431
2433
  type: "input_image",
2432
2434
  image_url: `data:${item.mediaType};base64,${item.data}`
2433
- } : {
2435
+ };
2436
+ }
2437
+ case "file-data": {
2438
+ return {
2434
2439
  type: "input_file",
2435
- filename: "data",
2440
+ filename: (_a2 = item.filename) != null ? _a2 : "data",
2436
2441
  file_data: `data:${item.mediaType};base64,${item.data}`
2437
2442
  };
2438
2443
  }
2444
+ default: {
2445
+ warnings.push({
2446
+ type: "other",
2447
+ message: `unsupported tool content part type: ${item.type}`
2448
+ });
2449
+ return void 0;
2450
+ }
2439
2451
  }
2440
- });
2452
+ }).filter(isNonNullable);
2441
2453
  break;
2442
2454
  }
2443
2455
  input.push({