@ai-sdk/openai 3.0.0-beta.23 → 3.0.0-beta.25

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,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";
261
- import * as z2 from "zod/v4";
262
- var openaiChatResponseSchema = lazyValidator(
257
+ import { lazySchema, zodSchema } from "@ai-sdk/provider-utils";
258
+ import { z as z2 } from "zod/v4";
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";
402
- import * as z3 from "zod/v4";
403
- var openaiChatLanguageModelOptions = lazyValidator2(
395
+ import { lazySchema as lazySchema2, zodSchema as zodSchema2 } from "@ai-sdk/provider-utils";
396
+ import { z as z3 } from "zod/v4";
397
+ var openaiChatLanguageModelOptions = lazySchema2(
404
398
  () => zodSchema2(
405
399
  z3.object({
406
400
  /**
@@ -1217,12 +1211,9 @@ function mapOpenAIFinishReason2(finishReason) {
1217
1211
  }
1218
1212
 
1219
1213
  // src/completion/openai-completion-api.ts
1220
- import * 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(
1214
+ import { z as z4 } from "zod/v4";
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";
1285
- import * as z5 from "zod/v4";
1286
- var openaiCompletionProviderOptions = lazyValidator4(
1272
+ import { lazySchema as lazySchema4, zodSchema as zodSchema4 } from "@ai-sdk/provider-utils";
1273
+ import { z as z5 } from "zod/v4";
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";
1577
- import * as z6 from "zod/v4";
1578
- var openaiEmbeddingProviderOptions = lazyValidator5(
1561
+ import { lazySchema as lazySchema5, zodSchema as zodSchema5 } from "@ai-sdk/provider-utils";
1562
+ import { z as z6 } from "zod/v4";
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";
1597
- import * as z7 from "zod/v4";
1598
- var openaiTextEmbeddingResponseSchema = lazyValidator6(
1581
+ import { lazySchema as lazySchema6, zodSchema as zodSchema6 } from "@ai-sdk/provider-utils";
1582
+ import { z as z7 } from "zod/v4";
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";
1680
- import * as z8 from "zod/v4";
1681
- var openaiImageResponseSchema = lazyValidator7(
1664
+ import { lazySchema as lazySchema7, zodSchema as zodSchema7 } from "@ai-sdk/provider-utils";
1665
+ import { z as z8 } from "zod/v4";
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
- import * as z9 from "zod/v4";
1792
- var codeInterpreterInputSchema = lazySchema(
1776
+ import { z as z9 } from "zod/v4";
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,10 +1819,10 @@ 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
- import * as z10 from "zod/v4";
1825
+ import { z as z10 } from "zod/v4";
1841
1826
  var comparisonFilterSchema = z10.object({
1842
1827
  key: z10.string(),
1843
1828
  type: z10.enum(["eq", "ne", "gt", "gte", "lt", "lte"]),
@@ -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
- import * as z11 from "zod/v4";
1895
- var imageGenerationArgsSchema = lazySchema3(
1879
+ import { z as z11 } from "zod/v4";
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
- import * as z12 from "zod/v4";
1935
- var localShellInputSchema = lazySchema4(
1919
+ import { z as z12 } from "zod/v4";
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
- import * as z13 from "zod/v4";
1966
- var webSearchArgsSchema = lazySchema5(
1950
+ import { z as z13 } from "zod/v4";
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
- import * as z14 from "zod/v4";
2020
- var webSearchPreviewArgsSchema = lazySchema6(
2004
+ import { z as z14 } from "zod/v4";
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", [
@@ -2182,7 +2167,7 @@ import {
2182
2167
  parseProviderOptions as parseProviderOptions4,
2183
2168
  validateTypes
2184
2169
  } from "@ai-sdk/provider-utils";
2185
- import * as z15 from "zod/v4";
2170
+ import { z as z15 } from "zod/v4";
2186
2171
  function isFileId(data, prefixes) {
2187
2172
  if (!prefixes) return false;
2188
2173
  return prefixes.some((prefix) => data.startsWith(prefix));
@@ -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";
2478
- import * as z16 from "zod/v4";
2479
- var openaiResponsesChunkSchema = lazyValidator8(
2459
+ import { lazySchema as lazySchema14, zodSchema as zodSchema14 } from "@ai-sdk/provider-utils";
2460
+ import { z as z16 } from "zod/v4";
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,11 +2878,8 @@ 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";
2903
- import * as z17 from "zod/v4";
2881
+ import { lazySchema as lazySchema15, zodSchema as zodSchema15 } from "@ai-sdk/provider-utils";
2882
+ import { z as z17 } from "zod/v4";
2904
2883
  var TOP_LOGPROBS_MAX = 20;
2905
2884
  var openaiResponsesReasoningModelIds = [
2906
2885
  "o1",
@@ -2959,7 +2938,7 @@ 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(
@@ -4161,12 +4140,9 @@ import {
4161
4140
  } from "@ai-sdk/provider-utils";
4162
4141
 
4163
4142
  // src/speech/openai-speech-options.ts
4164
- import {
4165
- lazyValidator as lazyValidator10,
4166
- zodSchema as zodSchema16
4167
- } from "@ai-sdk/provider-utils";
4168
- import * as z18 from "zod/v4";
4169
- var openaiSpeechProviderOptionsSchema = lazyValidator10(
4143
+ import { lazySchema as lazySchema16, zodSchema as zodSchema16 } from "@ai-sdk/provider-utils";
4144
+ import { z as z18 } from "zod/v4";
4145
+ var openaiSpeechProviderOptionsSchema = lazySchema16(
4170
4146
  () => zodSchema16(
4171
4147
  z18.object({
4172
4148
  instructions: z18.string().nullish(),
@@ -4287,9 +4263,9 @@ import {
4287
4263
  } from "@ai-sdk/provider-utils";
4288
4264
 
4289
4265
  // src/transcription/openai-transcription-api.ts
4290
- import { lazyValidator as lazyValidator11, zodSchema as zodSchema17 } from "@ai-sdk/provider-utils";
4291
- import * as z19 from "zod/v4";
4292
- var openaiTranscriptionResponseSchema = lazyValidator11(
4266
+ import { lazySchema as lazySchema17, zodSchema as zodSchema17 } from "@ai-sdk/provider-utils";
4267
+ import { z as z19 } from "zod/v4";
4268
+ var openaiTranscriptionResponseSchema = lazySchema17(
4293
4269
  () => zodSchema17(
4294
4270
  z19.object({
4295
4271
  text: z19.string(),
@@ -4321,12 +4297,9 @@ var openaiTranscriptionResponseSchema = lazyValidator11(
4321
4297
  );
4322
4298
 
4323
4299
  // src/transcription/openai-transcription-options.ts
4324
- import {
4325
- lazyValidator as lazyValidator12,
4326
- zodSchema as zodSchema18
4327
- } from "@ai-sdk/provider-utils";
4328
- import * as z20 from "zod/v4";
4329
- var openAITranscriptionProviderOptions = lazyValidator12(
4300
+ import { lazySchema as lazySchema18, zodSchema as zodSchema18 } from "@ai-sdk/provider-utils";
4301
+ import { z as z20 } from "zod/v4";
4302
+ var openAITranscriptionProviderOptions = lazySchema18(
4330
4303
  () => zodSchema18(
4331
4304
  z20.object({
4332
4305
  /**
@@ -4523,7 +4496,7 @@ var OpenAITranscriptionModel = class {
4523
4496
  };
4524
4497
 
4525
4498
  // src/version.ts
4526
- var VERSION = true ? "3.0.0-beta.23" : "0.0.0-test";
4499
+ var VERSION = true ? "3.0.0-beta.25" : "0.0.0-test";
4527
4500
 
4528
4501
  // src/openai-provider.ts
4529
4502
  function createOpenAI(options = {}) {