@ai-sdk/openai 2.0.47 → 2.0.49

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));
@@ -2463,7 +2463,7 @@ import {
2463
2463
  lazyValidator as lazyValidator8,
2464
2464
  zodSchema as zodSchema14
2465
2465
  } from "@ai-sdk/provider-utils";
2466
- import * as z16 from "zod/v4";
2466
+ import { z as z16 } from "zod/v4";
2467
2467
  var openaiResponsesChunkSchema = lazyValidator8(
2468
2468
  () => zodSchema14(
2469
2469
  z16.union([
@@ -2888,7 +2888,7 @@ import {
2888
2888
  lazyValidator as lazyValidator9,
2889
2889
  zodSchema as zodSchema15
2890
2890
  } from "@ai-sdk/provider-utils";
2891
- import * as z17 from "zod/v4";
2891
+ import { z as z17 } from "zod/v4";
2892
2892
  var TOP_LOGPROBS_MAX = 20;
2893
2893
  var openaiResponsesReasoningModelIds = [
2894
2894
  "o1",
@@ -2953,6 +2953,7 @@ var openaiResponsesProviderOptionsSchema = lazyValidator9(
2953
2953
  include: z17.array(
2954
2954
  z17.enum([
2955
2955
  "reasoning.encrypted_content",
2956
+ // handled internally by default, only needed for unknown reasoning models
2956
2957
  "file_search_call.results",
2957
2958
  "message.output_text.logprobs"
2958
2959
  ])
@@ -3204,7 +3205,11 @@ var OpenAIResponsesLanguageModel = class {
3204
3205
  const strictJsonSchema = (_b = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _b : false;
3205
3206
  let include = openaiOptions == null ? void 0 : openaiOptions.include;
3206
3207
  function addInclude(key) {
3207
- include = include != null ? [...include, key] : [key];
3208
+ if (include == null) {
3209
+ include = [key];
3210
+ } else if (!include.includes(key)) {
3211
+ include = [...include, key];
3212
+ }
3208
3213
  }
3209
3214
  function hasOpenAITool(id) {
3210
3215
  return (tools == null ? void 0 : tools.find(
@@ -3224,6 +3229,10 @@ var OpenAIResponsesLanguageModel = class {
3224
3229
  if (hasOpenAITool("openai.code_interpreter")) {
3225
3230
  addInclude("code_interpreter_call.outputs");
3226
3231
  }
3232
+ const store = openaiOptions == null ? void 0 : openaiOptions.store;
3233
+ if (store === false && modelConfig.isReasoningModel) {
3234
+ addInclude("reasoning.encrypted_content");
3235
+ }
3227
3236
  const baseArgs = {
3228
3237
  model: this.modelId,
3229
3238
  input,
@@ -3251,7 +3260,7 @@ var OpenAIResponsesLanguageModel = class {
3251
3260
  metadata: openaiOptions == null ? void 0 : openaiOptions.metadata,
3252
3261
  parallel_tool_calls: openaiOptions == null ? void 0 : openaiOptions.parallelToolCalls,
3253
3262
  previous_response_id: openaiOptions == null ? void 0 : openaiOptions.previousResponseId,
3254
- store: openaiOptions == null ? void 0 : openaiOptions.store,
3263
+ store,
3255
3264
  user: openaiOptions == null ? void 0 : openaiOptions.user,
3256
3265
  instructions: openaiOptions == null ? void 0 : openaiOptions.instructions,
3257
3266
  service_tier: openaiOptions == null ? void 0 : openaiOptions.serviceTier,
@@ -4138,7 +4147,7 @@ import {
4138
4147
  lazyValidator as lazyValidator10,
4139
4148
  zodSchema as zodSchema16
4140
4149
  } from "@ai-sdk/provider-utils";
4141
- import * as z18 from "zod/v4";
4150
+ import { z as z18 } from "zod/v4";
4142
4151
  var openaiSpeechProviderOptionsSchema = lazyValidator10(
4143
4152
  () => zodSchema16(
4144
4153
  z18.object({
@@ -4261,7 +4270,7 @@ import {
4261
4270
 
4262
4271
  // src/transcription/openai-transcription-api.ts
4263
4272
  import { lazyValidator as lazyValidator11, zodSchema as zodSchema17 } from "@ai-sdk/provider-utils";
4264
- import * as z19 from "zod/v4";
4273
+ import { z as z19 } from "zod/v4";
4265
4274
  var openaiTranscriptionResponseSchema = lazyValidator11(
4266
4275
  () => zodSchema17(
4267
4276
  z19.object({
@@ -4298,7 +4307,7 @@ import {
4298
4307
  lazyValidator as lazyValidator12,
4299
4308
  zodSchema as zodSchema18
4300
4309
  } from "@ai-sdk/provider-utils";
4301
- import * as z20 from "zod/v4";
4310
+ import { z as z20 } from "zod/v4";
4302
4311
  var openAITranscriptionProviderOptions = lazyValidator12(
4303
4312
  () => zodSchema18(
4304
4313
  z20.object({
@@ -4496,7 +4505,7 @@ var OpenAITranscriptionModel = class {
4496
4505
  };
4497
4506
 
4498
4507
  // src/version.ts
4499
- var VERSION = true ? "2.0.47" : "0.0.0-test";
4508
+ var VERSION = true ? "2.0.49" : "0.0.0-test";
4500
4509
 
4501
4510
  // src/openai-provider.ts
4502
4511
  function createOpenAI(options = {}) {