@ai-sdk/openai 2.0.46 → 2.0.47

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.
@@ -2417,11 +2417,29 @@ async function convertToOpenAIResponsesInput({
2417
2417
  case "error-text":
2418
2418
  contentValue = output.value;
2419
2419
  break;
2420
- case "content":
2421
2420
  case "json":
2422
2421
  case "error-json":
2423
2422
  contentValue = JSON.stringify(output.value);
2424
2423
  break;
2424
+ case "content":
2425
+ contentValue = output.value.map((item) => {
2426
+ switch (item.type) {
2427
+ case "text": {
2428
+ return { type: "input_text", text: item.text };
2429
+ }
2430
+ case "media": {
2431
+ return item.mediaType.startsWith("image/") ? {
2432
+ type: "input_image",
2433
+ image_url: `data:${item.mediaType};base64,${item.data}`
2434
+ } : {
2435
+ type: "input_file",
2436
+ filename: "data",
2437
+ file_data: `data:${item.mediaType};base64,${item.data}`
2438
+ };
2439
+ }
2440
+ }
2441
+ });
2442
+ break;
2425
2443
  }
2426
2444
  input.push({
2427
2445
  type: "function_call_output",