@ai-sdk/openai 3.0.0-beta.24 → 3.0.0-beta.26

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
@@ -254,12 +254,9 @@ function mapOpenAIFinishReason(finishReason) {
254
254
  }
255
255
 
256
256
  // src/chat/openai-chat-api.ts
257
- import {
258
- lazyValidator,
259
- zodSchema
260
- } from "@ai-sdk/provider-utils";
257
+ import { lazySchema, zodSchema } from "@ai-sdk/provider-utils";
261
258
  import { z as z2 } from "zod/v4";
262
- var openaiChatResponseSchema = lazyValidator(
259
+ var openaiChatResponseSchema = lazySchema(
263
260
  () => zodSchema(
264
261
  z2.object({
265
262
  id: z2.string().nullish(),
@@ -324,7 +321,7 @@ var openaiChatResponseSchema = lazyValidator(
324
321
  })
325
322
  )
326
323
  );
327
- var openaiChatChunkSchema = lazyValidator(
324
+ var openaiChatChunkSchema = lazySchema(
328
325
  () => zodSchema(
329
326
  z2.union([
330
327
  z2.object({
@@ -395,12 +392,9 @@ var openaiChatChunkSchema = lazyValidator(
395
392
  );
396
393
 
397
394
  // src/chat/openai-chat-options.ts
398
- import {
399
- lazyValidator as lazyValidator2,
400
- zodSchema as zodSchema2
401
- } from "@ai-sdk/provider-utils";
395
+ import { lazySchema as lazySchema2, zodSchema as zodSchema2 } from "@ai-sdk/provider-utils";
402
396
  import { z as z3 } from "zod/v4";
403
- var openaiChatLanguageModelOptions = lazyValidator2(
397
+ var openaiChatLanguageModelOptions = lazySchema2(
404
398
  () => zodSchema2(
405
399
  z3.object({
406
400
  /**
@@ -1218,11 +1212,8 @@ function mapOpenAIFinishReason2(finishReason) {
1218
1212
 
1219
1213
  // src/completion/openai-completion-api.ts
1220
1214
  import { z as z4 } from "zod/v4";
1221
- import {
1222
- lazyValidator as lazyValidator3,
1223
- zodSchema as zodSchema3
1224
- } from "@ai-sdk/provider-utils";
1225
- var openaiCompletionResponseSchema = lazyValidator3(
1215
+ import { lazySchema as lazySchema3, zodSchema as zodSchema3 } from "@ai-sdk/provider-utils";
1216
+ var openaiCompletionResponseSchema = lazySchema3(
1226
1217
  () => zodSchema3(
1227
1218
  z4.object({
1228
1219
  id: z4.string().nullish(),
@@ -1247,7 +1238,7 @@ var openaiCompletionResponseSchema = lazyValidator3(
1247
1238
  })
1248
1239
  )
1249
1240
  );
1250
- var openaiCompletionChunkSchema = lazyValidator3(
1241
+ var openaiCompletionChunkSchema = lazySchema3(
1251
1242
  () => zodSchema3(
1252
1243
  z4.union([
1253
1244
  z4.object({
@@ -1278,12 +1269,9 @@ var openaiCompletionChunkSchema = lazyValidator3(
1278
1269
  );
1279
1270
 
1280
1271
  // src/completion/openai-completion-options.ts
1281
- import {
1282
- lazyValidator as lazyValidator4,
1283
- zodSchema as zodSchema4
1284
- } from "@ai-sdk/provider-utils";
1272
+ import { lazySchema as lazySchema4, zodSchema as zodSchema4 } from "@ai-sdk/provider-utils";
1285
1273
  import { z as z5 } from "zod/v4";
1286
- var openaiCompletionProviderOptions = lazyValidator4(
1274
+ var openaiCompletionProviderOptions = lazySchema4(
1287
1275
  () => zodSchema4(
1288
1276
  z5.object({
1289
1277
  /**
@@ -1570,12 +1558,9 @@ import {
1570
1558
  } from "@ai-sdk/provider-utils";
1571
1559
 
1572
1560
  // src/embedding/openai-embedding-options.ts
1573
- import {
1574
- lazyValidator as lazyValidator5,
1575
- zodSchema as zodSchema5
1576
- } from "@ai-sdk/provider-utils";
1561
+ import { lazySchema as lazySchema5, zodSchema as zodSchema5 } from "@ai-sdk/provider-utils";
1577
1562
  import { z as z6 } from "zod/v4";
1578
- var openaiEmbeddingProviderOptions = lazyValidator5(
1563
+ var openaiEmbeddingProviderOptions = lazySchema5(
1579
1564
  () => zodSchema5(
1580
1565
  z6.object({
1581
1566
  /**
@@ -1593,9 +1578,9 @@ var openaiEmbeddingProviderOptions = lazyValidator5(
1593
1578
  );
1594
1579
 
1595
1580
  // src/embedding/openai-embedding-api.ts
1596
- import { lazyValidator as lazyValidator6, zodSchema as zodSchema6 } from "@ai-sdk/provider-utils";
1581
+ import { lazySchema as lazySchema6, zodSchema as zodSchema6 } from "@ai-sdk/provider-utils";
1597
1582
  import { z as z7 } from "zod/v4";
1598
- var openaiTextEmbeddingResponseSchema = lazyValidator6(
1583
+ var openaiTextEmbeddingResponseSchema = lazySchema6(
1599
1584
  () => zodSchema6(
1600
1585
  z7.object({
1601
1586
  data: z7.array(z7.object({ embedding: z7.array(z7.number()) })),
@@ -1676,9 +1661,9 @@ import {
1676
1661
  } from "@ai-sdk/provider-utils";
1677
1662
 
1678
1663
  // src/image/openai-image-api.ts
1679
- import { lazyValidator as lazyValidator7, zodSchema as zodSchema7 } from "@ai-sdk/provider-utils";
1664
+ import { lazySchema as lazySchema7, zodSchema as zodSchema7 } from "@ai-sdk/provider-utils";
1680
1665
  import { z as z8 } from "zod/v4";
1681
- var openaiImageResponseSchema = lazyValidator7(
1666
+ var openaiImageResponseSchema = lazySchema7(
1682
1667
  () => zodSchema7(
1683
1668
  z8.object({
1684
1669
  data: z8.array(
@@ -1785,11 +1770,11 @@ var OpenAIImageModel = class {
1785
1770
  // src/tool/code-interpreter.ts
1786
1771
  import {
1787
1772
  createProviderDefinedToolFactoryWithOutputSchema,
1788
- lazySchema,
1773
+ lazySchema as lazySchema8,
1789
1774
  zodSchema as zodSchema8
1790
1775
  } from "@ai-sdk/provider-utils";
1791
1776
  import { z as z9 } from "zod/v4";
1792
- var codeInterpreterInputSchema = lazySchema(
1777
+ var codeInterpreterInputSchema = lazySchema8(
1793
1778
  () => zodSchema8(
1794
1779
  z9.object({
1795
1780
  code: z9.string().nullish(),
@@ -1797,7 +1782,7 @@ var codeInterpreterInputSchema = lazySchema(
1797
1782
  })
1798
1783
  )
1799
1784
  );
1800
- var codeInterpreterOutputSchema = lazySchema(
1785
+ var codeInterpreterOutputSchema = lazySchema8(
1801
1786
  () => zodSchema8(
1802
1787
  z9.object({
1803
1788
  outputs: z9.array(
@@ -1809,7 +1794,7 @@ var codeInterpreterOutputSchema = lazySchema(
1809
1794
  })
1810
1795
  )
1811
1796
  );
1812
- var codeInterpreterArgsSchema = lazySchema(
1797
+ var codeInterpreterArgsSchema = lazySchema8(
1813
1798
  () => zodSchema8(
1814
1799
  z9.object({
1815
1800
  container: z9.union([
@@ -1834,7 +1819,7 @@ var codeInterpreter = (args = {}) => {
1834
1819
  // src/tool/file-search.ts
1835
1820
  import {
1836
1821
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema2,
1837
- lazySchema as lazySchema2,
1822
+ lazySchema as lazySchema9,
1838
1823
  zodSchema as zodSchema9
1839
1824
  } from "@ai-sdk/provider-utils";
1840
1825
  import { z as z10 } from "zod/v4";
@@ -1849,7 +1834,7 @@ var compoundFilterSchema = z10.object({
1849
1834
  z10.union([comparisonFilterSchema, z10.lazy(() => compoundFilterSchema)])
1850
1835
  )
1851
1836
  });
1852
- var fileSearchArgsSchema = lazySchema2(
1837
+ var fileSearchArgsSchema = lazySchema9(
1853
1838
  () => zodSchema9(
1854
1839
  z10.object({
1855
1840
  vectorStoreIds: z10.array(z10.string()),
@@ -1862,7 +1847,7 @@ var fileSearchArgsSchema = lazySchema2(
1862
1847
  })
1863
1848
  )
1864
1849
  );
1865
- var fileSearchOutputSchema = lazySchema2(
1850
+ var fileSearchOutputSchema = lazySchema9(
1866
1851
  () => zodSchema9(
1867
1852
  z10.object({
1868
1853
  queries: z10.array(z10.string()),
@@ -1888,11 +1873,11 @@ var fileSearch = createProviderDefinedToolFactoryWithOutputSchema2({
1888
1873
  // src/tool/image-generation.ts
1889
1874
  import {
1890
1875
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema3,
1891
- lazySchema as lazySchema3,
1876
+ lazySchema as lazySchema10,
1892
1877
  zodSchema as zodSchema10
1893
1878
  } from "@ai-sdk/provider-utils";
1894
1879
  import { z as z11 } from "zod/v4";
1895
- var imageGenerationArgsSchema = lazySchema3(
1880
+ var imageGenerationArgsSchema = lazySchema10(
1896
1881
  () => zodSchema10(
1897
1882
  z11.object({
1898
1883
  background: z11.enum(["auto", "opaque", "transparent"]).optional(),
@@ -1911,8 +1896,8 @@ var imageGenerationArgsSchema = lazySchema3(
1911
1896
  }).strict()
1912
1897
  )
1913
1898
  );
1914
- var imageGenerationInputSchema = lazySchema3(() => zodSchema10(z11.object({})));
1915
- var imageGenerationOutputSchema = lazySchema3(
1899
+ var imageGenerationInputSchema = lazySchema10(() => zodSchema10(z11.object({})));
1900
+ var imageGenerationOutputSchema = lazySchema10(
1916
1901
  () => zodSchema10(z11.object({ result: z11.string() }))
1917
1902
  );
1918
1903
  var imageGenerationToolFactory = createProviderDefinedToolFactoryWithOutputSchema3({
@@ -1928,11 +1913,11 @@ var imageGeneration = (args = {}) => {
1928
1913
  // src/tool/local-shell.ts
1929
1914
  import {
1930
1915
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema4,
1931
- lazySchema as lazySchema4,
1916
+ lazySchema as lazySchema11,
1932
1917
  zodSchema as zodSchema11
1933
1918
  } from "@ai-sdk/provider-utils";
1934
1919
  import { z as z12 } from "zod/v4";
1935
- var localShellInputSchema = lazySchema4(
1920
+ var localShellInputSchema = lazySchema11(
1936
1921
  () => zodSchema11(
1937
1922
  z12.object({
1938
1923
  action: z12.object({
@@ -1946,7 +1931,7 @@ var localShellInputSchema = lazySchema4(
1946
1931
  })
1947
1932
  )
1948
1933
  );
1949
- var localShellOutputSchema = lazySchema4(
1934
+ var localShellOutputSchema = lazySchema11(
1950
1935
  () => zodSchema11(z12.object({ output: z12.string() }))
1951
1936
  );
1952
1937
  var localShell = createProviderDefinedToolFactoryWithOutputSchema4({
@@ -1959,11 +1944,11 @@ var localShell = createProviderDefinedToolFactoryWithOutputSchema4({
1959
1944
  // src/tool/web-search.ts
1960
1945
  import {
1961
1946
  createProviderDefinedToolFactory,
1962
- lazySchema as lazySchema5,
1947
+ lazySchema as lazySchema12,
1963
1948
  zodSchema as zodSchema12
1964
1949
  } from "@ai-sdk/provider-utils";
1965
1950
  import { z as z13 } from "zod/v4";
1966
- var webSearchArgsSchema = lazySchema5(
1951
+ var webSearchArgsSchema = lazySchema12(
1967
1952
  () => zodSchema12(
1968
1953
  z13.object({
1969
1954
  filters: z13.object({
@@ -1980,7 +1965,7 @@ var webSearchArgsSchema = lazySchema5(
1980
1965
  })
1981
1966
  )
1982
1967
  );
1983
- var webSearchInputSchema = lazySchema5(
1968
+ var webSearchInputSchema = lazySchema12(
1984
1969
  () => zodSchema12(
1985
1970
  z13.object({
1986
1971
  action: z13.discriminatedUnion("type", [
@@ -2013,11 +1998,11 @@ var webSearch = (args = {}) => {
2013
1998
  // src/tool/web-search-preview.ts
2014
1999
  import {
2015
2000
  createProviderDefinedToolFactory as createProviderDefinedToolFactory2,
2016
- lazySchema as lazySchema6,
2001
+ lazySchema as lazySchema13,
2017
2002
  zodSchema as zodSchema13
2018
2003
  } from "@ai-sdk/provider-utils";
2019
2004
  import { z as z14 } from "zod/v4";
2020
- var webSearchPreviewArgsSchema = lazySchema6(
2005
+ var webSearchPreviewArgsSchema = lazySchema13(
2021
2006
  () => zodSchema13(
2022
2007
  z14.object({
2023
2008
  /**
@@ -2055,7 +2040,7 @@ var webSearchPreviewArgsSchema = lazySchema6(
2055
2040
  })
2056
2041
  )
2057
2042
  );
2058
- var webSearchPreviewInputSchema = lazySchema6(
2043
+ var webSearchPreviewInputSchema = lazySchema13(
2059
2044
  () => zodSchema13(
2060
2045
  z14.object({
2061
2046
  action: z14.discriminatedUnion("type", [
@@ -2471,12 +2456,9 @@ function mapOpenAIResponseFinishReason({
2471
2456
  }
2472
2457
 
2473
2458
  // src/responses/openai-responses-api.ts
2474
- import {
2475
- lazyValidator as lazyValidator8,
2476
- zodSchema as zodSchema14
2477
- } from "@ai-sdk/provider-utils";
2459
+ import { lazySchema as lazySchema14, zodSchema as zodSchema14 } from "@ai-sdk/provider-utils";
2478
2460
  import { z as z16 } from "zod/v4";
2479
- var openaiResponsesChunkSchema = lazyValidator8(
2461
+ var openaiResponsesChunkSchema = lazySchema14(
2480
2462
  () => zodSchema14(
2481
2463
  z16.union([
2482
2464
  z16.object({
@@ -2736,7 +2718,7 @@ var openaiResponsesChunkSchema = lazyValidator8(
2736
2718
  ])
2737
2719
  )
2738
2720
  );
2739
- var openaiResponsesResponseSchema = lazyValidator8(
2721
+ var openaiResponsesResponseSchema = lazySchema14(
2740
2722
  () => zodSchema14(
2741
2723
  z16.object({
2742
2724
  id: z16.string(),
@@ -2896,10 +2878,7 @@ var openaiResponsesResponseSchema = lazyValidator8(
2896
2878
  );
2897
2879
 
2898
2880
  // src/responses/openai-responses-options.ts
2899
- import {
2900
- lazyValidator as lazyValidator9,
2901
- zodSchema as zodSchema15
2902
- } from "@ai-sdk/provider-utils";
2881
+ import { lazySchema as lazySchema15, zodSchema as zodSchema15 } from "@ai-sdk/provider-utils";
2903
2882
  import { z as z17 } from "zod/v4";
2904
2883
  var TOP_LOGPROBS_MAX = 20;
2905
2884
  var openaiResponsesReasoningModelIds = [
@@ -2959,12 +2938,13 @@ var openaiResponsesModelIds = [
2959
2938
  "gpt-5-chat-latest",
2960
2939
  ...openaiResponsesReasoningModelIds
2961
2940
  ];
2962
- var openaiResponsesProviderOptionsSchema = lazyValidator9(
2941
+ var openaiResponsesProviderOptionsSchema = lazySchema15(
2963
2942
  () => zodSchema15(
2964
2943
  z17.object({
2965
2944
  include: z17.array(
2966
2945
  z17.enum([
2967
2946
  "reasoning.encrypted_content",
2947
+ // handled internally by default, only needed for unknown reasoning models
2968
2948
  "file_search_call.results",
2969
2949
  "message.output_text.logprobs"
2970
2950
  ])
@@ -3217,7 +3197,11 @@ var OpenAIResponsesLanguageModel = class {
3217
3197
  const strictJsonSchema = (_b = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _b : false;
3218
3198
  let include = openaiOptions == null ? void 0 : openaiOptions.include;
3219
3199
  function addInclude(key) {
3220
- include = include != null ? [...include, key] : [key];
3200
+ if (include == null) {
3201
+ include = [key];
3202
+ } else if (!include.includes(key)) {
3203
+ include = [...include, key];
3204
+ }
3221
3205
  }
3222
3206
  function hasOpenAITool(id) {
3223
3207
  return (tools == null ? void 0 : tools.find(
@@ -3237,6 +3221,10 @@ var OpenAIResponsesLanguageModel = class {
3237
3221
  if (hasOpenAITool("openai.code_interpreter")) {
3238
3222
  addInclude("code_interpreter_call.outputs");
3239
3223
  }
3224
+ const store = openaiOptions == null ? void 0 : openaiOptions.store;
3225
+ if (store === false && modelConfig.isReasoningModel) {
3226
+ addInclude("reasoning.encrypted_content");
3227
+ }
3240
3228
  const baseArgs = {
3241
3229
  model: this.modelId,
3242
3230
  input,
@@ -3264,7 +3252,7 @@ var OpenAIResponsesLanguageModel = class {
3264
3252
  metadata: openaiOptions == null ? void 0 : openaiOptions.metadata,
3265
3253
  parallel_tool_calls: openaiOptions == null ? void 0 : openaiOptions.parallelToolCalls,
3266
3254
  previous_response_id: openaiOptions == null ? void 0 : openaiOptions.previousResponseId,
3267
- store: openaiOptions == null ? void 0 : openaiOptions.store,
3255
+ store,
3268
3256
  user: openaiOptions == null ? void 0 : openaiOptions.user,
3269
3257
  instructions: openaiOptions == null ? void 0 : openaiOptions.instructions,
3270
3258
  service_tier: openaiOptions == null ? void 0 : openaiOptions.serviceTier,
@@ -4161,12 +4149,9 @@ import {
4161
4149
  } from "@ai-sdk/provider-utils";
4162
4150
 
4163
4151
  // src/speech/openai-speech-options.ts
4164
- import {
4165
- lazyValidator as lazyValidator10,
4166
- zodSchema as zodSchema16
4167
- } from "@ai-sdk/provider-utils";
4152
+ import { lazySchema as lazySchema16, zodSchema as zodSchema16 } from "@ai-sdk/provider-utils";
4168
4153
  import { z as z18 } from "zod/v4";
4169
- var openaiSpeechProviderOptionsSchema = lazyValidator10(
4154
+ var openaiSpeechProviderOptionsSchema = lazySchema16(
4170
4155
  () => zodSchema16(
4171
4156
  z18.object({
4172
4157
  instructions: z18.string().nullish(),
@@ -4287,9 +4272,9 @@ import {
4287
4272
  } from "@ai-sdk/provider-utils";
4288
4273
 
4289
4274
  // src/transcription/openai-transcription-api.ts
4290
- import { lazyValidator as lazyValidator11, zodSchema as zodSchema17 } from "@ai-sdk/provider-utils";
4275
+ import { lazySchema as lazySchema17, zodSchema as zodSchema17 } from "@ai-sdk/provider-utils";
4291
4276
  import { z as z19 } from "zod/v4";
4292
- var openaiTranscriptionResponseSchema = lazyValidator11(
4277
+ var openaiTranscriptionResponseSchema = lazySchema17(
4293
4278
  () => zodSchema17(
4294
4279
  z19.object({
4295
4280
  text: z19.string(),
@@ -4321,12 +4306,9 @@ var openaiTranscriptionResponseSchema = lazyValidator11(
4321
4306
  );
4322
4307
 
4323
4308
  // src/transcription/openai-transcription-options.ts
4324
- import {
4325
- lazyValidator as lazyValidator12,
4326
- zodSchema as zodSchema18
4327
- } from "@ai-sdk/provider-utils";
4309
+ import { lazySchema as lazySchema18, zodSchema as zodSchema18 } from "@ai-sdk/provider-utils";
4328
4310
  import { z as z20 } from "zod/v4";
4329
- var openAITranscriptionProviderOptions = lazyValidator12(
4311
+ var openAITranscriptionProviderOptions = lazySchema18(
4330
4312
  () => zodSchema18(
4331
4313
  z20.object({
4332
4314
  /**
@@ -4523,7 +4505,7 @@ var OpenAITranscriptionModel = class {
4523
4505
  };
4524
4506
 
4525
4507
  // src/version.ts
4526
- var VERSION = true ? "3.0.0-beta.24" : "0.0.0-test";
4508
+ var VERSION = true ? "3.0.0-beta.26" : "0.0.0-test";
4527
4509
 
4528
4510
  // src/openai-provider.ts
4529
4511
  function createOpenAI(options = {}) {