@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.
@@ -13,7 +13,7 @@ import {
13
13
  } from "@ai-sdk/provider-utils";
14
14
 
15
15
  // src/openai-error.ts
16
- import * as z from "zod/v4";
16
+ import { z } from "zod/v4";
17
17
  import { createJsonErrorResponseHandler } from "@ai-sdk/provider-utils";
18
18
  var openaiErrorDataSchema = z.object({
19
19
  error: z.object({
@@ -246,7 +246,7 @@ import {
246
246
  lazyValidator,
247
247
  zodSchema
248
248
  } from "@ai-sdk/provider-utils";
249
- import * as z2 from "zod/v4";
249
+ import { z as z2 } from "zod/v4";
250
250
  var openaiChatResponseSchema = lazyValidator(
251
251
  () => zodSchema(
252
252
  z2.object({
@@ -387,7 +387,7 @@ import {
387
387
  lazyValidator as lazyValidator2,
388
388
  zodSchema as zodSchema2
389
389
  } from "@ai-sdk/provider-utils";
390
- import * as z3 from "zod/v4";
390
+ import { z as z3 } from "zod/v4";
391
391
  var openaiChatLanguageModelOptions = lazyValidator2(
392
392
  () => zodSchema2(
393
393
  z3.object({
@@ -1205,7 +1205,7 @@ function mapOpenAIFinishReason2(finishReason) {
1205
1205
  }
1206
1206
 
1207
1207
  // src/completion/openai-completion-api.ts
1208
- import * as z4 from "zod/v4";
1208
+ import { z as z4 } from "zod/v4";
1209
1209
  import {
1210
1210
  lazyValidator as lazyValidator3,
1211
1211
  zodSchema as zodSchema3
@@ -1270,7 +1270,7 @@ import {
1270
1270
  lazyValidator as lazyValidator4,
1271
1271
  zodSchema as zodSchema4
1272
1272
  } from "@ai-sdk/provider-utils";
1273
- import * as z5 from "zod/v4";
1273
+ import { z as z5 } from "zod/v4";
1274
1274
  var openaiCompletionProviderOptions = lazyValidator4(
1275
1275
  () => zodSchema4(
1276
1276
  z5.object({
@@ -1562,7 +1562,7 @@ import {
1562
1562
  lazyValidator as lazyValidator5,
1563
1563
  zodSchema as zodSchema5
1564
1564
  } from "@ai-sdk/provider-utils";
1565
- import * as z6 from "zod/v4";
1565
+ import { z as z6 } from "zod/v4";
1566
1566
  var openaiEmbeddingProviderOptions = lazyValidator5(
1567
1567
  () => zodSchema5(
1568
1568
  z6.object({
@@ -1582,7 +1582,7 @@ var openaiEmbeddingProviderOptions = lazyValidator5(
1582
1582
 
1583
1583
  // src/embedding/openai-embedding-api.ts
1584
1584
  import { lazyValidator as lazyValidator6, zodSchema as zodSchema6 } from "@ai-sdk/provider-utils";
1585
- import * as z7 from "zod/v4";
1585
+ import { z as z7 } from "zod/v4";
1586
1586
  var openaiTextEmbeddingResponseSchema = lazyValidator6(
1587
1587
  () => zodSchema6(
1588
1588
  z7.object({
@@ -1665,7 +1665,7 @@ import {
1665
1665
 
1666
1666
  // src/image/openai-image-api.ts
1667
1667
  import { lazyValidator as lazyValidator7, zodSchema as zodSchema7 } from "@ai-sdk/provider-utils";
1668
- import * as z8 from "zod/v4";
1668
+ import { z as z8 } from "zod/v4";
1669
1669
  var openaiImageResponseSchema = lazyValidator7(
1670
1670
  () => zodSchema7(
1671
1671
  z8.object({
@@ -1782,7 +1782,7 @@ import {
1782
1782
 
1783
1783
  // src/transcription/openai-transcription-api.ts
1784
1784
  import { lazyValidator as lazyValidator8, zodSchema as zodSchema8 } from "@ai-sdk/provider-utils";
1785
- import * as z9 from "zod/v4";
1785
+ import { z as z9 } from "zod/v4";
1786
1786
  var openaiTranscriptionResponseSchema = lazyValidator8(
1787
1787
  () => zodSchema8(
1788
1788
  z9.object({
@@ -1819,7 +1819,7 @@ import {
1819
1819
  lazyValidator as lazyValidator9,
1820
1820
  zodSchema as zodSchema9
1821
1821
  } from "@ai-sdk/provider-utils";
1822
- import * as z10 from "zod/v4";
1822
+ import { z as z10 } from "zod/v4";
1823
1823
  var openAITranscriptionProviderOptions = lazyValidator9(
1824
1824
  () => zodSchema9(
1825
1825
  z10.object({
@@ -2029,7 +2029,7 @@ import {
2029
2029
  lazyValidator as lazyValidator10,
2030
2030
  zodSchema as zodSchema10
2031
2031
  } from "@ai-sdk/provider-utils";
2032
- import * as z11 from "zod/v4";
2032
+ import { z as z11 } from "zod/v4";
2033
2033
  var openaiSpeechProviderOptionsSchema = lazyValidator10(
2034
2034
  () => zodSchema10(
2035
2035
  z11.object({
@@ -2162,7 +2162,7 @@ import {
2162
2162
  parseProviderOptions as parseProviderOptions6,
2163
2163
  validateTypes
2164
2164
  } from "@ai-sdk/provider-utils";
2165
- import * as z13 from "zod/v4";
2165
+ import { z as z13 } from "zod/v4";
2166
2166
 
2167
2167
  // src/tool/local-shell.ts
2168
2168
  import {
@@ -2170,7 +2170,7 @@ import {
2170
2170
  lazySchema,
2171
2171
  zodSchema as zodSchema11
2172
2172
  } from "@ai-sdk/provider-utils";
2173
- import * as z12 from "zod/v4";
2173
+ import { z as z12 } from "zod/v4";
2174
2174
  var localShellInputSchema = lazySchema(
2175
2175
  () => zodSchema11(
2176
2176
  z12.object({
@@ -2485,7 +2485,7 @@ import {
2485
2485
  lazyValidator as lazyValidator11,
2486
2486
  zodSchema as zodSchema12
2487
2487
  } from "@ai-sdk/provider-utils";
2488
- import * as z14 from "zod/v4";
2488
+ import { z as z14 } from "zod/v4";
2489
2489
  var openaiResponsesChunkSchema = lazyValidator11(
2490
2490
  () => zodSchema12(
2491
2491
  z14.union([
@@ -2910,7 +2910,7 @@ import {
2910
2910
  lazyValidator as lazyValidator12,
2911
2911
  zodSchema as zodSchema13
2912
2912
  } from "@ai-sdk/provider-utils";
2913
- import * as z15 from "zod/v4";
2913
+ import { z as z15 } from "zod/v4";
2914
2914
  var TOP_LOGPROBS_MAX = 20;
2915
2915
  var openaiResponsesReasoningModelIds = [
2916
2916
  "o1",
@@ -2975,6 +2975,7 @@ var openaiResponsesProviderOptionsSchema = lazyValidator12(
2975
2975
  include: z15.array(
2976
2976
  z15.enum([
2977
2977
  "reasoning.encrypted_content",
2978
+ // handled internally by default, only needed for unknown reasoning models
2978
2979
  "file_search_call.results",
2979
2980
  "message.output_text.logprobs"
2980
2981
  ])
@@ -3026,7 +3027,7 @@ import {
3026
3027
  lazySchema as lazySchema2,
3027
3028
  zodSchema as zodSchema14
3028
3029
  } from "@ai-sdk/provider-utils";
3029
- import * as z16 from "zod/v4";
3030
+ import { z as z16 } from "zod/v4";
3030
3031
  var codeInterpreterInputSchema = lazySchema2(
3031
3032
  () => zodSchema14(
3032
3033
  z16.object({
@@ -3075,7 +3076,7 @@ import {
3075
3076
  lazySchema as lazySchema3,
3076
3077
  zodSchema as zodSchema15
3077
3078
  } from "@ai-sdk/provider-utils";
3078
- import * as z17 from "zod/v4";
3079
+ import { z as z17 } from "zod/v4";
3079
3080
  var comparisonFilterSchema = z17.object({
3080
3081
  key: z17.string(),
3081
3082
  type: z17.enum(["eq", "ne", "gt", "gte", "lt", "lte"]),
@@ -3129,7 +3130,7 @@ import {
3129
3130
  lazySchema as lazySchema4,
3130
3131
  zodSchema as zodSchema16
3131
3132
  } from "@ai-sdk/provider-utils";
3132
- import * as z18 from "zod/v4";
3133
+ import { z as z18 } from "zod/v4";
3133
3134
  var webSearchArgsSchema = lazySchema4(
3134
3135
  () => zodSchema16(
3135
3136
  z18.object({
@@ -3180,7 +3181,7 @@ import {
3180
3181
  lazySchema as lazySchema5,
3181
3182
  zodSchema as zodSchema17
3182
3183
  } from "@ai-sdk/provider-utils";
3183
- import * as z19 from "zod/v4";
3184
+ import { z as z19 } from "zod/v4";
3184
3185
  var webSearchPreviewArgsSchema = lazySchema5(
3185
3186
  () => zodSchema17(
3186
3187
  z19.object({
@@ -3252,7 +3253,7 @@ import {
3252
3253
  lazySchema as lazySchema6,
3253
3254
  zodSchema as zodSchema18
3254
3255
  } from "@ai-sdk/provider-utils";
3255
- import * as z20 from "zod/v4";
3256
+ import { z as z20 } from "zod/v4";
3256
3257
  var imageGenerationArgsSchema = lazySchema6(
3257
3258
  () => zodSchema18(
3258
3259
  z20.object({
@@ -3494,7 +3495,11 @@ var OpenAIResponsesLanguageModel = class {
3494
3495
  const strictJsonSchema = (_b = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _b : false;
3495
3496
  let include = openaiOptions == null ? void 0 : openaiOptions.include;
3496
3497
  function addInclude(key) {
3497
- include = include != null ? [...include, key] : [key];
3498
+ if (include == null) {
3499
+ include = [key];
3500
+ } else if (!include.includes(key)) {
3501
+ include = [...include, key];
3502
+ }
3498
3503
  }
3499
3504
  function hasOpenAITool(id) {
3500
3505
  return (tools == null ? void 0 : tools.find(
@@ -3514,6 +3519,10 @@ var OpenAIResponsesLanguageModel = class {
3514
3519
  if (hasOpenAITool("openai.code_interpreter")) {
3515
3520
  addInclude("code_interpreter_call.outputs");
3516
3521
  }
3522
+ const store = openaiOptions == null ? void 0 : openaiOptions.store;
3523
+ if (store === false && modelConfig.isReasoningModel) {
3524
+ addInclude("reasoning.encrypted_content");
3525
+ }
3517
3526
  const baseArgs = {
3518
3527
  model: this.modelId,
3519
3528
  input,
@@ -3541,7 +3550,7 @@ var OpenAIResponsesLanguageModel = class {
3541
3550
  metadata: openaiOptions == null ? void 0 : openaiOptions.metadata,
3542
3551
  parallel_tool_calls: openaiOptions == null ? void 0 : openaiOptions.parallelToolCalls,
3543
3552
  previous_response_id: openaiOptions == null ? void 0 : openaiOptions.previousResponseId,
3544
- store: openaiOptions == null ? void 0 : openaiOptions.store,
3553
+ store,
3545
3554
  user: openaiOptions == null ? void 0 : openaiOptions.user,
3546
3555
  instructions: openaiOptions == null ? void 0 : openaiOptions.instructions,
3547
3556
  service_tier: openaiOptions == null ? void 0 : openaiOptions.serviceTier,