@ai-sdk/openai 3.0.0-beta.19 → 3.0.0-beta.20

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.
@@ -2424,11 +2424,29 @@ async function convertToOpenAIResponsesInput({
2424
2424
  case "execution-denied":
2425
2425
  contentValue = (_j = output.reason) != null ? _j : "Tool execution denied.";
2426
2426
  break;
2427
- case "content":
2428
2427
  case "json":
2429
2428
  case "error-json":
2430
2429
  contentValue = JSON.stringify(output.value);
2431
2430
  break;
2431
+ case "content":
2432
+ contentValue = output.value.map((item) => {
2433
+ switch (item.type) {
2434
+ case "text": {
2435
+ return { type: "input_text", text: item.text };
2436
+ }
2437
+ case "media": {
2438
+ return item.mediaType.startsWith("image/") ? {
2439
+ type: "input_image",
2440
+ image_url: `data:${item.mediaType};base64,${item.data}`
2441
+ } : {
2442
+ type: "input_file",
2443
+ filename: "data",
2444
+ file_data: `data:${item.mediaType};base64,${item.data}`
2445
+ };
2446
+ }
2447
+ }
2448
+ });
2449
+ break;
2432
2450
  }
2433
2451
  input.push({
2434
2452
  type: "function_call_output",