@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.
@@ -2398,11 +2398,29 @@ async function convertToOpenAIResponsesInput({
2398
2398
  case "execution-denied":
2399
2399
  contentValue = (_j = output.reason) != null ? _j : "Tool execution denied.";
2400
2400
  break;
2401
- case "content":
2402
2401
  case "json":
2403
2402
  case "error-json":
2404
2403
  contentValue = JSON.stringify(output.value);
2405
2404
  break;
2405
+ case "content":
2406
+ contentValue = output.value.map((item) => {
2407
+ switch (item.type) {
2408
+ case "text": {
2409
+ return { type: "input_text", text: item.text };
2410
+ }
2411
+ case "media": {
2412
+ return item.mediaType.startsWith("image/") ? {
2413
+ type: "input_image",
2414
+ image_url: `data:${item.mediaType};base64,${item.data}`
2415
+ } : {
2416
+ type: "input_file",
2417
+ filename: "data",
2418
+ file_data: `data:${item.mediaType};base64,${item.data}`
2419
+ };
2420
+ }
2421
+ }
2422
+ });
2423
+ break;
2406
2424
  }
2407
2425
  input.push({
2408
2426
  type: "function_call_output",