@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.
@@ -2391,11 +2391,29 @@ async function convertToOpenAIResponsesInput({
2391
2391
  case "error-text":
2392
2392
  contentValue = output.value;
2393
2393
  break;
2394
- case "content":
2395
2394
  case "json":
2396
2395
  case "error-json":
2397
2396
  contentValue = JSON.stringify(output.value);
2398
2397
  break;
2398
+ case "content":
2399
+ contentValue = output.value.map((item) => {
2400
+ switch (item.type) {
2401
+ case "text": {
2402
+ return { type: "input_text", text: item.text };
2403
+ }
2404
+ case "media": {
2405
+ return item.mediaType.startsWith("image/") ? {
2406
+ type: "input_image",
2407
+ image_url: `data:${item.mediaType};base64,${item.data}`
2408
+ } : {
2409
+ type: "input_file",
2410
+ filename: "data",
2411
+ file_data: `data:${item.mediaType};base64,${item.data}`
2412
+ };
2413
+ }
2414
+ }
2415
+ });
2416
+ break;
2399
2417
  }
2400
2418
  input.push({
2401
2419
  type: "function_call_output",