@ai-sdk/openai 2.0.105 → 2.0.106

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
@@ -1656,6 +1656,7 @@ var OpenAIEmbeddingModel = class {
1656
1656
  import {
1657
1657
  combineHeaders as combineHeaders4,
1658
1658
  createJsonResponseHandler as createJsonResponseHandler4,
1659
+ parseProviderOptions as parseProviderOptions4,
1659
1660
  postJsonToApi as postJsonToApi4
1660
1661
  } from "@ai-sdk/provider-utils";
1661
1662
 
@@ -1690,6 +1691,11 @@ var openaiImageResponseSchema = lazyValidator7(
1690
1691
  );
1691
1692
 
1692
1693
  // src/image/openai-image-options.ts
1694
+ import {
1695
+ lazyValidator as lazyValidator8,
1696
+ zodSchema as zodSchema8
1697
+ } from "@ai-sdk/provider-utils";
1698
+ import { z as z9 } from "zod/v4";
1693
1699
  var modelMaxImagesPerCall = {
1694
1700
  "dall-e-3": 1,
1695
1701
  "dall-e-2": 10,
@@ -1704,6 +1710,55 @@ var hasDefaultResponseFormat = /* @__PURE__ */ new Set([
1704
1710
  "gpt-image-1.5",
1705
1711
  "gpt-image-2"
1706
1712
  ]);
1713
+ var baseImageModelOptionsObject = z9.object({
1714
+ /**
1715
+ * Quality of the generated image(s).
1716
+ *
1717
+ * Valid values: `standard`, `hd`, `low`, `medium`, `high`, `auto`.
1718
+ */
1719
+ quality: z9.enum(["standard", "hd", "low", "medium", "high", "auto"]).optional(),
1720
+ /**
1721
+ * Background behavior for the generated image(s).
1722
+ *
1723
+ * If `transparent`, the output format must support transparency
1724
+ * (i.e. `png` or `webp`).
1725
+ */
1726
+ background: z9.enum(["transparent", "opaque", "auto"]).optional(),
1727
+ /**
1728
+ * Format in which the generated image(s) are returned.
1729
+ */
1730
+ outputFormat: z9.enum(["png", "jpeg", "webp"]).optional(),
1731
+ /**
1732
+ * Compression level (0-100) for the generated image(s). Applies to the
1733
+ * `jpeg` and `webp` output formats.
1734
+ */
1735
+ outputCompression: z9.number().int().min(0).max(100).optional(),
1736
+ /**
1737
+ * A unique identifier representing your end-user, which can help OpenAI
1738
+ * to monitor and detect abuse.
1739
+ */
1740
+ user: z9.string().optional()
1741
+ });
1742
+ var openaiImageModelOptions = lazyValidator8(
1743
+ () => zodSchema8(baseImageModelOptionsObject)
1744
+ );
1745
+ var openaiImageModelGenerationOptions = lazyValidator8(
1746
+ () => zodSchema8(
1747
+ baseImageModelOptionsObject.extend({
1748
+ /**
1749
+ * Style of the generated image. `vivid` produces hyper-real and
1750
+ * dramatic images; `natural` produces more subdued, less hyper-real
1751
+ * looking images.
1752
+ */
1753
+ style: z9.enum(["vivid", "natural"]).optional(),
1754
+ /**
1755
+ * Content moderation level for the generated image(s). `low` applies
1756
+ * less restrictive filtering.
1757
+ */
1758
+ moderation: z9.enum(["auto", "low"]).optional()
1759
+ })
1760
+ )
1761
+ );
1707
1762
 
1708
1763
  // src/image/openai-image-model.ts
1709
1764
  var OpenAIImageModel = class {
@@ -1742,6 +1797,11 @@ var OpenAIImageModel = class {
1742
1797
  warnings.push({ type: "unsupported-setting", setting: "seed" });
1743
1798
  }
1744
1799
  const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
1800
+ const openaiOptions = (_d = await parseProviderOptions4({
1801
+ provider: "openai",
1802
+ providerOptions,
1803
+ schema: openaiImageModelGenerationOptions
1804
+ })) != null ? _d : {};
1745
1805
  const { value: response, responseHeaders } = await postJsonToApi4({
1746
1806
  url: this.config.url({
1747
1807
  path: "/images/generations",
@@ -1753,7 +1813,13 @@ var OpenAIImageModel = class {
1753
1813
  prompt,
1754
1814
  n,
1755
1815
  size,
1756
- ...(_d = providerOptions.openai) != null ? _d : {},
1816
+ quality: openaiOptions.quality,
1817
+ style: openaiOptions.style,
1818
+ background: openaiOptions.background,
1819
+ moderation: openaiOptions.moderation,
1820
+ output_format: openaiOptions.outputFormat,
1821
+ output_compression: openaiOptions.outputCompression,
1822
+ user: openaiOptions.user,
1757
1823
  ...!hasDefaultResponseFormat.has(this.modelId) ? { response_format: "b64_json" } : {}
1758
1824
  },
1759
1825
  failedResponseHandler: openaiFailedResponseHandler,
@@ -1824,36 +1890,36 @@ function distributeTokenDetails(usage, index, total) {
1824
1890
  import {
1825
1891
  createProviderDefinedToolFactoryWithOutputSchema,
1826
1892
  lazySchema,
1827
- zodSchema as zodSchema8
1893
+ zodSchema as zodSchema9
1828
1894
  } from "@ai-sdk/provider-utils";
1829
- import { z as z9 } from "zod/v4";
1895
+ import { z as z10 } from "zod/v4";
1830
1896
  var codeInterpreterInputSchema = lazySchema(
1831
- () => zodSchema8(
1832
- z9.object({
1833
- code: z9.string().nullish(),
1834
- containerId: z9.string()
1897
+ () => zodSchema9(
1898
+ z10.object({
1899
+ code: z10.string().nullish(),
1900
+ containerId: z10.string()
1835
1901
  })
1836
1902
  )
1837
1903
  );
1838
1904
  var codeInterpreterOutputSchema = lazySchema(
1839
- () => zodSchema8(
1840
- z9.object({
1841
- outputs: z9.array(
1842
- z9.discriminatedUnion("type", [
1843
- z9.object({ type: z9.literal("logs"), logs: z9.string() }),
1844
- z9.object({ type: z9.literal("image"), url: z9.string() })
1905
+ () => zodSchema9(
1906
+ z10.object({
1907
+ outputs: z10.array(
1908
+ z10.discriminatedUnion("type", [
1909
+ z10.object({ type: z10.literal("logs"), logs: z10.string() }),
1910
+ z10.object({ type: z10.literal("image"), url: z10.string() })
1845
1911
  ])
1846
1912
  ).nullish()
1847
1913
  })
1848
1914
  )
1849
1915
  );
1850
1916
  var codeInterpreterArgsSchema = lazySchema(
1851
- () => zodSchema8(
1852
- z9.object({
1853
- container: z9.union([
1854
- z9.string(),
1855
- z9.object({
1856
- fileIds: z9.array(z9.string()).optional()
1917
+ () => zodSchema9(
1918
+ z10.object({
1919
+ container: z10.union([
1920
+ z10.string(),
1921
+ z10.object({
1922
+ fileIds: z10.array(z10.string()).optional()
1857
1923
  })
1858
1924
  ]).optional()
1859
1925
  })
@@ -1873,44 +1939,44 @@ var codeInterpreter = (args = {}) => {
1873
1939
  import {
1874
1940
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema2,
1875
1941
  lazySchema as lazySchema2,
1876
- zodSchema as zodSchema9
1942
+ zodSchema as zodSchema10
1877
1943
  } from "@ai-sdk/provider-utils";
1878
- import { z as z10 } from "zod/v4";
1879
- var comparisonFilterSchema = z10.object({
1880
- key: z10.string(),
1881
- type: z10.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
1882
- value: z10.union([z10.string(), z10.number(), z10.boolean(), z10.array(z10.string())])
1944
+ import { z as z11 } from "zod/v4";
1945
+ var comparisonFilterSchema = z11.object({
1946
+ key: z11.string(),
1947
+ type: z11.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
1948
+ value: z11.union([z11.string(), z11.number(), z11.boolean(), z11.array(z11.string())])
1883
1949
  });
1884
- var compoundFilterSchema = z10.object({
1885
- type: z10.enum(["and", "or"]),
1886
- filters: z10.array(
1887
- z10.union([comparisonFilterSchema, z10.lazy(() => compoundFilterSchema)])
1950
+ var compoundFilterSchema = z11.object({
1951
+ type: z11.enum(["and", "or"]),
1952
+ filters: z11.array(
1953
+ z11.union([comparisonFilterSchema, z11.lazy(() => compoundFilterSchema)])
1888
1954
  )
1889
1955
  });
1890
1956
  var fileSearchArgsSchema = lazySchema2(
1891
- () => zodSchema9(
1892
- z10.object({
1893
- vectorStoreIds: z10.array(z10.string()),
1894
- maxNumResults: z10.number().optional(),
1895
- ranking: z10.object({
1896
- ranker: z10.string().optional(),
1897
- scoreThreshold: z10.number().optional()
1957
+ () => zodSchema10(
1958
+ z11.object({
1959
+ vectorStoreIds: z11.array(z11.string()),
1960
+ maxNumResults: z11.number().optional(),
1961
+ ranking: z11.object({
1962
+ ranker: z11.string().optional(),
1963
+ scoreThreshold: z11.number().optional()
1898
1964
  }).optional(),
1899
- filters: z10.union([comparisonFilterSchema, compoundFilterSchema]).optional()
1965
+ filters: z11.union([comparisonFilterSchema, compoundFilterSchema]).optional()
1900
1966
  })
1901
1967
  )
1902
1968
  );
1903
1969
  var fileSearchOutputSchema = lazySchema2(
1904
- () => zodSchema9(
1905
- z10.object({
1906
- queries: z10.array(z10.string()),
1907
- results: z10.array(
1908
- z10.object({
1909
- attributes: z10.record(z10.string(), z10.unknown()),
1910
- fileId: z10.string(),
1911
- filename: z10.string(),
1912
- score: z10.number(),
1913
- text: z10.string()
1970
+ () => zodSchema10(
1971
+ z11.object({
1972
+ queries: z11.array(z11.string()),
1973
+ results: z11.array(
1974
+ z11.object({
1975
+ attributes: z11.record(z11.string(), z11.unknown()),
1976
+ fileId: z11.string(),
1977
+ filename: z11.string(),
1978
+ score: z11.number(),
1979
+ text: z11.string()
1914
1980
  })
1915
1981
  ).nullable()
1916
1982
  })
@@ -1919,7 +1985,7 @@ var fileSearchOutputSchema = lazySchema2(
1919
1985
  var fileSearch = createProviderDefinedToolFactoryWithOutputSchema2({
1920
1986
  id: "openai.file_search",
1921
1987
  name: "file_search",
1922
- inputSchema: z10.object({}),
1988
+ inputSchema: z11.object({}),
1923
1989
  outputSchema: fileSearchOutputSchema
1924
1990
  });
1925
1991
 
@@ -1927,31 +1993,31 @@ var fileSearch = createProviderDefinedToolFactoryWithOutputSchema2({
1927
1993
  import {
1928
1994
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema3,
1929
1995
  lazySchema as lazySchema3,
1930
- zodSchema as zodSchema10
1996
+ zodSchema as zodSchema11
1931
1997
  } from "@ai-sdk/provider-utils";
1932
- import { z as z11 } from "zod/v4";
1998
+ import { z as z12 } from "zod/v4";
1933
1999
  var imageGenerationArgsSchema = lazySchema3(
1934
- () => zodSchema10(
1935
- z11.object({
1936
- background: z11.enum(["auto", "opaque", "transparent"]).optional(),
1937
- inputFidelity: z11.enum(["low", "high"]).optional(),
1938
- inputImageMask: z11.object({
1939
- fileId: z11.string().optional(),
1940
- imageUrl: z11.string().optional()
2000
+ () => zodSchema11(
2001
+ z12.object({
2002
+ background: z12.enum(["auto", "opaque", "transparent"]).optional(),
2003
+ inputFidelity: z12.enum(["low", "high"]).optional(),
2004
+ inputImageMask: z12.object({
2005
+ fileId: z12.string().optional(),
2006
+ imageUrl: z12.string().optional()
1941
2007
  }).optional(),
1942
- model: z11.string().optional(),
1943
- moderation: z11.enum(["auto"]).optional(),
1944
- outputCompression: z11.number().int().min(0).max(100).optional(),
1945
- outputFormat: z11.enum(["png", "jpeg", "webp"]).optional(),
1946
- partialImages: z11.number().int().min(0).max(3).optional(),
1947
- quality: z11.enum(["auto", "low", "medium", "high"]).optional(),
1948
- size: z11.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
2008
+ model: z12.string().optional(),
2009
+ moderation: z12.enum(["auto"]).optional(),
2010
+ outputCompression: z12.number().int().min(0).max(100).optional(),
2011
+ outputFormat: z12.enum(["png", "jpeg", "webp"]).optional(),
2012
+ partialImages: z12.number().int().min(0).max(3).optional(),
2013
+ quality: z12.enum(["auto", "low", "medium", "high"]).optional(),
2014
+ size: z12.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
1949
2015
  }).strict()
1950
2016
  )
1951
2017
  );
1952
- var imageGenerationInputSchema = lazySchema3(() => zodSchema10(z11.object({})));
2018
+ var imageGenerationInputSchema = lazySchema3(() => zodSchema11(z12.object({})));
1953
2019
  var imageGenerationOutputSchema = lazySchema3(
1954
- () => zodSchema10(z11.object({ result: z11.string() }))
2020
+ () => zodSchema11(z12.object({ result: z12.string() }))
1955
2021
  );
1956
2022
  var imageGenerationToolFactory = createProviderDefinedToolFactoryWithOutputSchema3({
1957
2023
  id: "openai.image_generation",
@@ -1967,25 +2033,25 @@ var imageGeneration = (args = {}) => {
1967
2033
  import {
1968
2034
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema4,
1969
2035
  lazySchema as lazySchema4,
1970
- zodSchema as zodSchema11
2036
+ zodSchema as zodSchema12
1971
2037
  } from "@ai-sdk/provider-utils";
1972
- import { z as z12 } from "zod/v4";
2038
+ import { z as z13 } from "zod/v4";
1973
2039
  var localShellInputSchema = lazySchema4(
1974
- () => zodSchema11(
1975
- z12.object({
1976
- action: z12.object({
1977
- type: z12.literal("exec"),
1978
- command: z12.array(z12.string()),
1979
- timeoutMs: z12.number().optional(),
1980
- user: z12.string().optional(),
1981
- workingDirectory: z12.string().optional(),
1982
- env: z12.record(z12.string(), z12.string()).optional()
2040
+ () => zodSchema12(
2041
+ z13.object({
2042
+ action: z13.object({
2043
+ type: z13.literal("exec"),
2044
+ command: z13.array(z13.string()),
2045
+ timeoutMs: z13.number().optional(),
2046
+ user: z13.string().optional(),
2047
+ workingDirectory: z13.string().optional(),
2048
+ env: z13.record(z13.string(), z13.string()).optional()
1983
2049
  })
1984
2050
  })
1985
2051
  )
1986
2052
  );
1987
2053
  var localShellOutputSchema = lazySchema4(
1988
- () => zodSchema11(z12.object({ output: z12.string() }))
2054
+ () => zodSchema12(z13.object({ output: z13.string() }))
1989
2055
  );
1990
2056
  var localShell = createProviderDefinedToolFactoryWithOutputSchema4({
1991
2057
  id: "openai.local_shell",
@@ -1998,48 +2064,48 @@ var localShell = createProviderDefinedToolFactoryWithOutputSchema4({
1998
2064
  import {
1999
2065
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema5,
2000
2066
  lazySchema as lazySchema5,
2001
- zodSchema as zodSchema12
2067
+ zodSchema as zodSchema13
2002
2068
  } from "@ai-sdk/provider-utils";
2003
- import { z as z13 } from "zod/v4";
2069
+ import { z as z14 } from "zod/v4";
2004
2070
  var webSearchArgsSchema = lazySchema5(
2005
- () => zodSchema12(
2006
- z13.object({
2007
- externalWebAccess: z13.boolean().optional(),
2008
- filters: z13.object({ allowedDomains: z13.array(z13.string()).optional() }).optional(),
2009
- searchContextSize: z13.enum(["low", "medium", "high"]).optional(),
2010
- userLocation: z13.object({
2011
- type: z13.literal("approximate"),
2012
- country: z13.string().optional(),
2013
- city: z13.string().optional(),
2014
- region: z13.string().optional(),
2015
- timezone: z13.string().optional()
2071
+ () => zodSchema13(
2072
+ z14.object({
2073
+ externalWebAccess: z14.boolean().optional(),
2074
+ filters: z14.object({ allowedDomains: z14.array(z14.string()).optional() }).optional(),
2075
+ searchContextSize: z14.enum(["low", "medium", "high"]).optional(),
2076
+ userLocation: z14.object({
2077
+ type: z14.literal("approximate"),
2078
+ country: z14.string().optional(),
2079
+ city: z14.string().optional(),
2080
+ region: z14.string().optional(),
2081
+ timezone: z14.string().optional()
2016
2082
  }).optional()
2017
2083
  })
2018
2084
  )
2019
2085
  );
2020
- var webSearchInputSchema = lazySchema5(() => zodSchema12(z13.object({})));
2086
+ var webSearchInputSchema = lazySchema5(() => zodSchema13(z14.object({})));
2021
2087
  var webSearchOutputSchema = lazySchema5(
2022
- () => zodSchema12(
2023
- z13.object({
2024
- action: z13.discriminatedUnion("type", [
2025
- z13.object({
2026
- type: z13.literal("search"),
2027
- query: z13.string().optional()
2088
+ () => zodSchema13(
2089
+ z14.object({
2090
+ action: z14.discriminatedUnion("type", [
2091
+ z14.object({
2092
+ type: z14.literal("search"),
2093
+ query: z14.string().optional()
2028
2094
  }),
2029
- z13.object({
2030
- type: z13.literal("openPage"),
2031
- url: z13.string().nullish()
2095
+ z14.object({
2096
+ type: z14.literal("openPage"),
2097
+ url: z14.string().nullish()
2032
2098
  }),
2033
- z13.object({
2034
- type: z13.literal("findInPage"),
2035
- url: z13.string().nullish(),
2036
- pattern: z13.string().nullish()
2099
+ z14.object({
2100
+ type: z14.literal("findInPage"),
2101
+ url: z14.string().nullish(),
2102
+ pattern: z14.string().nullish()
2037
2103
  })
2038
2104
  ]).optional(),
2039
- sources: z13.array(
2040
- z13.discriminatedUnion("type", [
2041
- z13.object({ type: z13.literal("url"), url: z13.string() }),
2042
- z13.object({ type: z13.literal("api"), name: z13.string() })
2105
+ sources: z14.array(
2106
+ z14.discriminatedUnion("type", [
2107
+ z14.object({ type: z14.literal("url"), url: z14.string() }),
2108
+ z14.object({ type: z14.literal("api"), name: z14.string() })
2043
2109
  ])
2044
2110
  ).optional()
2045
2111
  })
@@ -2057,42 +2123,42 @@ var webSearch = (args = {}) => webSearchToolFactory(args);
2057
2123
  import {
2058
2124
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema6,
2059
2125
  lazySchema as lazySchema6,
2060
- zodSchema as zodSchema13
2126
+ zodSchema as zodSchema14
2061
2127
  } from "@ai-sdk/provider-utils";
2062
- import { z as z14 } from "zod/v4";
2128
+ import { z as z15 } from "zod/v4";
2063
2129
  var webSearchPreviewArgsSchema = lazySchema6(
2064
- () => zodSchema13(
2065
- z14.object({
2066
- searchContextSize: z14.enum(["low", "medium", "high"]).optional(),
2067
- userLocation: z14.object({
2068
- type: z14.literal("approximate"),
2069
- country: z14.string().optional(),
2070
- city: z14.string().optional(),
2071
- region: z14.string().optional(),
2072
- timezone: z14.string().optional()
2130
+ () => zodSchema14(
2131
+ z15.object({
2132
+ searchContextSize: z15.enum(["low", "medium", "high"]).optional(),
2133
+ userLocation: z15.object({
2134
+ type: z15.literal("approximate"),
2135
+ country: z15.string().optional(),
2136
+ city: z15.string().optional(),
2137
+ region: z15.string().optional(),
2138
+ timezone: z15.string().optional()
2073
2139
  }).optional()
2074
2140
  })
2075
2141
  )
2076
2142
  );
2077
2143
  var webSearchPreviewInputSchema = lazySchema6(
2078
- () => zodSchema13(z14.object({}))
2144
+ () => zodSchema14(z15.object({}))
2079
2145
  );
2080
2146
  var webSearchPreviewOutputSchema = lazySchema6(
2081
- () => zodSchema13(
2082
- z14.object({
2083
- action: z14.discriminatedUnion("type", [
2084
- z14.object({
2085
- type: z14.literal("search"),
2086
- query: z14.string().optional()
2147
+ () => zodSchema14(
2148
+ z15.object({
2149
+ action: z15.discriminatedUnion("type", [
2150
+ z15.object({
2151
+ type: z15.literal("search"),
2152
+ query: z15.string().optional()
2087
2153
  }),
2088
- z14.object({
2089
- type: z14.literal("openPage"),
2090
- url: z14.string().nullish()
2154
+ z15.object({
2155
+ type: z15.literal("openPage"),
2156
+ url: z15.string().nullish()
2091
2157
  }),
2092
- z14.object({
2093
- type: z14.literal("findInPage"),
2094
- url: z14.string().nullish(),
2095
- pattern: z14.string().nullish()
2158
+ z15.object({
2159
+ type: z15.literal("findInPage"),
2160
+ url: z15.string().nullish(),
2161
+ pattern: z15.string().nullish()
2096
2162
  })
2097
2163
  ]).optional()
2098
2164
  })
@@ -2187,7 +2253,7 @@ import {
2187
2253
  createEventSourceResponseHandler as createEventSourceResponseHandler3,
2188
2254
  createJsonResponseHandler as createJsonResponseHandler5,
2189
2255
  generateId as generateId2,
2190
- parseProviderOptions as parseProviderOptions5,
2256
+ parseProviderOptions as parseProviderOptions6,
2191
2257
  postJsonToApi as postJsonToApi5
2192
2258
  } from "@ai-sdk/provider-utils";
2193
2259
 
@@ -2197,10 +2263,10 @@ import {
2197
2263
  } from "@ai-sdk/provider";
2198
2264
  import {
2199
2265
  convertToBase64 as convertToBase642,
2200
- parseProviderOptions as parseProviderOptions4,
2266
+ parseProviderOptions as parseProviderOptions5,
2201
2267
  validateTypes
2202
2268
  } from "@ai-sdk/provider-utils";
2203
- import { z as z15 } from "zod/v4";
2269
+ import { z as z16 } from "zod/v4";
2204
2270
  function isFileId(data, prefixes) {
2205
2271
  if (!prefixes) return false;
2206
2272
  return prefixes.some((prefix) => data.startsWith(prefix));
@@ -2359,7 +2425,7 @@ async function convertToOpenAIResponsesInput({
2359
2425
  break;
2360
2426
  }
2361
2427
  case "reasoning": {
2362
- const providerOptions = await parseProviderOptions4({
2428
+ const providerOptions = await parseProviderOptions5({
2363
2429
  provider: "openai",
2364
2430
  providerOptions: part.providerOptions,
2365
2431
  schema: openaiResponsesReasoningProviderOptionsSchema
@@ -2488,9 +2554,9 @@ async function convertToOpenAIResponsesInput({
2488
2554
  }
2489
2555
  return { input, warnings };
2490
2556
  }
2491
- var openaiResponsesReasoningProviderOptionsSchema = z15.object({
2492
- itemId: z15.string().nullish(),
2493
- reasoningEncryptedContent: z15.string().nullish()
2557
+ var openaiResponsesReasoningProviderOptionsSchema = z16.object({
2558
+ itemId: z16.string().nullish(),
2559
+ reasoningEncryptedContent: z16.string().nullish()
2494
2560
  });
2495
2561
 
2496
2562
  // src/responses/map-openai-responses-finish-reason.ts
@@ -2513,277 +2579,277 @@ function mapOpenAIResponseFinishReason({
2513
2579
 
2514
2580
  // src/responses/openai-responses-api.ts
2515
2581
  import {
2516
- lazyValidator as lazyValidator8,
2517
- zodSchema as zodSchema14
2582
+ lazyValidator as lazyValidator9,
2583
+ zodSchema as zodSchema15
2518
2584
  } from "@ai-sdk/provider-utils";
2519
- import { z as z16 } from "zod/v4";
2520
- var openaiResponsesChunkSchema = lazyValidator8(
2521
- () => zodSchema14(
2522
- z16.union([
2523
- z16.object({
2524
- type: z16.literal("response.output_text.delta"),
2525
- item_id: z16.string(),
2526
- delta: z16.string(),
2527
- logprobs: z16.array(
2528
- z16.object({
2529
- token: z16.string(),
2530
- logprob: z16.number(),
2531
- top_logprobs: z16.array(
2532
- z16.object({
2533
- token: z16.string(),
2534
- logprob: z16.number()
2585
+ import { z as z17 } from "zod/v4";
2586
+ var openaiResponsesChunkSchema = lazyValidator9(
2587
+ () => zodSchema15(
2588
+ z17.union([
2589
+ z17.object({
2590
+ type: z17.literal("response.output_text.delta"),
2591
+ item_id: z17.string(),
2592
+ delta: z17.string(),
2593
+ logprobs: z17.array(
2594
+ z17.object({
2595
+ token: z17.string(),
2596
+ logprob: z17.number(),
2597
+ top_logprobs: z17.array(
2598
+ z17.object({
2599
+ token: z17.string(),
2600
+ logprob: z17.number()
2535
2601
  })
2536
2602
  )
2537
2603
  })
2538
2604
  ).nullish()
2539
2605
  }),
2540
- z16.object({
2541
- type: z16.enum(["response.completed", "response.incomplete"]),
2542
- response: z16.object({
2543
- incomplete_details: z16.object({ reason: z16.string() }).nullish(),
2544
- usage: z16.object({
2545
- input_tokens: z16.number(),
2546
- input_tokens_details: z16.object({ cached_tokens: z16.number().nullish() }).nullish(),
2547
- output_tokens: z16.number(),
2548
- output_tokens_details: z16.object({ reasoning_tokens: z16.number().nullish() }).nullish()
2606
+ z17.object({
2607
+ type: z17.enum(["response.completed", "response.incomplete"]),
2608
+ response: z17.object({
2609
+ incomplete_details: z17.object({ reason: z17.string() }).nullish(),
2610
+ usage: z17.object({
2611
+ input_tokens: z17.number(),
2612
+ input_tokens_details: z17.object({ cached_tokens: z17.number().nullish() }).nullish(),
2613
+ output_tokens: z17.number(),
2614
+ output_tokens_details: z17.object({ reasoning_tokens: z17.number().nullish() }).nullish()
2549
2615
  }),
2550
- service_tier: z16.string().nullish()
2616
+ service_tier: z17.string().nullish()
2551
2617
  })
2552
2618
  }),
2553
- z16.object({
2554
- type: z16.literal("response.created"),
2555
- response: z16.object({
2556
- id: z16.string(),
2557
- created_at: z16.number(),
2558
- model: z16.string(),
2559
- service_tier: z16.string().nullish()
2619
+ z17.object({
2620
+ type: z17.literal("response.created"),
2621
+ response: z17.object({
2622
+ id: z17.string(),
2623
+ created_at: z17.number(),
2624
+ model: z17.string(),
2625
+ service_tier: z17.string().nullish()
2560
2626
  })
2561
2627
  }),
2562
- z16.object({
2563
- type: z16.literal("response.output_item.added"),
2564
- output_index: z16.number(),
2565
- item: z16.discriminatedUnion("type", [
2566
- z16.object({
2567
- type: z16.literal("message"),
2568
- id: z16.string(),
2569
- phase: z16.enum(["commentary", "final_answer"]).nullish()
2628
+ z17.object({
2629
+ type: z17.literal("response.output_item.added"),
2630
+ output_index: z17.number(),
2631
+ item: z17.discriminatedUnion("type", [
2632
+ z17.object({
2633
+ type: z17.literal("message"),
2634
+ id: z17.string(),
2635
+ phase: z17.enum(["commentary", "final_answer"]).nullish()
2570
2636
  }),
2571
- z16.object({
2572
- type: z16.literal("reasoning"),
2573
- id: z16.string(),
2574
- encrypted_content: z16.string().nullish()
2637
+ z17.object({
2638
+ type: z17.literal("reasoning"),
2639
+ id: z17.string(),
2640
+ encrypted_content: z17.string().nullish()
2575
2641
  }),
2576
- z16.object({
2577
- type: z16.literal("function_call"),
2578
- id: z16.string(),
2579
- call_id: z16.string(),
2580
- name: z16.string(),
2581
- arguments: z16.string()
2642
+ z17.object({
2643
+ type: z17.literal("function_call"),
2644
+ id: z17.string(),
2645
+ call_id: z17.string(),
2646
+ name: z17.string(),
2647
+ arguments: z17.string()
2582
2648
  }),
2583
- z16.object({
2584
- type: z16.literal("web_search_call"),
2585
- id: z16.string(),
2586
- status: z16.string()
2649
+ z17.object({
2650
+ type: z17.literal("web_search_call"),
2651
+ id: z17.string(),
2652
+ status: z17.string()
2587
2653
  }),
2588
- z16.object({
2589
- type: z16.literal("computer_call"),
2590
- id: z16.string(),
2591
- status: z16.string()
2654
+ z17.object({
2655
+ type: z17.literal("computer_call"),
2656
+ id: z17.string(),
2657
+ status: z17.string()
2592
2658
  }),
2593
- z16.object({
2594
- type: z16.literal("file_search_call"),
2595
- id: z16.string()
2659
+ z17.object({
2660
+ type: z17.literal("file_search_call"),
2661
+ id: z17.string()
2596
2662
  }),
2597
- z16.object({
2598
- type: z16.literal("image_generation_call"),
2599
- id: z16.string()
2663
+ z17.object({
2664
+ type: z17.literal("image_generation_call"),
2665
+ id: z17.string()
2600
2666
  }),
2601
- z16.object({
2602
- type: z16.literal("code_interpreter_call"),
2603
- id: z16.string(),
2604
- container_id: z16.string(),
2605
- code: z16.string().nullable(),
2606
- outputs: z16.array(
2607
- z16.discriminatedUnion("type", [
2608
- z16.object({ type: z16.literal("logs"), logs: z16.string() }),
2609
- z16.object({ type: z16.literal("image"), url: z16.string() })
2667
+ z17.object({
2668
+ type: z17.literal("code_interpreter_call"),
2669
+ id: z17.string(),
2670
+ container_id: z17.string(),
2671
+ code: z17.string().nullable(),
2672
+ outputs: z17.array(
2673
+ z17.discriminatedUnion("type", [
2674
+ z17.object({ type: z17.literal("logs"), logs: z17.string() }),
2675
+ z17.object({ type: z17.literal("image"), url: z17.string() })
2610
2676
  ])
2611
2677
  ).nullable(),
2612
- status: z16.string()
2678
+ status: z17.string()
2613
2679
  })
2614
2680
  ])
2615
2681
  }),
2616
- z16.object({
2617
- type: z16.literal("response.output_item.done"),
2618
- output_index: z16.number(),
2619
- item: z16.discriminatedUnion("type", [
2620
- z16.object({
2621
- type: z16.literal("message"),
2622
- id: z16.string(),
2623
- phase: z16.enum(["commentary", "final_answer"]).nullish()
2682
+ z17.object({
2683
+ type: z17.literal("response.output_item.done"),
2684
+ output_index: z17.number(),
2685
+ item: z17.discriminatedUnion("type", [
2686
+ z17.object({
2687
+ type: z17.literal("message"),
2688
+ id: z17.string(),
2689
+ phase: z17.enum(["commentary", "final_answer"]).nullish()
2624
2690
  }),
2625
- z16.object({
2626
- type: z16.literal("reasoning"),
2627
- id: z16.string(),
2628
- encrypted_content: z16.string().nullish()
2691
+ z17.object({
2692
+ type: z17.literal("reasoning"),
2693
+ id: z17.string(),
2694
+ encrypted_content: z17.string().nullish()
2629
2695
  }),
2630
- z16.object({
2631
- type: z16.literal("function_call"),
2632
- id: z16.string(),
2633
- call_id: z16.string(),
2634
- name: z16.string(),
2635
- arguments: z16.string(),
2636
- status: z16.literal("completed")
2696
+ z17.object({
2697
+ type: z17.literal("function_call"),
2698
+ id: z17.string(),
2699
+ call_id: z17.string(),
2700
+ name: z17.string(),
2701
+ arguments: z17.string(),
2702
+ status: z17.literal("completed")
2637
2703
  }),
2638
- z16.object({
2639
- type: z16.literal("code_interpreter_call"),
2640
- id: z16.string(),
2641
- code: z16.string().nullable(),
2642
- container_id: z16.string(),
2643
- outputs: z16.array(
2644
- z16.discriminatedUnion("type", [
2645
- z16.object({ type: z16.literal("logs"), logs: z16.string() }),
2646
- z16.object({ type: z16.literal("image"), url: z16.string() })
2704
+ z17.object({
2705
+ type: z17.literal("code_interpreter_call"),
2706
+ id: z17.string(),
2707
+ code: z17.string().nullable(),
2708
+ container_id: z17.string(),
2709
+ outputs: z17.array(
2710
+ z17.discriminatedUnion("type", [
2711
+ z17.object({ type: z17.literal("logs"), logs: z17.string() }),
2712
+ z17.object({ type: z17.literal("image"), url: z17.string() })
2647
2713
  ])
2648
2714
  ).nullable()
2649
2715
  }),
2650
- z16.object({
2651
- type: z16.literal("image_generation_call"),
2652
- id: z16.string(),
2653
- result: z16.string()
2716
+ z17.object({
2717
+ type: z17.literal("image_generation_call"),
2718
+ id: z17.string(),
2719
+ result: z17.string()
2654
2720
  }),
2655
- z16.object({
2656
- type: z16.literal("web_search_call"),
2657
- id: z16.string(),
2658
- status: z16.string(),
2659
- action: z16.discriminatedUnion("type", [
2660
- z16.object({
2661
- type: z16.literal("search"),
2662
- query: z16.string().nullish(),
2663
- sources: z16.array(
2664
- z16.discriminatedUnion("type", [
2665
- z16.object({ type: z16.literal("url"), url: z16.string() }),
2666
- z16.object({ type: z16.literal("api"), name: z16.string() })
2721
+ z17.object({
2722
+ type: z17.literal("web_search_call"),
2723
+ id: z17.string(),
2724
+ status: z17.string(),
2725
+ action: z17.discriminatedUnion("type", [
2726
+ z17.object({
2727
+ type: z17.literal("search"),
2728
+ query: z17.string().nullish(),
2729
+ sources: z17.array(
2730
+ z17.discriminatedUnion("type", [
2731
+ z17.object({ type: z17.literal("url"), url: z17.string() }),
2732
+ z17.object({ type: z17.literal("api"), name: z17.string() })
2667
2733
  ])
2668
2734
  ).nullish()
2669
2735
  }),
2670
- z16.object({
2671
- type: z16.literal("open_page"),
2672
- url: z16.string().nullish()
2736
+ z17.object({
2737
+ type: z17.literal("open_page"),
2738
+ url: z17.string().nullish()
2673
2739
  }),
2674
- z16.object({
2675
- type: z16.literal("find_in_page"),
2676
- url: z16.string().nullish(),
2677
- pattern: z16.string().nullish()
2740
+ z17.object({
2741
+ type: z17.literal("find_in_page"),
2742
+ url: z17.string().nullish(),
2743
+ pattern: z17.string().nullish()
2678
2744
  })
2679
2745
  ]).nullish()
2680
2746
  }),
2681
- z16.object({
2682
- type: z16.literal("file_search_call"),
2683
- id: z16.string(),
2684
- queries: z16.array(z16.string()),
2685
- results: z16.array(
2686
- z16.object({
2687
- attributes: z16.record(z16.string(), z16.unknown()),
2688
- file_id: z16.string(),
2689
- filename: z16.string(),
2690
- score: z16.number(),
2691
- text: z16.string()
2747
+ z17.object({
2748
+ type: z17.literal("file_search_call"),
2749
+ id: z17.string(),
2750
+ queries: z17.array(z17.string()),
2751
+ results: z17.array(
2752
+ z17.object({
2753
+ attributes: z17.record(z17.string(), z17.unknown()),
2754
+ file_id: z17.string(),
2755
+ filename: z17.string(),
2756
+ score: z17.number(),
2757
+ text: z17.string()
2692
2758
  })
2693
2759
  ).nullish()
2694
2760
  }),
2695
- z16.object({
2696
- type: z16.literal("local_shell_call"),
2697
- id: z16.string(),
2698
- call_id: z16.string(),
2699
- action: z16.object({
2700
- type: z16.literal("exec"),
2701
- command: z16.array(z16.string()),
2702
- timeout_ms: z16.number().optional(),
2703
- user: z16.string().optional(),
2704
- working_directory: z16.string().optional(),
2705
- env: z16.record(z16.string(), z16.string()).optional()
2761
+ z17.object({
2762
+ type: z17.literal("local_shell_call"),
2763
+ id: z17.string(),
2764
+ call_id: z17.string(),
2765
+ action: z17.object({
2766
+ type: z17.literal("exec"),
2767
+ command: z17.array(z17.string()),
2768
+ timeout_ms: z17.number().optional(),
2769
+ user: z17.string().optional(),
2770
+ working_directory: z17.string().optional(),
2771
+ env: z17.record(z17.string(), z17.string()).optional()
2706
2772
  })
2707
2773
  }),
2708
- z16.object({
2709
- type: z16.literal("computer_call"),
2710
- id: z16.string(),
2711
- status: z16.literal("completed")
2774
+ z17.object({
2775
+ type: z17.literal("computer_call"),
2776
+ id: z17.string(),
2777
+ status: z17.literal("completed")
2712
2778
  })
2713
2779
  ])
2714
2780
  }),
2715
- z16.object({
2716
- type: z16.literal("response.function_call_arguments.delta"),
2717
- item_id: z16.string(),
2718
- output_index: z16.number(),
2719
- delta: z16.string()
2781
+ z17.object({
2782
+ type: z17.literal("response.function_call_arguments.delta"),
2783
+ item_id: z17.string(),
2784
+ output_index: z17.number(),
2785
+ delta: z17.string()
2720
2786
  }),
2721
- z16.object({
2722
- type: z16.literal("response.image_generation_call.partial_image"),
2723
- item_id: z16.string(),
2724
- output_index: z16.number(),
2725
- partial_image_b64: z16.string()
2787
+ z17.object({
2788
+ type: z17.literal("response.image_generation_call.partial_image"),
2789
+ item_id: z17.string(),
2790
+ output_index: z17.number(),
2791
+ partial_image_b64: z17.string()
2726
2792
  }),
2727
- z16.object({
2728
- type: z16.literal("response.code_interpreter_call_code.delta"),
2729
- item_id: z16.string(),
2730
- output_index: z16.number(),
2731
- delta: z16.string()
2793
+ z17.object({
2794
+ type: z17.literal("response.code_interpreter_call_code.delta"),
2795
+ item_id: z17.string(),
2796
+ output_index: z17.number(),
2797
+ delta: z17.string()
2732
2798
  }),
2733
- z16.object({
2734
- type: z16.literal("response.code_interpreter_call_code.done"),
2735
- item_id: z16.string(),
2736
- output_index: z16.number(),
2737
- code: z16.string()
2799
+ z17.object({
2800
+ type: z17.literal("response.code_interpreter_call_code.done"),
2801
+ item_id: z17.string(),
2802
+ output_index: z17.number(),
2803
+ code: z17.string()
2738
2804
  }),
2739
- z16.object({
2740
- type: z16.literal("response.output_text.annotation.added"),
2741
- annotation: z16.discriminatedUnion("type", [
2742
- z16.object({
2743
- type: z16.literal("url_citation"),
2744
- start_index: z16.number(),
2745
- end_index: z16.number(),
2746
- url: z16.string(),
2747
- title: z16.string()
2805
+ z17.object({
2806
+ type: z17.literal("response.output_text.annotation.added"),
2807
+ annotation: z17.discriminatedUnion("type", [
2808
+ z17.object({
2809
+ type: z17.literal("url_citation"),
2810
+ start_index: z17.number(),
2811
+ end_index: z17.number(),
2812
+ url: z17.string(),
2813
+ title: z17.string()
2748
2814
  }),
2749
- z16.object({
2750
- type: z16.literal("file_citation"),
2751
- file_id: z16.string(),
2752
- filename: z16.string().nullish(),
2753
- index: z16.number().nullish(),
2754
- start_index: z16.number().nullish(),
2755
- end_index: z16.number().nullish(),
2756
- quote: z16.string().nullish()
2815
+ z17.object({
2816
+ type: z17.literal("file_citation"),
2817
+ file_id: z17.string(),
2818
+ filename: z17.string().nullish(),
2819
+ index: z17.number().nullish(),
2820
+ start_index: z17.number().nullish(),
2821
+ end_index: z17.number().nullish(),
2822
+ quote: z17.string().nullish()
2757
2823
  })
2758
2824
  ])
2759
2825
  }),
2760
- z16.object({
2761
- type: z16.literal("response.reasoning_summary_part.added"),
2762
- item_id: z16.string(),
2763
- summary_index: z16.number()
2826
+ z17.object({
2827
+ type: z17.literal("response.reasoning_summary_part.added"),
2828
+ item_id: z17.string(),
2829
+ summary_index: z17.number()
2764
2830
  }),
2765
- z16.object({
2766
- type: z16.literal("response.reasoning_summary_text.delta"),
2767
- item_id: z16.string(),
2768
- summary_index: z16.number(),
2769
- delta: z16.string()
2831
+ z17.object({
2832
+ type: z17.literal("response.reasoning_summary_text.delta"),
2833
+ item_id: z17.string(),
2834
+ summary_index: z17.number(),
2835
+ delta: z17.string()
2770
2836
  }),
2771
- z16.object({
2772
- type: z16.literal("response.reasoning_summary_part.done"),
2773
- item_id: z16.string(),
2774
- summary_index: z16.number()
2837
+ z17.object({
2838
+ type: z17.literal("response.reasoning_summary_part.done"),
2839
+ item_id: z17.string(),
2840
+ summary_index: z17.number()
2775
2841
  }),
2776
- z16.object({
2777
- type: z16.literal("error"),
2778
- sequence_number: z16.number(),
2779
- error: z16.object({
2780
- type: z16.string(),
2781
- code: z16.string(),
2782
- message: z16.string(),
2783
- param: z16.string().nullish()
2842
+ z17.object({
2843
+ type: z17.literal("error"),
2844
+ sequence_number: z17.number(),
2845
+ error: z17.object({
2846
+ type: z17.string(),
2847
+ code: z17.string(),
2848
+ message: z17.string(),
2849
+ param: z17.string().nullish()
2784
2850
  })
2785
2851
  }),
2786
- z16.object({ type: z16.string() }).loose().transform((value) => ({
2852
+ z17.object({ type: z17.string() }).loose().transform((value) => ({
2787
2853
  type: "unknown_chunk",
2788
2854
  message: value.type
2789
2855
  }))
@@ -2791,186 +2857,186 @@ var openaiResponsesChunkSchema = lazyValidator8(
2791
2857
  ])
2792
2858
  )
2793
2859
  );
2794
- var openaiResponsesResponseSchema = lazyValidator8(
2795
- () => zodSchema14(
2796
- z16.object({
2797
- id: z16.string().optional(),
2798
- created_at: z16.number().optional(),
2799
- error: z16.object({
2800
- message: z16.string(),
2801
- type: z16.string(),
2802
- param: z16.string().nullish(),
2803
- code: z16.string()
2860
+ var openaiResponsesResponseSchema = lazyValidator9(
2861
+ () => zodSchema15(
2862
+ z17.object({
2863
+ id: z17.string().optional(),
2864
+ created_at: z17.number().optional(),
2865
+ error: z17.object({
2866
+ message: z17.string(),
2867
+ type: z17.string(),
2868
+ param: z17.string().nullish(),
2869
+ code: z17.string()
2804
2870
  }).nullish(),
2805
- model: z16.string().optional(),
2806
- output: z16.array(
2807
- z16.discriminatedUnion("type", [
2808
- z16.object({
2809
- type: z16.literal("message"),
2810
- role: z16.literal("assistant"),
2811
- id: z16.string(),
2812
- phase: z16.enum(["commentary", "final_answer"]).nullish(),
2813
- content: z16.array(
2814
- z16.object({
2815
- type: z16.literal("output_text"),
2816
- text: z16.string(),
2817
- logprobs: z16.array(
2818
- z16.object({
2819
- token: z16.string(),
2820
- logprob: z16.number(),
2821
- top_logprobs: z16.array(
2822
- z16.object({
2823
- token: z16.string(),
2824
- logprob: z16.number()
2871
+ model: z17.string().optional(),
2872
+ output: z17.array(
2873
+ z17.discriminatedUnion("type", [
2874
+ z17.object({
2875
+ type: z17.literal("message"),
2876
+ role: z17.literal("assistant"),
2877
+ id: z17.string(),
2878
+ phase: z17.enum(["commentary", "final_answer"]).nullish(),
2879
+ content: z17.array(
2880
+ z17.object({
2881
+ type: z17.literal("output_text"),
2882
+ text: z17.string(),
2883
+ logprobs: z17.array(
2884
+ z17.object({
2885
+ token: z17.string(),
2886
+ logprob: z17.number(),
2887
+ top_logprobs: z17.array(
2888
+ z17.object({
2889
+ token: z17.string(),
2890
+ logprob: z17.number()
2825
2891
  })
2826
2892
  )
2827
2893
  })
2828
2894
  ).nullish(),
2829
- annotations: z16.array(
2830
- z16.discriminatedUnion("type", [
2831
- z16.object({
2832
- type: z16.literal("url_citation"),
2833
- start_index: z16.number(),
2834
- end_index: z16.number(),
2835
- url: z16.string(),
2836
- title: z16.string()
2895
+ annotations: z17.array(
2896
+ z17.discriminatedUnion("type", [
2897
+ z17.object({
2898
+ type: z17.literal("url_citation"),
2899
+ start_index: z17.number(),
2900
+ end_index: z17.number(),
2901
+ url: z17.string(),
2902
+ title: z17.string()
2837
2903
  }),
2838
- z16.object({
2839
- type: z16.literal("file_citation"),
2840
- file_id: z16.string(),
2841
- filename: z16.string().nullish(),
2842
- index: z16.number().nullish(),
2843
- start_index: z16.number().nullish(),
2844
- end_index: z16.number().nullish(),
2845
- quote: z16.string().nullish()
2904
+ z17.object({
2905
+ type: z17.literal("file_citation"),
2906
+ file_id: z17.string(),
2907
+ filename: z17.string().nullish(),
2908
+ index: z17.number().nullish(),
2909
+ start_index: z17.number().nullish(),
2910
+ end_index: z17.number().nullish(),
2911
+ quote: z17.string().nullish()
2846
2912
  }),
2847
- z16.object({
2848
- type: z16.literal("container_file_citation"),
2849
- container_id: z16.string(),
2850
- file_id: z16.string(),
2851
- filename: z16.string().nullish(),
2852
- start_index: z16.number().nullish(),
2853
- end_index: z16.number().nullish(),
2854
- index: z16.number().nullish()
2913
+ z17.object({
2914
+ type: z17.literal("container_file_citation"),
2915
+ container_id: z17.string(),
2916
+ file_id: z17.string(),
2917
+ filename: z17.string().nullish(),
2918
+ start_index: z17.number().nullish(),
2919
+ end_index: z17.number().nullish(),
2920
+ index: z17.number().nullish()
2855
2921
  }),
2856
- z16.object({
2857
- type: z16.literal("file_path"),
2858
- file_id: z16.string(),
2859
- index: z16.number().nullish()
2922
+ z17.object({
2923
+ type: z17.literal("file_path"),
2924
+ file_id: z17.string(),
2925
+ index: z17.number().nullish()
2860
2926
  })
2861
2927
  ])
2862
2928
  )
2863
2929
  })
2864
2930
  )
2865
2931
  }),
2866
- z16.object({
2867
- type: z16.literal("web_search_call"),
2868
- id: z16.string(),
2869
- status: z16.string(),
2870
- action: z16.discriminatedUnion("type", [
2871
- z16.object({
2872
- type: z16.literal("search"),
2873
- query: z16.string().nullish(),
2874
- sources: z16.array(
2875
- z16.discriminatedUnion("type", [
2876
- z16.object({ type: z16.literal("url"), url: z16.string() }),
2877
- z16.object({
2878
- type: z16.literal("api"),
2879
- name: z16.string()
2932
+ z17.object({
2933
+ type: z17.literal("web_search_call"),
2934
+ id: z17.string(),
2935
+ status: z17.string(),
2936
+ action: z17.discriminatedUnion("type", [
2937
+ z17.object({
2938
+ type: z17.literal("search"),
2939
+ query: z17.string().nullish(),
2940
+ sources: z17.array(
2941
+ z17.discriminatedUnion("type", [
2942
+ z17.object({ type: z17.literal("url"), url: z17.string() }),
2943
+ z17.object({
2944
+ type: z17.literal("api"),
2945
+ name: z17.string()
2880
2946
  })
2881
2947
  ])
2882
2948
  ).nullish()
2883
2949
  }),
2884
- z16.object({
2885
- type: z16.literal("open_page"),
2886
- url: z16.string().nullish()
2950
+ z17.object({
2951
+ type: z17.literal("open_page"),
2952
+ url: z17.string().nullish()
2887
2953
  }),
2888
- z16.object({
2889
- type: z16.literal("find_in_page"),
2890
- url: z16.string().nullish(),
2891
- pattern: z16.string().nullish()
2954
+ z17.object({
2955
+ type: z17.literal("find_in_page"),
2956
+ url: z17.string().nullish(),
2957
+ pattern: z17.string().nullish()
2892
2958
  })
2893
2959
  ]).nullish()
2894
2960
  }),
2895
- z16.object({
2896
- type: z16.literal("file_search_call"),
2897
- id: z16.string(),
2898
- queries: z16.array(z16.string()),
2899
- results: z16.array(
2900
- z16.object({
2901
- attributes: z16.record(
2902
- z16.string(),
2903
- z16.union([z16.string(), z16.number(), z16.boolean()])
2961
+ z17.object({
2962
+ type: z17.literal("file_search_call"),
2963
+ id: z17.string(),
2964
+ queries: z17.array(z17.string()),
2965
+ results: z17.array(
2966
+ z17.object({
2967
+ attributes: z17.record(
2968
+ z17.string(),
2969
+ z17.union([z17.string(), z17.number(), z17.boolean()])
2904
2970
  ),
2905
- file_id: z16.string(),
2906
- filename: z16.string(),
2907
- score: z16.number(),
2908
- text: z16.string()
2971
+ file_id: z17.string(),
2972
+ filename: z17.string(),
2973
+ score: z17.number(),
2974
+ text: z17.string()
2909
2975
  })
2910
2976
  ).nullish()
2911
2977
  }),
2912
- z16.object({
2913
- type: z16.literal("code_interpreter_call"),
2914
- id: z16.string(),
2915
- code: z16.string().nullable(),
2916
- container_id: z16.string(),
2917
- outputs: z16.array(
2918
- z16.discriminatedUnion("type", [
2919
- z16.object({ type: z16.literal("logs"), logs: z16.string() }),
2920
- z16.object({ type: z16.literal("image"), url: z16.string() })
2978
+ z17.object({
2979
+ type: z17.literal("code_interpreter_call"),
2980
+ id: z17.string(),
2981
+ code: z17.string().nullable(),
2982
+ container_id: z17.string(),
2983
+ outputs: z17.array(
2984
+ z17.discriminatedUnion("type", [
2985
+ z17.object({ type: z17.literal("logs"), logs: z17.string() }),
2986
+ z17.object({ type: z17.literal("image"), url: z17.string() })
2921
2987
  ])
2922
2988
  ).nullable()
2923
2989
  }),
2924
- z16.object({
2925
- type: z16.literal("image_generation_call"),
2926
- id: z16.string(),
2927
- result: z16.string()
2990
+ z17.object({
2991
+ type: z17.literal("image_generation_call"),
2992
+ id: z17.string(),
2993
+ result: z17.string()
2928
2994
  }),
2929
- z16.object({
2930
- type: z16.literal("local_shell_call"),
2931
- id: z16.string(),
2932
- call_id: z16.string(),
2933
- action: z16.object({
2934
- type: z16.literal("exec"),
2935
- command: z16.array(z16.string()),
2936
- timeout_ms: z16.number().optional(),
2937
- user: z16.string().optional(),
2938
- working_directory: z16.string().optional(),
2939
- env: z16.record(z16.string(), z16.string()).optional()
2995
+ z17.object({
2996
+ type: z17.literal("local_shell_call"),
2997
+ id: z17.string(),
2998
+ call_id: z17.string(),
2999
+ action: z17.object({
3000
+ type: z17.literal("exec"),
3001
+ command: z17.array(z17.string()),
3002
+ timeout_ms: z17.number().optional(),
3003
+ user: z17.string().optional(),
3004
+ working_directory: z17.string().optional(),
3005
+ env: z17.record(z17.string(), z17.string()).optional()
2940
3006
  })
2941
3007
  }),
2942
- z16.object({
2943
- type: z16.literal("function_call"),
2944
- call_id: z16.string(),
2945
- name: z16.string(),
2946
- arguments: z16.string(),
2947
- id: z16.string()
3008
+ z17.object({
3009
+ type: z17.literal("function_call"),
3010
+ call_id: z17.string(),
3011
+ name: z17.string(),
3012
+ arguments: z17.string(),
3013
+ id: z17.string()
2948
3014
  }),
2949
- z16.object({
2950
- type: z16.literal("computer_call"),
2951
- id: z16.string(),
2952
- status: z16.string().optional()
3015
+ z17.object({
3016
+ type: z17.literal("computer_call"),
3017
+ id: z17.string(),
3018
+ status: z17.string().optional()
2953
3019
  }),
2954
- z16.object({
2955
- type: z16.literal("reasoning"),
2956
- id: z16.string(),
2957
- encrypted_content: z16.string().nullish(),
2958
- summary: z16.array(
2959
- z16.object({
2960
- type: z16.literal("summary_text"),
2961
- text: z16.string()
3020
+ z17.object({
3021
+ type: z17.literal("reasoning"),
3022
+ id: z17.string(),
3023
+ encrypted_content: z17.string().nullish(),
3024
+ summary: z17.array(
3025
+ z17.object({
3026
+ type: z17.literal("summary_text"),
3027
+ text: z17.string()
2962
3028
  })
2963
3029
  )
2964
3030
  })
2965
3031
  ])
2966
3032
  ).optional(),
2967
- service_tier: z16.string().nullish(),
2968
- incomplete_details: z16.object({ reason: z16.string() }).nullish(),
2969
- usage: z16.object({
2970
- input_tokens: z16.number(),
2971
- input_tokens_details: z16.object({ cached_tokens: z16.number().nullish() }).nullish(),
2972
- output_tokens: z16.number(),
2973
- output_tokens_details: z16.object({ reasoning_tokens: z16.number().nullish() }).nullish()
3033
+ service_tier: z17.string().nullish(),
3034
+ incomplete_details: z17.object({ reason: z17.string() }).nullish(),
3035
+ usage: z17.object({
3036
+ input_tokens: z17.number(),
3037
+ input_tokens_details: z17.object({ cached_tokens: z17.number().nullish() }).nullish(),
3038
+ output_tokens: z17.number(),
3039
+ output_tokens_details: z17.object({ reasoning_tokens: z17.number().nullish() }).nullish()
2974
3040
  }).optional()
2975
3041
  })
2976
3042
  )
@@ -2978,10 +3044,10 @@ var openaiResponsesResponseSchema = lazyValidator8(
2978
3044
 
2979
3045
  // src/responses/openai-responses-options.ts
2980
3046
  import {
2981
- lazyValidator as lazyValidator9,
2982
- zodSchema as zodSchema15
3047
+ lazyValidator as lazyValidator10,
3048
+ zodSchema as zodSchema16
2983
3049
  } from "@ai-sdk/provider-utils";
2984
- import { z as z17 } from "zod/v4";
3050
+ import { z as z18 } from "zod/v4";
2985
3051
  var TOP_LOGPROBS_MAX = 20;
2986
3052
  var openaiResponsesReasoningModelIds = [
2987
3053
  "o1",
@@ -3063,19 +3129,19 @@ var openaiResponsesModelIds = [
3063
3129
  "gpt-5-chat-latest",
3064
3130
  ...openaiResponsesReasoningModelIds
3065
3131
  ];
3066
- var openaiResponsesProviderOptionsSchema = lazyValidator9(
3067
- () => zodSchema15(
3068
- z17.object({
3069
- conversation: z17.string().nullish(),
3070
- include: z17.array(
3071
- z17.enum([
3132
+ var openaiResponsesProviderOptionsSchema = lazyValidator10(
3133
+ () => zodSchema16(
3134
+ z18.object({
3135
+ conversation: z18.string().nullish(),
3136
+ include: z18.array(
3137
+ z18.enum([
3072
3138
  "reasoning.encrypted_content",
3073
3139
  // handled internally by default, only needed for unknown reasoning models
3074
3140
  "file_search_call.results",
3075
3141
  "message.output_text.logprobs"
3076
3142
  ])
3077
3143
  ).nullish(),
3078
- instructions: z17.string().nullish(),
3144
+ instructions: z18.string().nullish(),
3079
3145
  /**
3080
3146
  * Return the log probabilities of the tokens.
3081
3147
  *
@@ -3088,17 +3154,17 @@ var openaiResponsesProviderOptionsSchema = lazyValidator9(
3088
3154
  * @see https://platform.openai.com/docs/api-reference/responses/create
3089
3155
  * @see https://cookbook.openai.com/examples/using_logprobs
3090
3156
  */
3091
- logprobs: z17.union([z17.boolean(), z17.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
3157
+ logprobs: z18.union([z18.boolean(), z18.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
3092
3158
  /**
3093
3159
  * The maximum number of total calls to built-in tools that can be processed in a response.
3094
3160
  * This maximum number applies across all built-in tool calls, not per individual tool.
3095
3161
  * Any further attempts to call a tool by the model will be ignored.
3096
3162
  */
3097
- maxToolCalls: z17.number().nullish(),
3098
- metadata: z17.any().nullish(),
3099
- parallelToolCalls: z17.boolean().nullish(),
3100
- previousResponseId: z17.string().nullish(),
3101
- promptCacheKey: z17.string().nullish(),
3163
+ maxToolCalls: z18.number().nullish(),
3164
+ metadata: z18.any().nullish(),
3165
+ parallelToolCalls: z18.boolean().nullish(),
3166
+ previousResponseId: z18.string().nullish(),
3167
+ promptCacheKey: z18.string().nullish(),
3102
3168
  /**
3103
3169
  * The retention policy for the prompt cache.
3104
3170
  * - 'in_memory': Default. Standard prompt caching behavior.
@@ -3107,7 +3173,7 @@ var openaiResponsesProviderOptionsSchema = lazyValidator9(
3107
3173
  *
3108
3174
  * @default 'in_memory'
3109
3175
  */
3110
- promptCacheRetention: z17.enum(["in_memory", "24h"]).nullish(),
3176
+ promptCacheRetention: z18.enum(["in_memory", "24h"]).nullish(),
3111
3177
  /**
3112
3178
  * Reasoning effort for reasoning models. Defaults to `medium`. If you use
3113
3179
  * `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
@@ -3118,15 +3184,15 @@ var openaiResponsesProviderOptionsSchema = lazyValidator9(
3118
3184
  * OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
3119
3185
  * an error.
3120
3186
  */
3121
- reasoningEffort: z17.string().nullish(),
3122
- reasoningSummary: z17.string().nullish(),
3123
- safetyIdentifier: z17.string().nullish(),
3124
- serviceTier: z17.enum(["auto", "flex", "priority", "default"]).nullish(),
3125
- store: z17.boolean().nullish(),
3126
- strictJsonSchema: z17.boolean().nullish(),
3127
- textVerbosity: z17.enum(["low", "medium", "high"]).nullish(),
3128
- truncation: z17.enum(["auto", "disabled"]).nullish(),
3129
- user: z17.string().nullish()
3187
+ reasoningEffort: z18.string().nullish(),
3188
+ reasoningSummary: z18.string().nullish(),
3189
+ safetyIdentifier: z18.string().nullish(),
3190
+ serviceTier: z18.enum(["auto", "flex", "priority", "default"]).nullish(),
3191
+ store: z18.boolean().nullish(),
3192
+ strictJsonSchema: z18.boolean().nullish(),
3193
+ textVerbosity: z18.enum(["low", "medium", "high"]).nullish(),
3194
+ truncation: z18.enum(["auto", "disabled"]).nullish(),
3195
+ user: z18.string().nullish()
3130
3196
  })
3131
3197
  )
3132
3198
  );
@@ -3327,7 +3393,7 @@ var OpenAIResponsesLanguageModel = class {
3327
3393
  if (stopSequences != null) {
3328
3394
  warnings.push({ type: "unsupported-setting", setting: "stopSequences" });
3329
3395
  }
3330
- const openaiOptions = await parseProviderOptions5({
3396
+ const openaiOptions = await parseProviderOptions6({
3331
3397
  provider: "openai",
3332
3398
  providerOptions,
3333
3399
  schema: openaiResponsesProviderOptionsSchema
@@ -4366,21 +4432,21 @@ function mapWebSearchOutput(action) {
4366
4432
  import {
4367
4433
  combineHeaders as combineHeaders6,
4368
4434
  createBinaryResponseHandler,
4369
- parseProviderOptions as parseProviderOptions6,
4435
+ parseProviderOptions as parseProviderOptions7,
4370
4436
  postJsonToApi as postJsonToApi6
4371
4437
  } from "@ai-sdk/provider-utils";
4372
4438
 
4373
4439
  // src/speech/openai-speech-options.ts
4374
4440
  import {
4375
- lazyValidator as lazyValidator10,
4376
- zodSchema as zodSchema16
4441
+ lazyValidator as lazyValidator11,
4442
+ zodSchema as zodSchema17
4377
4443
  } from "@ai-sdk/provider-utils";
4378
- import { z as z18 } from "zod/v4";
4379
- var openaiSpeechProviderOptionsSchema = lazyValidator10(
4380
- () => zodSchema16(
4381
- z18.object({
4382
- instructions: z18.string().nullish(),
4383
- speed: z18.number().min(0.25).max(4).default(1).nullish()
4444
+ import { z as z19 } from "zod/v4";
4445
+ var openaiSpeechProviderOptionsSchema = lazyValidator11(
4446
+ () => zodSchema17(
4447
+ z19.object({
4448
+ instructions: z19.string().nullish(),
4449
+ speed: z19.number().min(0.25).max(4).default(1).nullish()
4384
4450
  })
4385
4451
  )
4386
4452
  );
@@ -4405,7 +4471,7 @@ var OpenAISpeechModel = class {
4405
4471
  providerOptions
4406
4472
  }) {
4407
4473
  const warnings = [];
4408
- const openAIOptions = await parseProviderOptions6({
4474
+ const openAIOptions = await parseProviderOptions7({
4409
4475
  provider: "openai",
4410
4476
  providerOptions,
4411
4477
  schema: openaiSpeechProviderOptionsSchema
@@ -4492,38 +4558,38 @@ import {
4492
4558
  convertBase64ToUint8Array,
4493
4559
  createJsonResponseHandler as createJsonResponseHandler6,
4494
4560
  mediaTypeToExtension,
4495
- parseProviderOptions as parseProviderOptions7,
4561
+ parseProviderOptions as parseProviderOptions8,
4496
4562
  postFormDataToApi
4497
4563
  } from "@ai-sdk/provider-utils";
4498
4564
 
4499
4565
  // src/transcription/openai-transcription-api.ts
4500
- import { lazyValidator as lazyValidator11, zodSchema as zodSchema17 } from "@ai-sdk/provider-utils";
4501
- import { z as z19 } from "zod/v4";
4502
- var openaiTranscriptionResponseSchema = lazyValidator11(
4503
- () => zodSchema17(
4504
- z19.object({
4505
- text: z19.string(),
4506
- language: z19.string().nullish(),
4507
- duration: z19.number().nullish(),
4508
- words: z19.array(
4509
- z19.object({
4510
- word: z19.string(),
4511
- start: z19.number(),
4512
- end: z19.number()
4566
+ import { lazyValidator as lazyValidator12, zodSchema as zodSchema18 } from "@ai-sdk/provider-utils";
4567
+ import { z as z20 } from "zod/v4";
4568
+ var openaiTranscriptionResponseSchema = lazyValidator12(
4569
+ () => zodSchema18(
4570
+ z20.object({
4571
+ text: z20.string(),
4572
+ language: z20.string().nullish(),
4573
+ duration: z20.number().nullish(),
4574
+ words: z20.array(
4575
+ z20.object({
4576
+ word: z20.string(),
4577
+ start: z20.number(),
4578
+ end: z20.number()
4513
4579
  })
4514
4580
  ).nullish(),
4515
- segments: z19.array(
4516
- z19.object({
4517
- id: z19.number(),
4518
- seek: z19.number(),
4519
- start: z19.number(),
4520
- end: z19.number(),
4521
- text: z19.string(),
4522
- tokens: z19.array(z19.number()),
4523
- temperature: z19.number(),
4524
- avg_logprob: z19.number(),
4525
- compression_ratio: z19.number(),
4526
- no_speech_prob: z19.number()
4581
+ segments: z20.array(
4582
+ z20.object({
4583
+ id: z20.number(),
4584
+ seek: z20.number(),
4585
+ start: z20.number(),
4586
+ end: z20.number(),
4587
+ text: z20.string(),
4588
+ tokens: z20.array(z20.number()),
4589
+ temperature: z20.number(),
4590
+ avg_logprob: z20.number(),
4591
+ compression_ratio: z20.number(),
4592
+ no_speech_prob: z20.number()
4527
4593
  })
4528
4594
  ).nullish()
4529
4595
  })
@@ -4532,35 +4598,35 @@ var openaiTranscriptionResponseSchema = lazyValidator11(
4532
4598
 
4533
4599
  // src/transcription/openai-transcription-options.ts
4534
4600
  import {
4535
- lazyValidator as lazyValidator12,
4536
- zodSchema as zodSchema18
4601
+ lazyValidator as lazyValidator13,
4602
+ zodSchema as zodSchema19
4537
4603
  } from "@ai-sdk/provider-utils";
4538
- import { z as z20 } from "zod/v4";
4539
- var openAITranscriptionProviderOptions = lazyValidator12(
4540
- () => zodSchema18(
4541
- z20.object({
4604
+ import { z as z21 } from "zod/v4";
4605
+ var openAITranscriptionProviderOptions = lazyValidator13(
4606
+ () => zodSchema19(
4607
+ z21.object({
4542
4608
  /**
4543
4609
  * Additional information to include in the transcription response.
4544
4610
  */
4545
- include: z20.array(z20.string()).optional(),
4611
+ include: z21.array(z21.string()).optional(),
4546
4612
  /**
4547
4613
  * The language of the input audio in ISO-639-1 format.
4548
4614
  */
4549
- language: z20.string().optional(),
4615
+ language: z21.string().optional(),
4550
4616
  /**
4551
4617
  * An optional text to guide the model's style or continue a previous audio segment.
4552
4618
  */
4553
- prompt: z20.string().optional(),
4619
+ prompt: z21.string().optional(),
4554
4620
  /**
4555
4621
  * The sampling temperature, between 0 and 1.
4556
4622
  * @default 0
4557
4623
  */
4558
- temperature: z20.number().min(0).max(1).default(0).optional(),
4624
+ temperature: z21.number().min(0).max(1).default(0).optional(),
4559
4625
  /**
4560
4626
  * The timestamp granularities to populate for this transcription.
4561
4627
  * @default ['segment']
4562
4628
  */
4563
- timestampGranularities: z20.array(z20.enum(["word", "segment"])).default(["segment"]).optional()
4629
+ timestampGranularities: z21.array(z21.enum(["word", "segment"])).default(["segment"]).optional()
4564
4630
  })
4565
4631
  )
4566
4632
  );
@@ -4640,7 +4706,7 @@ var OpenAITranscriptionModel = class {
4640
4706
  providerOptions
4641
4707
  }) {
4642
4708
  const warnings = [];
4643
- const openAIOptions = await parseProviderOptions7({
4709
+ const openAIOptions = await parseProviderOptions8({
4644
4710
  provider: "openai",
4645
4711
  providerOptions,
4646
4712
  schema: openAITranscriptionProviderOptions
@@ -4733,7 +4799,7 @@ var OpenAITranscriptionModel = class {
4733
4799
  };
4734
4800
 
4735
4801
  // src/version.ts
4736
- var VERSION = true ? "2.0.105" : "0.0.0-test";
4802
+ var VERSION = true ? "2.0.106" : "0.0.0-test";
4737
4803
 
4738
4804
  // src/openai-provider.ts
4739
4805
  function createOpenAI(options = {}) {