@ai-sdk/openai 2.0.104 → 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.
@@ -1648,6 +1648,7 @@ var OpenAIEmbeddingModel = class {
1648
1648
  import {
1649
1649
  combineHeaders as combineHeaders4,
1650
1650
  createJsonResponseHandler as createJsonResponseHandler4,
1651
+ parseProviderOptions as parseProviderOptions4,
1651
1652
  postJsonToApi as postJsonToApi4
1652
1653
  } from "@ai-sdk/provider-utils";
1653
1654
 
@@ -1682,6 +1683,11 @@ var openaiImageResponseSchema = lazyValidator7(
1682
1683
  );
1683
1684
 
1684
1685
  // src/image/openai-image-options.ts
1686
+ import {
1687
+ lazyValidator as lazyValidator8,
1688
+ zodSchema as zodSchema8
1689
+ } from "@ai-sdk/provider-utils";
1690
+ import { z as z9 } from "zod/v4";
1685
1691
  var modelMaxImagesPerCall = {
1686
1692
  "dall-e-3": 1,
1687
1693
  "dall-e-2": 10,
@@ -1696,6 +1702,55 @@ var hasDefaultResponseFormat = /* @__PURE__ */ new Set([
1696
1702
  "gpt-image-1.5",
1697
1703
  "gpt-image-2"
1698
1704
  ]);
1705
+ var baseImageModelOptionsObject = z9.object({
1706
+ /**
1707
+ * Quality of the generated image(s).
1708
+ *
1709
+ * Valid values: `standard`, `hd`, `low`, `medium`, `high`, `auto`.
1710
+ */
1711
+ quality: z9.enum(["standard", "hd", "low", "medium", "high", "auto"]).optional(),
1712
+ /**
1713
+ * Background behavior for the generated image(s).
1714
+ *
1715
+ * If `transparent`, the output format must support transparency
1716
+ * (i.e. `png` or `webp`).
1717
+ */
1718
+ background: z9.enum(["transparent", "opaque", "auto"]).optional(),
1719
+ /**
1720
+ * Format in which the generated image(s) are returned.
1721
+ */
1722
+ outputFormat: z9.enum(["png", "jpeg", "webp"]).optional(),
1723
+ /**
1724
+ * Compression level (0-100) for the generated image(s). Applies to the
1725
+ * `jpeg` and `webp` output formats.
1726
+ */
1727
+ outputCompression: z9.number().int().min(0).max(100).optional(),
1728
+ /**
1729
+ * A unique identifier representing your end-user, which can help OpenAI
1730
+ * to monitor and detect abuse.
1731
+ */
1732
+ user: z9.string().optional()
1733
+ });
1734
+ var openaiImageModelOptions = lazyValidator8(
1735
+ () => zodSchema8(baseImageModelOptionsObject)
1736
+ );
1737
+ var openaiImageModelGenerationOptions = lazyValidator8(
1738
+ () => zodSchema8(
1739
+ baseImageModelOptionsObject.extend({
1740
+ /**
1741
+ * Style of the generated image. `vivid` produces hyper-real and
1742
+ * dramatic images; `natural` produces more subdued, less hyper-real
1743
+ * looking images.
1744
+ */
1745
+ style: z9.enum(["vivid", "natural"]).optional(),
1746
+ /**
1747
+ * Content moderation level for the generated image(s). `low` applies
1748
+ * less restrictive filtering.
1749
+ */
1750
+ moderation: z9.enum(["auto", "low"]).optional()
1751
+ })
1752
+ )
1753
+ );
1699
1754
 
1700
1755
  // src/image/openai-image-model.ts
1701
1756
  var OpenAIImageModel = class {
@@ -1734,6 +1789,11 @@ var OpenAIImageModel = class {
1734
1789
  warnings.push({ type: "unsupported-setting", setting: "seed" });
1735
1790
  }
1736
1791
  const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
1792
+ const openaiOptions = (_d = await parseProviderOptions4({
1793
+ provider: "openai",
1794
+ providerOptions,
1795
+ schema: openaiImageModelGenerationOptions
1796
+ })) != null ? _d : {};
1737
1797
  const { value: response, responseHeaders } = await postJsonToApi4({
1738
1798
  url: this.config.url({
1739
1799
  path: "/images/generations",
@@ -1745,7 +1805,13 @@ var OpenAIImageModel = class {
1745
1805
  prompt,
1746
1806
  n,
1747
1807
  size,
1748
- ...(_d = providerOptions.openai) != null ? _d : {},
1808
+ quality: openaiOptions.quality,
1809
+ style: openaiOptions.style,
1810
+ background: openaiOptions.background,
1811
+ moderation: openaiOptions.moderation,
1812
+ output_format: openaiOptions.outputFormat,
1813
+ output_compression: openaiOptions.outputCompression,
1814
+ user: openaiOptions.user,
1749
1815
  ...!hasDefaultResponseFormat.has(this.modelId) ? { response_format: "b64_json" } : {}
1750
1816
  },
1751
1817
  failedResponseHandler: openaiFailedResponseHandler,
@@ -1818,38 +1884,38 @@ import {
1818
1884
  convertBase64ToUint8Array,
1819
1885
  createJsonResponseHandler as createJsonResponseHandler5,
1820
1886
  mediaTypeToExtension,
1821
- parseProviderOptions as parseProviderOptions4,
1887
+ parseProviderOptions as parseProviderOptions5,
1822
1888
  postFormDataToApi
1823
1889
  } from "@ai-sdk/provider-utils";
1824
1890
 
1825
1891
  // src/transcription/openai-transcription-api.ts
1826
- import { lazyValidator as lazyValidator8, zodSchema as zodSchema8 } from "@ai-sdk/provider-utils";
1827
- import { z as z9 } from "zod/v4";
1828
- var openaiTranscriptionResponseSchema = lazyValidator8(
1829
- () => zodSchema8(
1830
- z9.object({
1831
- text: z9.string(),
1832
- language: z9.string().nullish(),
1833
- duration: z9.number().nullish(),
1834
- words: z9.array(
1835
- z9.object({
1836
- word: z9.string(),
1837
- start: z9.number(),
1838
- end: z9.number()
1892
+ import { lazyValidator as lazyValidator9, zodSchema as zodSchema9 } from "@ai-sdk/provider-utils";
1893
+ import { z as z10 } from "zod/v4";
1894
+ var openaiTranscriptionResponseSchema = lazyValidator9(
1895
+ () => zodSchema9(
1896
+ z10.object({
1897
+ text: z10.string(),
1898
+ language: z10.string().nullish(),
1899
+ duration: z10.number().nullish(),
1900
+ words: z10.array(
1901
+ z10.object({
1902
+ word: z10.string(),
1903
+ start: z10.number(),
1904
+ end: z10.number()
1839
1905
  })
1840
1906
  ).nullish(),
1841
- segments: z9.array(
1842
- z9.object({
1843
- id: z9.number(),
1844
- seek: z9.number(),
1845
- start: z9.number(),
1846
- end: z9.number(),
1847
- text: z9.string(),
1848
- tokens: z9.array(z9.number()),
1849
- temperature: z9.number(),
1850
- avg_logprob: z9.number(),
1851
- compression_ratio: z9.number(),
1852
- no_speech_prob: z9.number()
1907
+ segments: z10.array(
1908
+ z10.object({
1909
+ id: z10.number(),
1910
+ seek: z10.number(),
1911
+ start: z10.number(),
1912
+ end: z10.number(),
1913
+ text: z10.string(),
1914
+ tokens: z10.array(z10.number()),
1915
+ temperature: z10.number(),
1916
+ avg_logprob: z10.number(),
1917
+ compression_ratio: z10.number(),
1918
+ no_speech_prob: z10.number()
1853
1919
  })
1854
1920
  ).nullish()
1855
1921
  })
@@ -1858,35 +1924,35 @@ var openaiTranscriptionResponseSchema = lazyValidator8(
1858
1924
 
1859
1925
  // src/transcription/openai-transcription-options.ts
1860
1926
  import {
1861
- lazyValidator as lazyValidator9,
1862
- zodSchema as zodSchema9
1927
+ lazyValidator as lazyValidator10,
1928
+ zodSchema as zodSchema10
1863
1929
  } from "@ai-sdk/provider-utils";
1864
- import { z as z10 } from "zod/v4";
1865
- var openAITranscriptionProviderOptions = lazyValidator9(
1866
- () => zodSchema9(
1867
- z10.object({
1930
+ import { z as z11 } from "zod/v4";
1931
+ var openAITranscriptionProviderOptions = lazyValidator10(
1932
+ () => zodSchema10(
1933
+ z11.object({
1868
1934
  /**
1869
1935
  * Additional information to include in the transcription response.
1870
1936
  */
1871
- include: z10.array(z10.string()).optional(),
1937
+ include: z11.array(z11.string()).optional(),
1872
1938
  /**
1873
1939
  * The language of the input audio in ISO-639-1 format.
1874
1940
  */
1875
- language: z10.string().optional(),
1941
+ language: z11.string().optional(),
1876
1942
  /**
1877
1943
  * An optional text to guide the model's style or continue a previous audio segment.
1878
1944
  */
1879
- prompt: z10.string().optional(),
1945
+ prompt: z11.string().optional(),
1880
1946
  /**
1881
1947
  * The sampling temperature, between 0 and 1.
1882
1948
  * @default 0
1883
1949
  */
1884
- temperature: z10.number().min(0).max(1).default(0).optional(),
1950
+ temperature: z11.number().min(0).max(1).default(0).optional(),
1885
1951
  /**
1886
1952
  * The timestamp granularities to populate for this transcription.
1887
1953
  * @default ['segment']
1888
1954
  */
1889
- timestampGranularities: z10.array(z10.enum(["word", "segment"])).default(["segment"]).optional()
1955
+ timestampGranularities: z11.array(z11.enum(["word", "segment"])).default(["segment"]).optional()
1890
1956
  })
1891
1957
  )
1892
1958
  );
@@ -1966,7 +2032,7 @@ var OpenAITranscriptionModel = class {
1966
2032
  providerOptions
1967
2033
  }) {
1968
2034
  const warnings = [];
1969
- const openAIOptions = await parseProviderOptions4({
2035
+ const openAIOptions = await parseProviderOptions5({
1970
2036
  provider: "openai",
1971
2037
  providerOptions,
1972
2038
  schema: openAITranscriptionProviderOptions
@@ -2062,21 +2128,21 @@ var OpenAITranscriptionModel = class {
2062
2128
  import {
2063
2129
  combineHeaders as combineHeaders6,
2064
2130
  createBinaryResponseHandler,
2065
- parseProviderOptions as parseProviderOptions5,
2131
+ parseProviderOptions as parseProviderOptions6,
2066
2132
  postJsonToApi as postJsonToApi5
2067
2133
  } from "@ai-sdk/provider-utils";
2068
2134
 
2069
2135
  // src/speech/openai-speech-options.ts
2070
2136
  import {
2071
- lazyValidator as lazyValidator10,
2072
- zodSchema as zodSchema10
2137
+ lazyValidator as lazyValidator11,
2138
+ zodSchema as zodSchema11
2073
2139
  } from "@ai-sdk/provider-utils";
2074
- import { z as z11 } from "zod/v4";
2075
- var openaiSpeechProviderOptionsSchema = lazyValidator10(
2076
- () => zodSchema10(
2077
- z11.object({
2078
- instructions: z11.string().nullish(),
2079
- speed: z11.number().min(0.25).max(4).default(1).nullish()
2140
+ import { z as z12 } from "zod/v4";
2141
+ var openaiSpeechProviderOptionsSchema = lazyValidator11(
2142
+ () => zodSchema11(
2143
+ z12.object({
2144
+ instructions: z12.string().nullish(),
2145
+ speed: z12.number().min(0.25).max(4).default(1).nullish()
2080
2146
  })
2081
2147
  )
2082
2148
  );
@@ -2101,7 +2167,7 @@ var OpenAISpeechModel = class {
2101
2167
  providerOptions
2102
2168
  }) {
2103
2169
  const warnings = [];
2104
- const openAIOptions = await parseProviderOptions5({
2170
+ const openAIOptions = await parseProviderOptions6({
2105
2171
  provider: "openai",
2106
2172
  providerOptions,
2107
2173
  schema: openaiSpeechProviderOptionsSchema
@@ -2191,7 +2257,7 @@ import {
2191
2257
  createEventSourceResponseHandler as createEventSourceResponseHandler3,
2192
2258
  createJsonResponseHandler as createJsonResponseHandler6,
2193
2259
  generateId as generateId2,
2194
- parseProviderOptions as parseProviderOptions7,
2260
+ parseProviderOptions as parseProviderOptions8,
2195
2261
  postJsonToApi as postJsonToApi6
2196
2262
  } from "@ai-sdk/provider-utils";
2197
2263
 
@@ -2201,34 +2267,34 @@ import {
2201
2267
  } from "@ai-sdk/provider";
2202
2268
  import {
2203
2269
  convertToBase64 as convertToBase642,
2204
- parseProviderOptions as parseProviderOptions6,
2270
+ parseProviderOptions as parseProviderOptions7,
2205
2271
  validateTypes
2206
2272
  } from "@ai-sdk/provider-utils";
2207
- import { z as z13 } from "zod/v4";
2273
+ import { z as z14 } from "zod/v4";
2208
2274
 
2209
2275
  // src/tool/local-shell.ts
2210
2276
  import {
2211
2277
  createProviderDefinedToolFactoryWithOutputSchema,
2212
2278
  lazySchema,
2213
- zodSchema as zodSchema11
2279
+ zodSchema as zodSchema12
2214
2280
  } from "@ai-sdk/provider-utils";
2215
- import { z as z12 } from "zod/v4";
2281
+ import { z as z13 } from "zod/v4";
2216
2282
  var localShellInputSchema = lazySchema(
2217
- () => zodSchema11(
2218
- z12.object({
2219
- action: z12.object({
2220
- type: z12.literal("exec"),
2221
- command: z12.array(z12.string()),
2222
- timeoutMs: z12.number().optional(),
2223
- user: z12.string().optional(),
2224
- workingDirectory: z12.string().optional(),
2225
- env: z12.record(z12.string(), z12.string()).optional()
2283
+ () => zodSchema12(
2284
+ z13.object({
2285
+ action: z13.object({
2286
+ type: z13.literal("exec"),
2287
+ command: z13.array(z13.string()),
2288
+ timeoutMs: z13.number().optional(),
2289
+ user: z13.string().optional(),
2290
+ workingDirectory: z13.string().optional(),
2291
+ env: z13.record(z13.string(), z13.string()).optional()
2226
2292
  })
2227
2293
  })
2228
2294
  )
2229
2295
  );
2230
2296
  var localShellOutputSchema = lazySchema(
2231
- () => zodSchema11(z12.object({ output: z12.string() }))
2297
+ () => zodSchema12(z13.object({ output: z13.string() }))
2232
2298
  );
2233
2299
  var localShell = createProviderDefinedToolFactoryWithOutputSchema({
2234
2300
  id: "openai.local_shell",
@@ -2396,7 +2462,7 @@ async function convertToOpenAIResponsesInput({
2396
2462
  break;
2397
2463
  }
2398
2464
  case "reasoning": {
2399
- const providerOptions = await parseProviderOptions6({
2465
+ const providerOptions = await parseProviderOptions7({
2400
2466
  provider: "openai",
2401
2467
  providerOptions: part.providerOptions,
2402
2468
  schema: openaiResponsesReasoningProviderOptionsSchema
@@ -2525,9 +2591,9 @@ async function convertToOpenAIResponsesInput({
2525
2591
  }
2526
2592
  return { input, warnings };
2527
2593
  }
2528
- var openaiResponsesReasoningProviderOptionsSchema = z13.object({
2529
- itemId: z13.string().nullish(),
2530
- reasoningEncryptedContent: z13.string().nullish()
2594
+ var openaiResponsesReasoningProviderOptionsSchema = z14.object({
2595
+ itemId: z14.string().nullish(),
2596
+ reasoningEncryptedContent: z14.string().nullish()
2531
2597
  });
2532
2598
 
2533
2599
  // src/responses/map-openai-responses-finish-reason.ts
@@ -2550,277 +2616,277 @@ function mapOpenAIResponseFinishReason({
2550
2616
 
2551
2617
  // src/responses/openai-responses-api.ts
2552
2618
  import {
2553
- lazyValidator as lazyValidator11,
2554
- zodSchema as zodSchema12
2619
+ lazyValidator as lazyValidator12,
2620
+ zodSchema as zodSchema13
2555
2621
  } from "@ai-sdk/provider-utils";
2556
- import { z as z14 } from "zod/v4";
2557
- var openaiResponsesChunkSchema = lazyValidator11(
2558
- () => zodSchema12(
2559
- z14.union([
2560
- z14.object({
2561
- type: z14.literal("response.output_text.delta"),
2562
- item_id: z14.string(),
2563
- delta: z14.string(),
2564
- logprobs: z14.array(
2565
- z14.object({
2566
- token: z14.string(),
2567
- logprob: z14.number(),
2568
- top_logprobs: z14.array(
2569
- z14.object({
2570
- token: z14.string(),
2571
- logprob: z14.number()
2622
+ import { z as z15 } from "zod/v4";
2623
+ var openaiResponsesChunkSchema = lazyValidator12(
2624
+ () => zodSchema13(
2625
+ z15.union([
2626
+ z15.object({
2627
+ type: z15.literal("response.output_text.delta"),
2628
+ item_id: z15.string(),
2629
+ delta: z15.string(),
2630
+ logprobs: z15.array(
2631
+ z15.object({
2632
+ token: z15.string(),
2633
+ logprob: z15.number(),
2634
+ top_logprobs: z15.array(
2635
+ z15.object({
2636
+ token: z15.string(),
2637
+ logprob: z15.number()
2572
2638
  })
2573
2639
  )
2574
2640
  })
2575
2641
  ).nullish()
2576
2642
  }),
2577
- z14.object({
2578
- type: z14.enum(["response.completed", "response.incomplete"]),
2579
- response: z14.object({
2580
- incomplete_details: z14.object({ reason: z14.string() }).nullish(),
2581
- usage: z14.object({
2582
- input_tokens: z14.number(),
2583
- input_tokens_details: z14.object({ cached_tokens: z14.number().nullish() }).nullish(),
2584
- output_tokens: z14.number(),
2585
- output_tokens_details: z14.object({ reasoning_tokens: z14.number().nullish() }).nullish()
2643
+ z15.object({
2644
+ type: z15.enum(["response.completed", "response.incomplete"]),
2645
+ response: z15.object({
2646
+ incomplete_details: z15.object({ reason: z15.string() }).nullish(),
2647
+ usage: z15.object({
2648
+ input_tokens: z15.number(),
2649
+ input_tokens_details: z15.object({ cached_tokens: z15.number().nullish() }).nullish(),
2650
+ output_tokens: z15.number(),
2651
+ output_tokens_details: z15.object({ reasoning_tokens: z15.number().nullish() }).nullish()
2586
2652
  }),
2587
- service_tier: z14.string().nullish()
2653
+ service_tier: z15.string().nullish()
2588
2654
  })
2589
2655
  }),
2590
- z14.object({
2591
- type: z14.literal("response.created"),
2592
- response: z14.object({
2593
- id: z14.string(),
2594
- created_at: z14.number(),
2595
- model: z14.string(),
2596
- service_tier: z14.string().nullish()
2656
+ z15.object({
2657
+ type: z15.literal("response.created"),
2658
+ response: z15.object({
2659
+ id: z15.string(),
2660
+ created_at: z15.number(),
2661
+ model: z15.string(),
2662
+ service_tier: z15.string().nullish()
2597
2663
  })
2598
2664
  }),
2599
- z14.object({
2600
- type: z14.literal("response.output_item.added"),
2601
- output_index: z14.number(),
2602
- item: z14.discriminatedUnion("type", [
2603
- z14.object({
2604
- type: z14.literal("message"),
2605
- id: z14.string(),
2606
- phase: z14.enum(["commentary", "final_answer"]).nullish()
2665
+ z15.object({
2666
+ type: z15.literal("response.output_item.added"),
2667
+ output_index: z15.number(),
2668
+ item: z15.discriminatedUnion("type", [
2669
+ z15.object({
2670
+ type: z15.literal("message"),
2671
+ id: z15.string(),
2672
+ phase: z15.enum(["commentary", "final_answer"]).nullish()
2607
2673
  }),
2608
- z14.object({
2609
- type: z14.literal("reasoning"),
2610
- id: z14.string(),
2611
- encrypted_content: z14.string().nullish()
2674
+ z15.object({
2675
+ type: z15.literal("reasoning"),
2676
+ id: z15.string(),
2677
+ encrypted_content: z15.string().nullish()
2612
2678
  }),
2613
- z14.object({
2614
- type: z14.literal("function_call"),
2615
- id: z14.string(),
2616
- call_id: z14.string(),
2617
- name: z14.string(),
2618
- arguments: z14.string()
2679
+ z15.object({
2680
+ type: z15.literal("function_call"),
2681
+ id: z15.string(),
2682
+ call_id: z15.string(),
2683
+ name: z15.string(),
2684
+ arguments: z15.string()
2619
2685
  }),
2620
- z14.object({
2621
- type: z14.literal("web_search_call"),
2622
- id: z14.string(),
2623
- status: z14.string()
2686
+ z15.object({
2687
+ type: z15.literal("web_search_call"),
2688
+ id: z15.string(),
2689
+ status: z15.string()
2624
2690
  }),
2625
- z14.object({
2626
- type: z14.literal("computer_call"),
2627
- id: z14.string(),
2628
- status: z14.string()
2691
+ z15.object({
2692
+ type: z15.literal("computer_call"),
2693
+ id: z15.string(),
2694
+ status: z15.string()
2629
2695
  }),
2630
- z14.object({
2631
- type: z14.literal("file_search_call"),
2632
- id: z14.string()
2696
+ z15.object({
2697
+ type: z15.literal("file_search_call"),
2698
+ id: z15.string()
2633
2699
  }),
2634
- z14.object({
2635
- type: z14.literal("image_generation_call"),
2636
- id: z14.string()
2700
+ z15.object({
2701
+ type: z15.literal("image_generation_call"),
2702
+ id: z15.string()
2637
2703
  }),
2638
- z14.object({
2639
- type: z14.literal("code_interpreter_call"),
2640
- id: z14.string(),
2641
- container_id: z14.string(),
2642
- code: z14.string().nullable(),
2643
- outputs: z14.array(
2644
- z14.discriminatedUnion("type", [
2645
- z14.object({ type: z14.literal("logs"), logs: z14.string() }),
2646
- z14.object({ type: z14.literal("image"), url: z14.string() })
2704
+ z15.object({
2705
+ type: z15.literal("code_interpreter_call"),
2706
+ id: z15.string(),
2707
+ container_id: z15.string(),
2708
+ code: z15.string().nullable(),
2709
+ outputs: z15.array(
2710
+ z15.discriminatedUnion("type", [
2711
+ z15.object({ type: z15.literal("logs"), logs: z15.string() }),
2712
+ z15.object({ type: z15.literal("image"), url: z15.string() })
2647
2713
  ])
2648
2714
  ).nullable(),
2649
- status: z14.string()
2715
+ status: z15.string()
2650
2716
  })
2651
2717
  ])
2652
2718
  }),
2653
- z14.object({
2654
- type: z14.literal("response.output_item.done"),
2655
- output_index: z14.number(),
2656
- item: z14.discriminatedUnion("type", [
2657
- z14.object({
2658
- type: z14.literal("message"),
2659
- id: z14.string(),
2660
- phase: z14.enum(["commentary", "final_answer"]).nullish()
2719
+ z15.object({
2720
+ type: z15.literal("response.output_item.done"),
2721
+ output_index: z15.number(),
2722
+ item: z15.discriminatedUnion("type", [
2723
+ z15.object({
2724
+ type: z15.literal("message"),
2725
+ id: z15.string(),
2726
+ phase: z15.enum(["commentary", "final_answer"]).nullish()
2661
2727
  }),
2662
- z14.object({
2663
- type: z14.literal("reasoning"),
2664
- id: z14.string(),
2665
- encrypted_content: z14.string().nullish()
2728
+ z15.object({
2729
+ type: z15.literal("reasoning"),
2730
+ id: z15.string(),
2731
+ encrypted_content: z15.string().nullish()
2666
2732
  }),
2667
- z14.object({
2668
- type: z14.literal("function_call"),
2669
- id: z14.string(),
2670
- call_id: z14.string(),
2671
- name: z14.string(),
2672
- arguments: z14.string(),
2673
- status: z14.literal("completed")
2733
+ z15.object({
2734
+ type: z15.literal("function_call"),
2735
+ id: z15.string(),
2736
+ call_id: z15.string(),
2737
+ name: z15.string(),
2738
+ arguments: z15.string(),
2739
+ status: z15.literal("completed")
2674
2740
  }),
2675
- z14.object({
2676
- type: z14.literal("code_interpreter_call"),
2677
- id: z14.string(),
2678
- code: z14.string().nullable(),
2679
- container_id: z14.string(),
2680
- outputs: z14.array(
2681
- z14.discriminatedUnion("type", [
2682
- z14.object({ type: z14.literal("logs"), logs: z14.string() }),
2683
- z14.object({ type: z14.literal("image"), url: z14.string() })
2741
+ z15.object({
2742
+ type: z15.literal("code_interpreter_call"),
2743
+ id: z15.string(),
2744
+ code: z15.string().nullable(),
2745
+ container_id: z15.string(),
2746
+ outputs: z15.array(
2747
+ z15.discriminatedUnion("type", [
2748
+ z15.object({ type: z15.literal("logs"), logs: z15.string() }),
2749
+ z15.object({ type: z15.literal("image"), url: z15.string() })
2684
2750
  ])
2685
2751
  ).nullable()
2686
2752
  }),
2687
- z14.object({
2688
- type: z14.literal("image_generation_call"),
2689
- id: z14.string(),
2690
- result: z14.string()
2753
+ z15.object({
2754
+ type: z15.literal("image_generation_call"),
2755
+ id: z15.string(),
2756
+ result: z15.string()
2691
2757
  }),
2692
- z14.object({
2693
- type: z14.literal("web_search_call"),
2694
- id: z14.string(),
2695
- status: z14.string(),
2696
- action: z14.discriminatedUnion("type", [
2697
- z14.object({
2698
- type: z14.literal("search"),
2699
- query: z14.string().nullish(),
2700
- sources: z14.array(
2701
- z14.discriminatedUnion("type", [
2702
- z14.object({ type: z14.literal("url"), url: z14.string() }),
2703
- z14.object({ type: z14.literal("api"), name: z14.string() })
2758
+ z15.object({
2759
+ type: z15.literal("web_search_call"),
2760
+ id: z15.string(),
2761
+ status: z15.string(),
2762
+ action: z15.discriminatedUnion("type", [
2763
+ z15.object({
2764
+ type: z15.literal("search"),
2765
+ query: z15.string().nullish(),
2766
+ sources: z15.array(
2767
+ z15.discriminatedUnion("type", [
2768
+ z15.object({ type: z15.literal("url"), url: z15.string() }),
2769
+ z15.object({ type: z15.literal("api"), name: z15.string() })
2704
2770
  ])
2705
2771
  ).nullish()
2706
2772
  }),
2707
- z14.object({
2708
- type: z14.literal("open_page"),
2709
- url: z14.string().nullish()
2773
+ z15.object({
2774
+ type: z15.literal("open_page"),
2775
+ url: z15.string().nullish()
2710
2776
  }),
2711
- z14.object({
2712
- type: z14.literal("find_in_page"),
2713
- url: z14.string().nullish(),
2714
- pattern: z14.string().nullish()
2777
+ z15.object({
2778
+ type: z15.literal("find_in_page"),
2779
+ url: z15.string().nullish(),
2780
+ pattern: z15.string().nullish()
2715
2781
  })
2716
2782
  ]).nullish()
2717
2783
  }),
2718
- z14.object({
2719
- type: z14.literal("file_search_call"),
2720
- id: z14.string(),
2721
- queries: z14.array(z14.string()),
2722
- results: z14.array(
2723
- z14.object({
2724
- attributes: z14.record(z14.string(), z14.unknown()),
2725
- file_id: z14.string(),
2726
- filename: z14.string(),
2727
- score: z14.number(),
2728
- text: z14.string()
2784
+ z15.object({
2785
+ type: z15.literal("file_search_call"),
2786
+ id: z15.string(),
2787
+ queries: z15.array(z15.string()),
2788
+ results: z15.array(
2789
+ z15.object({
2790
+ attributes: z15.record(z15.string(), z15.unknown()),
2791
+ file_id: z15.string(),
2792
+ filename: z15.string(),
2793
+ score: z15.number(),
2794
+ text: z15.string()
2729
2795
  })
2730
2796
  ).nullish()
2731
2797
  }),
2732
- z14.object({
2733
- type: z14.literal("local_shell_call"),
2734
- id: z14.string(),
2735
- call_id: z14.string(),
2736
- action: z14.object({
2737
- type: z14.literal("exec"),
2738
- command: z14.array(z14.string()),
2739
- timeout_ms: z14.number().optional(),
2740
- user: z14.string().optional(),
2741
- working_directory: z14.string().optional(),
2742
- env: z14.record(z14.string(), z14.string()).optional()
2798
+ z15.object({
2799
+ type: z15.literal("local_shell_call"),
2800
+ id: z15.string(),
2801
+ call_id: z15.string(),
2802
+ action: z15.object({
2803
+ type: z15.literal("exec"),
2804
+ command: z15.array(z15.string()),
2805
+ timeout_ms: z15.number().optional(),
2806
+ user: z15.string().optional(),
2807
+ working_directory: z15.string().optional(),
2808
+ env: z15.record(z15.string(), z15.string()).optional()
2743
2809
  })
2744
2810
  }),
2745
- z14.object({
2746
- type: z14.literal("computer_call"),
2747
- id: z14.string(),
2748
- status: z14.literal("completed")
2811
+ z15.object({
2812
+ type: z15.literal("computer_call"),
2813
+ id: z15.string(),
2814
+ status: z15.literal("completed")
2749
2815
  })
2750
2816
  ])
2751
2817
  }),
2752
- z14.object({
2753
- type: z14.literal("response.function_call_arguments.delta"),
2754
- item_id: z14.string(),
2755
- output_index: z14.number(),
2756
- delta: z14.string()
2818
+ z15.object({
2819
+ type: z15.literal("response.function_call_arguments.delta"),
2820
+ item_id: z15.string(),
2821
+ output_index: z15.number(),
2822
+ delta: z15.string()
2757
2823
  }),
2758
- z14.object({
2759
- type: z14.literal("response.image_generation_call.partial_image"),
2760
- item_id: z14.string(),
2761
- output_index: z14.number(),
2762
- partial_image_b64: z14.string()
2824
+ z15.object({
2825
+ type: z15.literal("response.image_generation_call.partial_image"),
2826
+ item_id: z15.string(),
2827
+ output_index: z15.number(),
2828
+ partial_image_b64: z15.string()
2763
2829
  }),
2764
- z14.object({
2765
- type: z14.literal("response.code_interpreter_call_code.delta"),
2766
- item_id: z14.string(),
2767
- output_index: z14.number(),
2768
- delta: z14.string()
2830
+ z15.object({
2831
+ type: z15.literal("response.code_interpreter_call_code.delta"),
2832
+ item_id: z15.string(),
2833
+ output_index: z15.number(),
2834
+ delta: z15.string()
2769
2835
  }),
2770
- z14.object({
2771
- type: z14.literal("response.code_interpreter_call_code.done"),
2772
- item_id: z14.string(),
2773
- output_index: z14.number(),
2774
- code: z14.string()
2836
+ z15.object({
2837
+ type: z15.literal("response.code_interpreter_call_code.done"),
2838
+ item_id: z15.string(),
2839
+ output_index: z15.number(),
2840
+ code: z15.string()
2775
2841
  }),
2776
- z14.object({
2777
- type: z14.literal("response.output_text.annotation.added"),
2778
- annotation: z14.discriminatedUnion("type", [
2779
- z14.object({
2780
- type: z14.literal("url_citation"),
2781
- start_index: z14.number(),
2782
- end_index: z14.number(),
2783
- url: z14.string(),
2784
- title: z14.string()
2842
+ z15.object({
2843
+ type: z15.literal("response.output_text.annotation.added"),
2844
+ annotation: z15.discriminatedUnion("type", [
2845
+ z15.object({
2846
+ type: z15.literal("url_citation"),
2847
+ start_index: z15.number(),
2848
+ end_index: z15.number(),
2849
+ url: z15.string(),
2850
+ title: z15.string()
2785
2851
  }),
2786
- z14.object({
2787
- type: z14.literal("file_citation"),
2788
- file_id: z14.string(),
2789
- filename: z14.string().nullish(),
2790
- index: z14.number().nullish(),
2791
- start_index: z14.number().nullish(),
2792
- end_index: z14.number().nullish(),
2793
- quote: z14.string().nullish()
2852
+ z15.object({
2853
+ type: z15.literal("file_citation"),
2854
+ file_id: z15.string(),
2855
+ filename: z15.string().nullish(),
2856
+ index: z15.number().nullish(),
2857
+ start_index: z15.number().nullish(),
2858
+ end_index: z15.number().nullish(),
2859
+ quote: z15.string().nullish()
2794
2860
  })
2795
2861
  ])
2796
2862
  }),
2797
- z14.object({
2798
- type: z14.literal("response.reasoning_summary_part.added"),
2799
- item_id: z14.string(),
2800
- summary_index: z14.number()
2863
+ z15.object({
2864
+ type: z15.literal("response.reasoning_summary_part.added"),
2865
+ item_id: z15.string(),
2866
+ summary_index: z15.number()
2801
2867
  }),
2802
- z14.object({
2803
- type: z14.literal("response.reasoning_summary_text.delta"),
2804
- item_id: z14.string(),
2805
- summary_index: z14.number(),
2806
- delta: z14.string()
2868
+ z15.object({
2869
+ type: z15.literal("response.reasoning_summary_text.delta"),
2870
+ item_id: z15.string(),
2871
+ summary_index: z15.number(),
2872
+ delta: z15.string()
2807
2873
  }),
2808
- z14.object({
2809
- type: z14.literal("response.reasoning_summary_part.done"),
2810
- item_id: z14.string(),
2811
- summary_index: z14.number()
2874
+ z15.object({
2875
+ type: z15.literal("response.reasoning_summary_part.done"),
2876
+ item_id: z15.string(),
2877
+ summary_index: z15.number()
2812
2878
  }),
2813
- z14.object({
2814
- type: z14.literal("error"),
2815
- sequence_number: z14.number(),
2816
- error: z14.object({
2817
- type: z14.string(),
2818
- code: z14.string(),
2819
- message: z14.string(),
2820
- param: z14.string().nullish()
2879
+ z15.object({
2880
+ type: z15.literal("error"),
2881
+ sequence_number: z15.number(),
2882
+ error: z15.object({
2883
+ type: z15.string(),
2884
+ code: z15.string(),
2885
+ message: z15.string(),
2886
+ param: z15.string().nullish()
2821
2887
  })
2822
2888
  }),
2823
- z14.object({ type: z14.string() }).loose().transform((value) => ({
2889
+ z15.object({ type: z15.string() }).loose().transform((value) => ({
2824
2890
  type: "unknown_chunk",
2825
2891
  message: value.type
2826
2892
  }))
@@ -2828,186 +2894,186 @@ var openaiResponsesChunkSchema = lazyValidator11(
2828
2894
  ])
2829
2895
  )
2830
2896
  );
2831
- var openaiResponsesResponseSchema = lazyValidator11(
2832
- () => zodSchema12(
2833
- z14.object({
2834
- id: z14.string().optional(),
2835
- created_at: z14.number().optional(),
2836
- error: z14.object({
2837
- message: z14.string(),
2838
- type: z14.string(),
2839
- param: z14.string().nullish(),
2840
- code: z14.string()
2897
+ var openaiResponsesResponseSchema = lazyValidator12(
2898
+ () => zodSchema13(
2899
+ z15.object({
2900
+ id: z15.string().optional(),
2901
+ created_at: z15.number().optional(),
2902
+ error: z15.object({
2903
+ message: z15.string(),
2904
+ type: z15.string(),
2905
+ param: z15.string().nullish(),
2906
+ code: z15.string()
2841
2907
  }).nullish(),
2842
- model: z14.string().optional(),
2843
- output: z14.array(
2844
- z14.discriminatedUnion("type", [
2845
- z14.object({
2846
- type: z14.literal("message"),
2847
- role: z14.literal("assistant"),
2848
- id: z14.string(),
2849
- phase: z14.enum(["commentary", "final_answer"]).nullish(),
2850
- content: z14.array(
2851
- z14.object({
2852
- type: z14.literal("output_text"),
2853
- text: z14.string(),
2854
- logprobs: z14.array(
2855
- z14.object({
2856
- token: z14.string(),
2857
- logprob: z14.number(),
2858
- top_logprobs: z14.array(
2859
- z14.object({
2860
- token: z14.string(),
2861
- logprob: z14.number()
2908
+ model: z15.string().optional(),
2909
+ output: z15.array(
2910
+ z15.discriminatedUnion("type", [
2911
+ z15.object({
2912
+ type: z15.literal("message"),
2913
+ role: z15.literal("assistant"),
2914
+ id: z15.string(),
2915
+ phase: z15.enum(["commentary", "final_answer"]).nullish(),
2916
+ content: z15.array(
2917
+ z15.object({
2918
+ type: z15.literal("output_text"),
2919
+ text: z15.string(),
2920
+ logprobs: z15.array(
2921
+ z15.object({
2922
+ token: z15.string(),
2923
+ logprob: z15.number(),
2924
+ top_logprobs: z15.array(
2925
+ z15.object({
2926
+ token: z15.string(),
2927
+ logprob: z15.number()
2862
2928
  })
2863
2929
  )
2864
2930
  })
2865
2931
  ).nullish(),
2866
- annotations: z14.array(
2867
- z14.discriminatedUnion("type", [
2868
- z14.object({
2869
- type: z14.literal("url_citation"),
2870
- start_index: z14.number(),
2871
- end_index: z14.number(),
2872
- url: z14.string(),
2873
- title: z14.string()
2932
+ annotations: z15.array(
2933
+ z15.discriminatedUnion("type", [
2934
+ z15.object({
2935
+ type: z15.literal("url_citation"),
2936
+ start_index: z15.number(),
2937
+ end_index: z15.number(),
2938
+ url: z15.string(),
2939
+ title: z15.string()
2874
2940
  }),
2875
- z14.object({
2876
- type: z14.literal("file_citation"),
2877
- file_id: z14.string(),
2878
- filename: z14.string().nullish(),
2879
- index: z14.number().nullish(),
2880
- start_index: z14.number().nullish(),
2881
- end_index: z14.number().nullish(),
2882
- quote: z14.string().nullish()
2941
+ z15.object({
2942
+ type: z15.literal("file_citation"),
2943
+ file_id: z15.string(),
2944
+ filename: z15.string().nullish(),
2945
+ index: z15.number().nullish(),
2946
+ start_index: z15.number().nullish(),
2947
+ end_index: z15.number().nullish(),
2948
+ quote: z15.string().nullish()
2883
2949
  }),
2884
- z14.object({
2885
- type: z14.literal("container_file_citation"),
2886
- container_id: z14.string(),
2887
- file_id: z14.string(),
2888
- filename: z14.string().nullish(),
2889
- start_index: z14.number().nullish(),
2890
- end_index: z14.number().nullish(),
2891
- index: z14.number().nullish()
2950
+ z15.object({
2951
+ type: z15.literal("container_file_citation"),
2952
+ container_id: z15.string(),
2953
+ file_id: z15.string(),
2954
+ filename: z15.string().nullish(),
2955
+ start_index: z15.number().nullish(),
2956
+ end_index: z15.number().nullish(),
2957
+ index: z15.number().nullish()
2892
2958
  }),
2893
- z14.object({
2894
- type: z14.literal("file_path"),
2895
- file_id: z14.string(),
2896
- index: z14.number().nullish()
2959
+ z15.object({
2960
+ type: z15.literal("file_path"),
2961
+ file_id: z15.string(),
2962
+ index: z15.number().nullish()
2897
2963
  })
2898
2964
  ])
2899
2965
  )
2900
2966
  })
2901
2967
  )
2902
2968
  }),
2903
- z14.object({
2904
- type: z14.literal("web_search_call"),
2905
- id: z14.string(),
2906
- status: z14.string(),
2907
- action: z14.discriminatedUnion("type", [
2908
- z14.object({
2909
- type: z14.literal("search"),
2910
- query: z14.string().nullish(),
2911
- sources: z14.array(
2912
- z14.discriminatedUnion("type", [
2913
- z14.object({ type: z14.literal("url"), url: z14.string() }),
2914
- z14.object({
2915
- type: z14.literal("api"),
2916
- name: z14.string()
2969
+ z15.object({
2970
+ type: z15.literal("web_search_call"),
2971
+ id: z15.string(),
2972
+ status: z15.string(),
2973
+ action: z15.discriminatedUnion("type", [
2974
+ z15.object({
2975
+ type: z15.literal("search"),
2976
+ query: z15.string().nullish(),
2977
+ sources: z15.array(
2978
+ z15.discriminatedUnion("type", [
2979
+ z15.object({ type: z15.literal("url"), url: z15.string() }),
2980
+ z15.object({
2981
+ type: z15.literal("api"),
2982
+ name: z15.string()
2917
2983
  })
2918
2984
  ])
2919
2985
  ).nullish()
2920
2986
  }),
2921
- z14.object({
2922
- type: z14.literal("open_page"),
2923
- url: z14.string().nullish()
2987
+ z15.object({
2988
+ type: z15.literal("open_page"),
2989
+ url: z15.string().nullish()
2924
2990
  }),
2925
- z14.object({
2926
- type: z14.literal("find_in_page"),
2927
- url: z14.string().nullish(),
2928
- pattern: z14.string().nullish()
2991
+ z15.object({
2992
+ type: z15.literal("find_in_page"),
2993
+ url: z15.string().nullish(),
2994
+ pattern: z15.string().nullish()
2929
2995
  })
2930
2996
  ]).nullish()
2931
2997
  }),
2932
- z14.object({
2933
- type: z14.literal("file_search_call"),
2934
- id: z14.string(),
2935
- queries: z14.array(z14.string()),
2936
- results: z14.array(
2937
- z14.object({
2938
- attributes: z14.record(
2939
- z14.string(),
2940
- z14.union([z14.string(), z14.number(), z14.boolean()])
2998
+ z15.object({
2999
+ type: z15.literal("file_search_call"),
3000
+ id: z15.string(),
3001
+ queries: z15.array(z15.string()),
3002
+ results: z15.array(
3003
+ z15.object({
3004
+ attributes: z15.record(
3005
+ z15.string(),
3006
+ z15.union([z15.string(), z15.number(), z15.boolean()])
2941
3007
  ),
2942
- file_id: z14.string(),
2943
- filename: z14.string(),
2944
- score: z14.number(),
2945
- text: z14.string()
3008
+ file_id: z15.string(),
3009
+ filename: z15.string(),
3010
+ score: z15.number(),
3011
+ text: z15.string()
2946
3012
  })
2947
3013
  ).nullish()
2948
3014
  }),
2949
- z14.object({
2950
- type: z14.literal("code_interpreter_call"),
2951
- id: z14.string(),
2952
- code: z14.string().nullable(),
2953
- container_id: z14.string(),
2954
- outputs: z14.array(
2955
- z14.discriminatedUnion("type", [
2956
- z14.object({ type: z14.literal("logs"), logs: z14.string() }),
2957
- z14.object({ type: z14.literal("image"), url: z14.string() })
3015
+ z15.object({
3016
+ type: z15.literal("code_interpreter_call"),
3017
+ id: z15.string(),
3018
+ code: z15.string().nullable(),
3019
+ container_id: z15.string(),
3020
+ outputs: z15.array(
3021
+ z15.discriminatedUnion("type", [
3022
+ z15.object({ type: z15.literal("logs"), logs: z15.string() }),
3023
+ z15.object({ type: z15.literal("image"), url: z15.string() })
2958
3024
  ])
2959
3025
  ).nullable()
2960
3026
  }),
2961
- z14.object({
2962
- type: z14.literal("image_generation_call"),
2963
- id: z14.string(),
2964
- result: z14.string()
3027
+ z15.object({
3028
+ type: z15.literal("image_generation_call"),
3029
+ id: z15.string(),
3030
+ result: z15.string()
2965
3031
  }),
2966
- z14.object({
2967
- type: z14.literal("local_shell_call"),
2968
- id: z14.string(),
2969
- call_id: z14.string(),
2970
- action: z14.object({
2971
- type: z14.literal("exec"),
2972
- command: z14.array(z14.string()),
2973
- timeout_ms: z14.number().optional(),
2974
- user: z14.string().optional(),
2975
- working_directory: z14.string().optional(),
2976
- env: z14.record(z14.string(), z14.string()).optional()
3032
+ z15.object({
3033
+ type: z15.literal("local_shell_call"),
3034
+ id: z15.string(),
3035
+ call_id: z15.string(),
3036
+ action: z15.object({
3037
+ type: z15.literal("exec"),
3038
+ command: z15.array(z15.string()),
3039
+ timeout_ms: z15.number().optional(),
3040
+ user: z15.string().optional(),
3041
+ working_directory: z15.string().optional(),
3042
+ env: z15.record(z15.string(), z15.string()).optional()
2977
3043
  })
2978
3044
  }),
2979
- z14.object({
2980
- type: z14.literal("function_call"),
2981
- call_id: z14.string(),
2982
- name: z14.string(),
2983
- arguments: z14.string(),
2984
- id: z14.string()
3045
+ z15.object({
3046
+ type: z15.literal("function_call"),
3047
+ call_id: z15.string(),
3048
+ name: z15.string(),
3049
+ arguments: z15.string(),
3050
+ id: z15.string()
2985
3051
  }),
2986
- z14.object({
2987
- type: z14.literal("computer_call"),
2988
- id: z14.string(),
2989
- status: z14.string().optional()
3052
+ z15.object({
3053
+ type: z15.literal("computer_call"),
3054
+ id: z15.string(),
3055
+ status: z15.string().optional()
2990
3056
  }),
2991
- z14.object({
2992
- type: z14.literal("reasoning"),
2993
- id: z14.string(),
2994
- encrypted_content: z14.string().nullish(),
2995
- summary: z14.array(
2996
- z14.object({
2997
- type: z14.literal("summary_text"),
2998
- text: z14.string()
3057
+ z15.object({
3058
+ type: z15.literal("reasoning"),
3059
+ id: z15.string(),
3060
+ encrypted_content: z15.string().nullish(),
3061
+ summary: z15.array(
3062
+ z15.object({
3063
+ type: z15.literal("summary_text"),
3064
+ text: z15.string()
2999
3065
  })
3000
3066
  )
3001
3067
  })
3002
3068
  ])
3003
3069
  ).optional(),
3004
- service_tier: z14.string().nullish(),
3005
- incomplete_details: z14.object({ reason: z14.string() }).nullish(),
3006
- usage: z14.object({
3007
- input_tokens: z14.number(),
3008
- input_tokens_details: z14.object({ cached_tokens: z14.number().nullish() }).nullish(),
3009
- output_tokens: z14.number(),
3010
- output_tokens_details: z14.object({ reasoning_tokens: z14.number().nullish() }).nullish()
3070
+ service_tier: z15.string().nullish(),
3071
+ incomplete_details: z15.object({ reason: z15.string() }).nullish(),
3072
+ usage: z15.object({
3073
+ input_tokens: z15.number(),
3074
+ input_tokens_details: z15.object({ cached_tokens: z15.number().nullish() }).nullish(),
3075
+ output_tokens: z15.number(),
3076
+ output_tokens_details: z15.object({ reasoning_tokens: z15.number().nullish() }).nullish()
3011
3077
  }).optional()
3012
3078
  })
3013
3079
  )
@@ -3015,10 +3081,10 @@ var openaiResponsesResponseSchema = lazyValidator11(
3015
3081
 
3016
3082
  // src/responses/openai-responses-options.ts
3017
3083
  import {
3018
- lazyValidator as lazyValidator12,
3019
- zodSchema as zodSchema13
3084
+ lazyValidator as lazyValidator13,
3085
+ zodSchema as zodSchema14
3020
3086
  } from "@ai-sdk/provider-utils";
3021
- import { z as z15 } from "zod/v4";
3087
+ import { z as z16 } from "zod/v4";
3022
3088
  var TOP_LOGPROBS_MAX = 20;
3023
3089
  var openaiResponsesReasoningModelIds = [
3024
3090
  "o1",
@@ -3100,19 +3166,19 @@ var openaiResponsesModelIds = [
3100
3166
  "gpt-5-chat-latest",
3101
3167
  ...openaiResponsesReasoningModelIds
3102
3168
  ];
3103
- var openaiResponsesProviderOptionsSchema = lazyValidator12(
3104
- () => zodSchema13(
3105
- z15.object({
3106
- conversation: z15.string().nullish(),
3107
- include: z15.array(
3108
- z15.enum([
3169
+ var openaiResponsesProviderOptionsSchema = lazyValidator13(
3170
+ () => zodSchema14(
3171
+ z16.object({
3172
+ conversation: z16.string().nullish(),
3173
+ include: z16.array(
3174
+ z16.enum([
3109
3175
  "reasoning.encrypted_content",
3110
3176
  // handled internally by default, only needed for unknown reasoning models
3111
3177
  "file_search_call.results",
3112
3178
  "message.output_text.logprobs"
3113
3179
  ])
3114
3180
  ).nullish(),
3115
- instructions: z15.string().nullish(),
3181
+ instructions: z16.string().nullish(),
3116
3182
  /**
3117
3183
  * Return the log probabilities of the tokens.
3118
3184
  *
@@ -3125,17 +3191,17 @@ var openaiResponsesProviderOptionsSchema = lazyValidator12(
3125
3191
  * @see https://platform.openai.com/docs/api-reference/responses/create
3126
3192
  * @see https://cookbook.openai.com/examples/using_logprobs
3127
3193
  */
3128
- logprobs: z15.union([z15.boolean(), z15.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
3194
+ logprobs: z16.union([z16.boolean(), z16.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
3129
3195
  /**
3130
3196
  * The maximum number of total calls to built-in tools that can be processed in a response.
3131
3197
  * This maximum number applies across all built-in tool calls, not per individual tool.
3132
3198
  * Any further attempts to call a tool by the model will be ignored.
3133
3199
  */
3134
- maxToolCalls: z15.number().nullish(),
3135
- metadata: z15.any().nullish(),
3136
- parallelToolCalls: z15.boolean().nullish(),
3137
- previousResponseId: z15.string().nullish(),
3138
- promptCacheKey: z15.string().nullish(),
3200
+ maxToolCalls: z16.number().nullish(),
3201
+ metadata: z16.any().nullish(),
3202
+ parallelToolCalls: z16.boolean().nullish(),
3203
+ previousResponseId: z16.string().nullish(),
3204
+ promptCacheKey: z16.string().nullish(),
3139
3205
  /**
3140
3206
  * The retention policy for the prompt cache.
3141
3207
  * - 'in_memory': Default. Standard prompt caching behavior.
@@ -3144,7 +3210,7 @@ var openaiResponsesProviderOptionsSchema = lazyValidator12(
3144
3210
  *
3145
3211
  * @default 'in_memory'
3146
3212
  */
3147
- promptCacheRetention: z15.enum(["in_memory", "24h"]).nullish(),
3213
+ promptCacheRetention: z16.enum(["in_memory", "24h"]).nullish(),
3148
3214
  /**
3149
3215
  * Reasoning effort for reasoning models. Defaults to `medium`. If you use
3150
3216
  * `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
@@ -3155,15 +3221,15 @@ var openaiResponsesProviderOptionsSchema = lazyValidator12(
3155
3221
  * OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
3156
3222
  * an error.
3157
3223
  */
3158
- reasoningEffort: z15.string().nullish(),
3159
- reasoningSummary: z15.string().nullish(),
3160
- safetyIdentifier: z15.string().nullish(),
3161
- serviceTier: z15.enum(["auto", "flex", "priority", "default"]).nullish(),
3162
- store: z15.boolean().nullish(),
3163
- strictJsonSchema: z15.boolean().nullish(),
3164
- textVerbosity: z15.enum(["low", "medium", "high"]).nullish(),
3165
- truncation: z15.enum(["auto", "disabled"]).nullish(),
3166
- user: z15.string().nullish()
3224
+ reasoningEffort: z16.string().nullish(),
3225
+ reasoningSummary: z16.string().nullish(),
3226
+ safetyIdentifier: z16.string().nullish(),
3227
+ serviceTier: z16.enum(["auto", "flex", "priority", "default"]).nullish(),
3228
+ store: z16.boolean().nullish(),
3229
+ strictJsonSchema: z16.boolean().nullish(),
3230
+ textVerbosity: z16.enum(["low", "medium", "high"]).nullish(),
3231
+ truncation: z16.enum(["auto", "disabled"]).nullish(),
3232
+ user: z16.string().nullish()
3167
3233
  })
3168
3234
  )
3169
3235
  );
@@ -3177,36 +3243,36 @@ import {
3177
3243
  import {
3178
3244
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema2,
3179
3245
  lazySchema as lazySchema2,
3180
- zodSchema as zodSchema14
3246
+ zodSchema as zodSchema15
3181
3247
  } from "@ai-sdk/provider-utils";
3182
- import { z as z16 } from "zod/v4";
3248
+ import { z as z17 } from "zod/v4";
3183
3249
  var codeInterpreterInputSchema = lazySchema2(
3184
- () => zodSchema14(
3185
- z16.object({
3186
- code: z16.string().nullish(),
3187
- containerId: z16.string()
3250
+ () => zodSchema15(
3251
+ z17.object({
3252
+ code: z17.string().nullish(),
3253
+ containerId: z17.string()
3188
3254
  })
3189
3255
  )
3190
3256
  );
3191
3257
  var codeInterpreterOutputSchema = lazySchema2(
3192
- () => zodSchema14(
3193
- z16.object({
3194
- outputs: z16.array(
3195
- z16.discriminatedUnion("type", [
3196
- z16.object({ type: z16.literal("logs"), logs: z16.string() }),
3197
- z16.object({ type: z16.literal("image"), url: z16.string() })
3258
+ () => zodSchema15(
3259
+ z17.object({
3260
+ outputs: z17.array(
3261
+ z17.discriminatedUnion("type", [
3262
+ z17.object({ type: z17.literal("logs"), logs: z17.string() }),
3263
+ z17.object({ type: z17.literal("image"), url: z17.string() })
3198
3264
  ])
3199
3265
  ).nullish()
3200
3266
  })
3201
3267
  )
3202
3268
  );
3203
3269
  var codeInterpreterArgsSchema = lazySchema2(
3204
- () => zodSchema14(
3205
- z16.object({
3206
- container: z16.union([
3207
- z16.string(),
3208
- z16.object({
3209
- fileIds: z16.array(z16.string()).optional()
3270
+ () => zodSchema15(
3271
+ z17.object({
3272
+ container: z17.union([
3273
+ z17.string(),
3274
+ z17.object({
3275
+ fileIds: z17.array(z17.string()).optional()
3210
3276
  })
3211
3277
  ]).optional()
3212
3278
  })
@@ -3226,44 +3292,44 @@ var codeInterpreter = (args = {}) => {
3226
3292
  import {
3227
3293
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema3,
3228
3294
  lazySchema as lazySchema3,
3229
- zodSchema as zodSchema15
3295
+ zodSchema as zodSchema16
3230
3296
  } from "@ai-sdk/provider-utils";
3231
- import { z as z17 } from "zod/v4";
3232
- var comparisonFilterSchema = z17.object({
3233
- key: z17.string(),
3234
- type: z17.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
3235
- value: z17.union([z17.string(), z17.number(), z17.boolean(), z17.array(z17.string())])
3297
+ import { z as z18 } from "zod/v4";
3298
+ var comparisonFilterSchema = z18.object({
3299
+ key: z18.string(),
3300
+ type: z18.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
3301
+ value: z18.union([z18.string(), z18.number(), z18.boolean(), z18.array(z18.string())])
3236
3302
  });
3237
- var compoundFilterSchema = z17.object({
3238
- type: z17.enum(["and", "or"]),
3239
- filters: z17.array(
3240
- z17.union([comparisonFilterSchema, z17.lazy(() => compoundFilterSchema)])
3303
+ var compoundFilterSchema = z18.object({
3304
+ type: z18.enum(["and", "or"]),
3305
+ filters: z18.array(
3306
+ z18.union([comparisonFilterSchema, z18.lazy(() => compoundFilterSchema)])
3241
3307
  )
3242
3308
  });
3243
3309
  var fileSearchArgsSchema = lazySchema3(
3244
- () => zodSchema15(
3245
- z17.object({
3246
- vectorStoreIds: z17.array(z17.string()),
3247
- maxNumResults: z17.number().optional(),
3248
- ranking: z17.object({
3249
- ranker: z17.string().optional(),
3250
- scoreThreshold: z17.number().optional()
3310
+ () => zodSchema16(
3311
+ z18.object({
3312
+ vectorStoreIds: z18.array(z18.string()),
3313
+ maxNumResults: z18.number().optional(),
3314
+ ranking: z18.object({
3315
+ ranker: z18.string().optional(),
3316
+ scoreThreshold: z18.number().optional()
3251
3317
  }).optional(),
3252
- filters: z17.union([comparisonFilterSchema, compoundFilterSchema]).optional()
3318
+ filters: z18.union([comparisonFilterSchema, compoundFilterSchema]).optional()
3253
3319
  })
3254
3320
  )
3255
3321
  );
3256
3322
  var fileSearchOutputSchema = lazySchema3(
3257
- () => zodSchema15(
3258
- z17.object({
3259
- queries: z17.array(z17.string()),
3260
- results: z17.array(
3261
- z17.object({
3262
- attributes: z17.record(z17.string(), z17.unknown()),
3263
- fileId: z17.string(),
3264
- filename: z17.string(),
3265
- score: z17.number(),
3266
- text: z17.string()
3323
+ () => zodSchema16(
3324
+ z18.object({
3325
+ queries: z18.array(z18.string()),
3326
+ results: z18.array(
3327
+ z18.object({
3328
+ attributes: z18.record(z18.string(), z18.unknown()),
3329
+ fileId: z18.string(),
3330
+ filename: z18.string(),
3331
+ score: z18.number(),
3332
+ text: z18.string()
3267
3333
  })
3268
3334
  ).nullable()
3269
3335
  })
@@ -3272,7 +3338,7 @@ var fileSearchOutputSchema = lazySchema3(
3272
3338
  var fileSearch = createProviderDefinedToolFactoryWithOutputSchema3({
3273
3339
  id: "openai.file_search",
3274
3340
  name: "file_search",
3275
- inputSchema: z17.object({}),
3341
+ inputSchema: z18.object({}),
3276
3342
  outputSchema: fileSearchOutputSchema
3277
3343
  });
3278
3344
 
@@ -3280,48 +3346,48 @@ var fileSearch = createProviderDefinedToolFactoryWithOutputSchema3({
3280
3346
  import {
3281
3347
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema4,
3282
3348
  lazySchema as lazySchema4,
3283
- zodSchema as zodSchema16
3349
+ zodSchema as zodSchema17
3284
3350
  } from "@ai-sdk/provider-utils";
3285
- import { z as z18 } from "zod/v4";
3351
+ import { z as z19 } from "zod/v4";
3286
3352
  var webSearchArgsSchema = lazySchema4(
3287
- () => zodSchema16(
3288
- z18.object({
3289
- externalWebAccess: z18.boolean().optional(),
3290
- filters: z18.object({ allowedDomains: z18.array(z18.string()).optional() }).optional(),
3291
- searchContextSize: z18.enum(["low", "medium", "high"]).optional(),
3292
- userLocation: z18.object({
3293
- type: z18.literal("approximate"),
3294
- country: z18.string().optional(),
3295
- city: z18.string().optional(),
3296
- region: z18.string().optional(),
3297
- timezone: z18.string().optional()
3353
+ () => zodSchema17(
3354
+ z19.object({
3355
+ externalWebAccess: z19.boolean().optional(),
3356
+ filters: z19.object({ allowedDomains: z19.array(z19.string()).optional() }).optional(),
3357
+ searchContextSize: z19.enum(["low", "medium", "high"]).optional(),
3358
+ userLocation: z19.object({
3359
+ type: z19.literal("approximate"),
3360
+ country: z19.string().optional(),
3361
+ city: z19.string().optional(),
3362
+ region: z19.string().optional(),
3363
+ timezone: z19.string().optional()
3298
3364
  }).optional()
3299
3365
  })
3300
3366
  )
3301
3367
  );
3302
- var webSearchInputSchema = lazySchema4(() => zodSchema16(z18.object({})));
3368
+ var webSearchInputSchema = lazySchema4(() => zodSchema17(z19.object({})));
3303
3369
  var webSearchOutputSchema = lazySchema4(
3304
- () => zodSchema16(
3305
- z18.object({
3306
- action: z18.discriminatedUnion("type", [
3307
- z18.object({
3308
- type: z18.literal("search"),
3309
- query: z18.string().optional()
3370
+ () => zodSchema17(
3371
+ z19.object({
3372
+ action: z19.discriminatedUnion("type", [
3373
+ z19.object({
3374
+ type: z19.literal("search"),
3375
+ query: z19.string().optional()
3310
3376
  }),
3311
- z18.object({
3312
- type: z18.literal("openPage"),
3313
- url: z18.string().nullish()
3377
+ z19.object({
3378
+ type: z19.literal("openPage"),
3379
+ url: z19.string().nullish()
3314
3380
  }),
3315
- z18.object({
3316
- type: z18.literal("findInPage"),
3317
- url: z18.string().nullish(),
3318
- pattern: z18.string().nullish()
3381
+ z19.object({
3382
+ type: z19.literal("findInPage"),
3383
+ url: z19.string().nullish(),
3384
+ pattern: z19.string().nullish()
3319
3385
  })
3320
3386
  ]).optional(),
3321
- sources: z18.array(
3322
- z18.discriminatedUnion("type", [
3323
- z18.object({ type: z18.literal("url"), url: z18.string() }),
3324
- z18.object({ type: z18.literal("api"), name: z18.string() })
3387
+ sources: z19.array(
3388
+ z19.discriminatedUnion("type", [
3389
+ z19.object({ type: z19.literal("url"), url: z19.string() }),
3390
+ z19.object({ type: z19.literal("api"), name: z19.string() })
3325
3391
  ])
3326
3392
  ).optional()
3327
3393
  })
@@ -3338,42 +3404,42 @@ var webSearchToolFactory = createProviderDefinedToolFactoryWithOutputSchema4({
3338
3404
  import {
3339
3405
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema5,
3340
3406
  lazySchema as lazySchema5,
3341
- zodSchema as zodSchema17
3407
+ zodSchema as zodSchema18
3342
3408
  } from "@ai-sdk/provider-utils";
3343
- import { z as z19 } from "zod/v4";
3409
+ import { z as z20 } from "zod/v4";
3344
3410
  var webSearchPreviewArgsSchema = lazySchema5(
3345
- () => zodSchema17(
3346
- z19.object({
3347
- searchContextSize: z19.enum(["low", "medium", "high"]).optional(),
3348
- userLocation: z19.object({
3349
- type: z19.literal("approximate"),
3350
- country: z19.string().optional(),
3351
- city: z19.string().optional(),
3352
- region: z19.string().optional(),
3353
- timezone: z19.string().optional()
3411
+ () => zodSchema18(
3412
+ z20.object({
3413
+ searchContextSize: z20.enum(["low", "medium", "high"]).optional(),
3414
+ userLocation: z20.object({
3415
+ type: z20.literal("approximate"),
3416
+ country: z20.string().optional(),
3417
+ city: z20.string().optional(),
3418
+ region: z20.string().optional(),
3419
+ timezone: z20.string().optional()
3354
3420
  }).optional()
3355
3421
  })
3356
3422
  )
3357
3423
  );
3358
3424
  var webSearchPreviewInputSchema = lazySchema5(
3359
- () => zodSchema17(z19.object({}))
3425
+ () => zodSchema18(z20.object({}))
3360
3426
  );
3361
3427
  var webSearchPreviewOutputSchema = lazySchema5(
3362
- () => zodSchema17(
3363
- z19.object({
3364
- action: z19.discriminatedUnion("type", [
3365
- z19.object({
3366
- type: z19.literal("search"),
3367
- query: z19.string().optional()
3428
+ () => zodSchema18(
3429
+ z20.object({
3430
+ action: z20.discriminatedUnion("type", [
3431
+ z20.object({
3432
+ type: z20.literal("search"),
3433
+ query: z20.string().optional()
3368
3434
  }),
3369
- z19.object({
3370
- type: z19.literal("openPage"),
3371
- url: z19.string().nullish()
3435
+ z20.object({
3436
+ type: z20.literal("openPage"),
3437
+ url: z20.string().nullish()
3372
3438
  }),
3373
- z19.object({
3374
- type: z19.literal("findInPage"),
3375
- url: z19.string().nullish(),
3376
- pattern: z19.string().nullish()
3439
+ z20.object({
3440
+ type: z20.literal("findInPage"),
3441
+ url: z20.string().nullish(),
3442
+ pattern: z20.string().nullish()
3377
3443
  })
3378
3444
  ]).optional()
3379
3445
  })
@@ -3390,31 +3456,31 @@ var webSearchPreview = createProviderDefinedToolFactoryWithOutputSchema5({
3390
3456
  import {
3391
3457
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema6,
3392
3458
  lazySchema as lazySchema6,
3393
- zodSchema as zodSchema18
3459
+ zodSchema as zodSchema19
3394
3460
  } from "@ai-sdk/provider-utils";
3395
- import { z as z20 } from "zod/v4";
3461
+ import { z as z21 } from "zod/v4";
3396
3462
  var imageGenerationArgsSchema = lazySchema6(
3397
- () => zodSchema18(
3398
- z20.object({
3399
- background: z20.enum(["auto", "opaque", "transparent"]).optional(),
3400
- inputFidelity: z20.enum(["low", "high"]).optional(),
3401
- inputImageMask: z20.object({
3402
- fileId: z20.string().optional(),
3403
- imageUrl: z20.string().optional()
3463
+ () => zodSchema19(
3464
+ z21.object({
3465
+ background: z21.enum(["auto", "opaque", "transparent"]).optional(),
3466
+ inputFidelity: z21.enum(["low", "high"]).optional(),
3467
+ inputImageMask: z21.object({
3468
+ fileId: z21.string().optional(),
3469
+ imageUrl: z21.string().optional()
3404
3470
  }).optional(),
3405
- model: z20.string().optional(),
3406
- moderation: z20.enum(["auto"]).optional(),
3407
- outputCompression: z20.number().int().min(0).max(100).optional(),
3408
- outputFormat: z20.enum(["png", "jpeg", "webp"]).optional(),
3409
- partialImages: z20.number().int().min(0).max(3).optional(),
3410
- quality: z20.enum(["auto", "low", "medium", "high"]).optional(),
3411
- size: z20.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
3471
+ model: z21.string().optional(),
3472
+ moderation: z21.enum(["auto"]).optional(),
3473
+ outputCompression: z21.number().int().min(0).max(100).optional(),
3474
+ outputFormat: z21.enum(["png", "jpeg", "webp"]).optional(),
3475
+ partialImages: z21.number().int().min(0).max(3).optional(),
3476
+ quality: z21.enum(["auto", "low", "medium", "high"]).optional(),
3477
+ size: z21.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
3412
3478
  }).strict()
3413
3479
  )
3414
3480
  );
3415
- var imageGenerationInputSchema = lazySchema6(() => zodSchema18(z20.object({})));
3481
+ var imageGenerationInputSchema = lazySchema6(() => zodSchema19(z21.object({})));
3416
3482
  var imageGenerationOutputSchema = lazySchema6(
3417
- () => zodSchema18(z20.object({ result: z20.string() }))
3483
+ () => zodSchema19(z21.object({ result: z21.string() }))
3418
3484
  );
3419
3485
  var imageGenerationToolFactory = createProviderDefinedToolFactoryWithOutputSchema6({
3420
3486
  id: "openai.image_generation",
@@ -3619,7 +3685,7 @@ var OpenAIResponsesLanguageModel = class {
3619
3685
  if (stopSequences != null) {
3620
3686
  warnings.push({ type: "unsupported-setting", setting: "stopSequences" });
3621
3687
  }
3622
- const openaiOptions = await parseProviderOptions7({
3688
+ const openaiOptions = await parseProviderOptions8({
3623
3689
  provider: "openai",
3624
3690
  providerOptions,
3625
3691
  schema: openaiResponsesProviderOptionsSchema
@@ -4678,6 +4744,8 @@ export {
4678
4744
  openaiChatLanguageModelOptions,
4679
4745
  openaiCompletionProviderOptions,
4680
4746
  openaiEmbeddingProviderOptions,
4747
+ openaiImageModelGenerationOptions,
4748
+ openaiImageModelOptions,
4681
4749
  openaiSpeechProviderOptionsSchema,
4682
4750
  webSearchPreview,
4683
4751
  webSearchPreviewArgsSchema,