@ai-sdk/openai 2.0.46 → 2.0.48

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
@@ -21,7 +21,7 @@ import {
21
21
  } from "@ai-sdk/provider-utils";
22
22
 
23
23
  // src/openai-error.ts
24
- import * as z from "zod/v4";
24
+ import { z } from "zod/v4";
25
25
  import { createJsonErrorResponseHandler } from "@ai-sdk/provider-utils";
26
26
  var openaiErrorDataSchema = z.object({
27
27
  error: z.object({
@@ -254,7 +254,7 @@ import {
254
254
  lazyValidator,
255
255
  zodSchema
256
256
  } from "@ai-sdk/provider-utils";
257
- import * as z2 from "zod/v4";
257
+ import { z as z2 } from "zod/v4";
258
258
  var openaiChatResponseSchema = lazyValidator(
259
259
  () => zodSchema(
260
260
  z2.object({
@@ -395,7 +395,7 @@ import {
395
395
  lazyValidator as lazyValidator2,
396
396
  zodSchema as zodSchema2
397
397
  } from "@ai-sdk/provider-utils";
398
- import * as z3 from "zod/v4";
398
+ import { z as z3 } from "zod/v4";
399
399
  var openaiChatLanguageModelOptions = lazyValidator2(
400
400
  () => zodSchema2(
401
401
  z3.object({
@@ -1213,7 +1213,7 @@ function mapOpenAIFinishReason2(finishReason) {
1213
1213
  }
1214
1214
 
1215
1215
  // src/completion/openai-completion-api.ts
1216
- import * as z4 from "zod/v4";
1216
+ import { z as z4 } from "zod/v4";
1217
1217
  import {
1218
1218
  lazyValidator as lazyValidator3,
1219
1219
  zodSchema as zodSchema3
@@ -1278,7 +1278,7 @@ import {
1278
1278
  lazyValidator as lazyValidator4,
1279
1279
  zodSchema as zodSchema4
1280
1280
  } from "@ai-sdk/provider-utils";
1281
- import * as z5 from "zod/v4";
1281
+ import { z as z5 } from "zod/v4";
1282
1282
  var openaiCompletionProviderOptions = lazyValidator4(
1283
1283
  () => zodSchema4(
1284
1284
  z5.object({
@@ -1570,7 +1570,7 @@ import {
1570
1570
  lazyValidator as lazyValidator5,
1571
1571
  zodSchema as zodSchema5
1572
1572
  } from "@ai-sdk/provider-utils";
1573
- import * as z6 from "zod/v4";
1573
+ import { z as z6 } from "zod/v4";
1574
1574
  var openaiEmbeddingProviderOptions = lazyValidator5(
1575
1575
  () => zodSchema5(
1576
1576
  z6.object({
@@ -1590,7 +1590,7 @@ var openaiEmbeddingProviderOptions = lazyValidator5(
1590
1590
 
1591
1591
  // src/embedding/openai-embedding-api.ts
1592
1592
  import { lazyValidator as lazyValidator6, zodSchema as zodSchema6 } from "@ai-sdk/provider-utils";
1593
- import * as z7 from "zod/v4";
1593
+ import { z as z7 } from "zod/v4";
1594
1594
  var openaiTextEmbeddingResponseSchema = lazyValidator6(
1595
1595
  () => zodSchema6(
1596
1596
  z7.object({
@@ -1673,7 +1673,7 @@ import {
1673
1673
 
1674
1674
  // src/image/openai-image-api.ts
1675
1675
  import { lazyValidator as lazyValidator7, zodSchema as zodSchema7 } from "@ai-sdk/provider-utils";
1676
- import * as z8 from "zod/v4";
1676
+ import { z as z8 } from "zod/v4";
1677
1677
  var openaiImageResponseSchema = lazyValidator7(
1678
1678
  () => zodSchema7(
1679
1679
  z8.object({
@@ -1784,7 +1784,7 @@ import {
1784
1784
  lazySchema,
1785
1785
  zodSchema as zodSchema8
1786
1786
  } from "@ai-sdk/provider-utils";
1787
- import * as z9 from "zod/v4";
1787
+ import { z as z9 } from "zod/v4";
1788
1788
  var codeInterpreterInputSchema = lazySchema(
1789
1789
  () => zodSchema8(
1790
1790
  z9.object({
@@ -1833,7 +1833,7 @@ import {
1833
1833
  lazySchema as lazySchema2,
1834
1834
  zodSchema as zodSchema9
1835
1835
  } from "@ai-sdk/provider-utils";
1836
- import * as z10 from "zod/v4";
1836
+ import { z as z10 } from "zod/v4";
1837
1837
  var comparisonFilterSchema = z10.object({
1838
1838
  key: z10.string(),
1839
1839
  type: z10.enum(["eq", "ne", "gt", "gte", "lt", "lte"]),
@@ -1887,7 +1887,7 @@ import {
1887
1887
  lazySchema as lazySchema3,
1888
1888
  zodSchema as zodSchema10
1889
1889
  } from "@ai-sdk/provider-utils";
1890
- import * as z11 from "zod/v4";
1890
+ import { z as z11 } from "zod/v4";
1891
1891
  var imageGenerationArgsSchema = lazySchema3(
1892
1892
  () => zodSchema10(
1893
1893
  z11.object({
@@ -1927,7 +1927,7 @@ import {
1927
1927
  lazySchema as lazySchema4,
1928
1928
  zodSchema as zodSchema11
1929
1929
  } from "@ai-sdk/provider-utils";
1930
- import * as z12 from "zod/v4";
1930
+ import { z as z12 } from "zod/v4";
1931
1931
  var localShellInputSchema = lazySchema4(
1932
1932
  () => zodSchema11(
1933
1933
  z12.object({
@@ -1958,7 +1958,7 @@ import {
1958
1958
  lazySchema as lazySchema5,
1959
1959
  zodSchema as zodSchema12
1960
1960
  } from "@ai-sdk/provider-utils";
1961
- import * as z13 from "zod/v4";
1961
+ import { z as z13 } from "zod/v4";
1962
1962
  var webSearchArgsSchema = lazySchema5(
1963
1963
  () => zodSchema12(
1964
1964
  z13.object({
@@ -2012,7 +2012,7 @@ import {
2012
2012
  lazySchema as lazySchema6,
2013
2013
  zodSchema as zodSchema13
2014
2014
  } from "@ai-sdk/provider-utils";
2015
- import * as z14 from "zod/v4";
2015
+ import { z as z14 } from "zod/v4";
2016
2016
  var webSearchPreviewArgsSchema = lazySchema6(
2017
2017
  () => zodSchema13(
2018
2018
  z14.object({
@@ -2173,7 +2173,7 @@ import {
2173
2173
  parseProviderOptions as parseProviderOptions4,
2174
2174
  validateTypes
2175
2175
  } from "@ai-sdk/provider-utils";
2176
- import * as z15 from "zod/v4";
2176
+ import { z as z15 } from "zod/v4";
2177
2177
  function isFileId(data, prefixes) {
2178
2178
  if (!prefixes) return false;
2179
2179
  return prefixes.some((prefix) => data.startsWith(prefix));
@@ -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",
@@ -2445,7 +2463,7 @@ import {
2445
2463
  lazyValidator as lazyValidator8,
2446
2464
  zodSchema as zodSchema14
2447
2465
  } from "@ai-sdk/provider-utils";
2448
- import * as z16 from "zod/v4";
2466
+ import { z as z16 } from "zod/v4";
2449
2467
  var openaiResponsesChunkSchema = lazyValidator8(
2450
2468
  () => zodSchema14(
2451
2469
  z16.union([
@@ -2870,7 +2888,7 @@ import {
2870
2888
  lazyValidator as lazyValidator9,
2871
2889
  zodSchema as zodSchema15
2872
2890
  } from "@ai-sdk/provider-utils";
2873
- import * as z17 from "zod/v4";
2891
+ import { z as z17 } from "zod/v4";
2874
2892
  var TOP_LOGPROBS_MAX = 20;
2875
2893
  var openaiResponsesReasoningModelIds = [
2876
2894
  "o1",
@@ -4120,7 +4138,7 @@ import {
4120
4138
  lazyValidator as lazyValidator10,
4121
4139
  zodSchema as zodSchema16
4122
4140
  } from "@ai-sdk/provider-utils";
4123
- import * as z18 from "zod/v4";
4141
+ import { z as z18 } from "zod/v4";
4124
4142
  var openaiSpeechProviderOptionsSchema = lazyValidator10(
4125
4143
  () => zodSchema16(
4126
4144
  z18.object({
@@ -4243,7 +4261,7 @@ import {
4243
4261
 
4244
4262
  // src/transcription/openai-transcription-api.ts
4245
4263
  import { lazyValidator as lazyValidator11, zodSchema as zodSchema17 } from "@ai-sdk/provider-utils";
4246
- import * as z19 from "zod/v4";
4264
+ import { z as z19 } from "zod/v4";
4247
4265
  var openaiTranscriptionResponseSchema = lazyValidator11(
4248
4266
  () => zodSchema17(
4249
4267
  z19.object({
@@ -4280,7 +4298,7 @@ import {
4280
4298
  lazyValidator as lazyValidator12,
4281
4299
  zodSchema as zodSchema18
4282
4300
  } from "@ai-sdk/provider-utils";
4283
- import * as z20 from "zod/v4";
4301
+ import { z as z20 } from "zod/v4";
4284
4302
  var openAITranscriptionProviderOptions = lazyValidator12(
4285
4303
  () => zodSchema18(
4286
4304
  z20.object({
@@ -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.48" : "0.0.0-test";
4482
4500
 
4483
4501
  // src/openai-provider.ts
4484
4502
  function createOpenAI(options = {}) {