@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.
package/dist/index.mjs CHANGED
@@ -2395,11 +2395,29 @@ async function convertToOpenAIResponsesInput({
2395
2395
  case "error-text":
2396
2396
  contentValue = output.value;
2397
2397
  break;
2398
- case "content":
2399
2398
  case "json":
2400
2399
  case "error-json":
2401
2400
  contentValue = JSON.stringify(output.value);
2402
2401
  break;
2402
+ case "content":
2403
+ contentValue = output.value.map((item) => {
2404
+ switch (item.type) {
2405
+ case "text": {
2406
+ return { type: "input_text", text: item.text };
2407
+ }
2408
+ case "media": {
2409
+ return item.mediaType.startsWith("image/") ? {
2410
+ type: "input_image",
2411
+ image_url: `data:${item.mediaType};base64,${item.data}`
2412
+ } : {
2413
+ type: "input_file",
2414
+ filename: "data",
2415
+ file_data: `data:${item.mediaType};base64,${item.data}`
2416
+ };
2417
+ }
2418
+ }
2419
+ });
2420
+ break;
2403
2421
  }
2404
2422
  input.push({
2405
2423
  type: "function_call_output",
@@ -4478,7 +4496,7 @@ var OpenAITranscriptionModel = class {
4478
4496
  };
4479
4497
 
4480
4498
  // src/version.ts
4481
- var VERSION = true ? "2.0.46" : "0.0.0-test";
4499
+ var VERSION = true ? "2.0.47" : "0.0.0-test";
4482
4500
 
4483
4501
  // src/openai-provider.ts
4484
4502
  function createOpenAI(options = {}) {