@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.
- package/CHANGELOG.md +15 -0
- package/dist/index.d.mts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +686 -624
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +637 -571
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +20 -2
- package/dist/internal/index.d.ts +20 -2
- package/dist/internal/index.js +683 -617
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +638 -570
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/internal/index.mjs
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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
|
|
1827
|
-
import { z as
|
|
1828
|
-
var openaiTranscriptionResponseSchema =
|
|
1829
|
-
() =>
|
|
1830
|
-
|
|
1831
|
-
text:
|
|
1832
|
-
language:
|
|
1833
|
-
duration:
|
|
1834
|
-
words:
|
|
1835
|
-
|
|
1836
|
-
word:
|
|
1837
|
-
start:
|
|
1838
|
-
end:
|
|
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:
|
|
1842
|
-
|
|
1843
|
-
id:
|
|
1844
|
-
seek:
|
|
1845
|
-
start:
|
|
1846
|
-
end:
|
|
1847
|
-
text:
|
|
1848
|
-
tokens:
|
|
1849
|
-
temperature:
|
|
1850
|
-
avg_logprob:
|
|
1851
|
-
compression_ratio:
|
|
1852
|
-
no_speech_prob:
|
|
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
|
|
1862
|
-
zodSchema as
|
|
1927
|
+
lazyValidator as lazyValidator10,
|
|
1928
|
+
zodSchema as zodSchema10
|
|
1863
1929
|
} from "@ai-sdk/provider-utils";
|
|
1864
|
-
import { z as
|
|
1865
|
-
var openAITranscriptionProviderOptions =
|
|
1866
|
-
() =>
|
|
1867
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
1945
|
+
prompt: z11.string().optional(),
|
|
1880
1946
|
/**
|
|
1881
1947
|
* The sampling temperature, between 0 and 1.
|
|
1882
1948
|
* @default 0
|
|
1883
1949
|
*/
|
|
1884
|
-
temperature:
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
2072
|
-
zodSchema as
|
|
2137
|
+
lazyValidator as lazyValidator11,
|
|
2138
|
+
zodSchema as zodSchema11
|
|
2073
2139
|
} from "@ai-sdk/provider-utils";
|
|
2074
|
-
import { z as
|
|
2075
|
-
var openaiSpeechProviderOptionsSchema =
|
|
2076
|
-
() =>
|
|
2077
|
-
|
|
2078
|
-
instructions:
|
|
2079
|
-
speed:
|
|
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
|
|
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
|
|
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
|
|
2270
|
+
parseProviderOptions as parseProviderOptions7,
|
|
2205
2271
|
validateTypes
|
|
2206
2272
|
} from "@ai-sdk/provider-utils";
|
|
2207
|
-
import { z as
|
|
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
|
|
2279
|
+
zodSchema as zodSchema12
|
|
2214
2280
|
} from "@ai-sdk/provider-utils";
|
|
2215
|
-
import { z as
|
|
2281
|
+
import { z as z13 } from "zod/v4";
|
|
2216
2282
|
var localShellInputSchema = lazySchema(
|
|
2217
|
-
() =>
|
|
2218
|
-
|
|
2219
|
-
action:
|
|
2220
|
-
type:
|
|
2221
|
-
command:
|
|
2222
|
-
timeoutMs:
|
|
2223
|
-
user:
|
|
2224
|
-
workingDirectory:
|
|
2225
|
-
env:
|
|
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
|
-
() =>
|
|
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
|
|
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 =
|
|
2529
|
-
itemId:
|
|
2530
|
-
reasoningEncryptedContent:
|
|
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
|
|
2554
|
-
zodSchema as
|
|
2619
|
+
lazyValidator as lazyValidator12,
|
|
2620
|
+
zodSchema as zodSchema13
|
|
2555
2621
|
} from "@ai-sdk/provider-utils";
|
|
2556
|
-
import { z as
|
|
2557
|
-
var openaiResponsesChunkSchema =
|
|
2558
|
-
() =>
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
type:
|
|
2562
|
-
item_id:
|
|
2563
|
-
delta:
|
|
2564
|
-
logprobs:
|
|
2565
|
-
|
|
2566
|
-
token:
|
|
2567
|
-
logprob:
|
|
2568
|
-
top_logprobs:
|
|
2569
|
-
|
|
2570
|
-
token:
|
|
2571
|
-
logprob:
|
|
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
|
-
|
|
2578
|
-
type:
|
|
2579
|
-
response:
|
|
2580
|
-
incomplete_details:
|
|
2581
|
-
usage:
|
|
2582
|
-
input_tokens:
|
|
2583
|
-
input_tokens_details:
|
|
2584
|
-
output_tokens:
|
|
2585
|
-
output_tokens_details:
|
|
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:
|
|
2653
|
+
service_tier: z15.string().nullish()
|
|
2588
2654
|
})
|
|
2589
2655
|
}),
|
|
2590
|
-
|
|
2591
|
-
type:
|
|
2592
|
-
response:
|
|
2593
|
-
id:
|
|
2594
|
-
created_at:
|
|
2595
|
-
model:
|
|
2596
|
-
service_tier:
|
|
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
|
-
|
|
2600
|
-
type:
|
|
2601
|
-
output_index:
|
|
2602
|
-
item:
|
|
2603
|
-
|
|
2604
|
-
type:
|
|
2605
|
-
id:
|
|
2606
|
-
phase:
|
|
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
|
-
|
|
2609
|
-
type:
|
|
2610
|
-
id:
|
|
2611
|
-
encrypted_content:
|
|
2674
|
+
z15.object({
|
|
2675
|
+
type: z15.literal("reasoning"),
|
|
2676
|
+
id: z15.string(),
|
|
2677
|
+
encrypted_content: z15.string().nullish()
|
|
2612
2678
|
}),
|
|
2613
|
-
|
|
2614
|
-
type:
|
|
2615
|
-
id:
|
|
2616
|
-
call_id:
|
|
2617
|
-
name:
|
|
2618
|
-
arguments:
|
|
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
|
-
|
|
2621
|
-
type:
|
|
2622
|
-
id:
|
|
2623
|
-
status:
|
|
2686
|
+
z15.object({
|
|
2687
|
+
type: z15.literal("web_search_call"),
|
|
2688
|
+
id: z15.string(),
|
|
2689
|
+
status: z15.string()
|
|
2624
2690
|
}),
|
|
2625
|
-
|
|
2626
|
-
type:
|
|
2627
|
-
id:
|
|
2628
|
-
status:
|
|
2691
|
+
z15.object({
|
|
2692
|
+
type: z15.literal("computer_call"),
|
|
2693
|
+
id: z15.string(),
|
|
2694
|
+
status: z15.string()
|
|
2629
2695
|
}),
|
|
2630
|
-
|
|
2631
|
-
type:
|
|
2632
|
-
id:
|
|
2696
|
+
z15.object({
|
|
2697
|
+
type: z15.literal("file_search_call"),
|
|
2698
|
+
id: z15.string()
|
|
2633
2699
|
}),
|
|
2634
|
-
|
|
2635
|
-
type:
|
|
2636
|
-
id:
|
|
2700
|
+
z15.object({
|
|
2701
|
+
type: z15.literal("image_generation_call"),
|
|
2702
|
+
id: z15.string()
|
|
2637
2703
|
}),
|
|
2638
|
-
|
|
2639
|
-
type:
|
|
2640
|
-
id:
|
|
2641
|
-
container_id:
|
|
2642
|
-
code:
|
|
2643
|
-
outputs:
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
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:
|
|
2715
|
+
status: z15.string()
|
|
2650
2716
|
})
|
|
2651
2717
|
])
|
|
2652
2718
|
}),
|
|
2653
|
-
|
|
2654
|
-
type:
|
|
2655
|
-
output_index:
|
|
2656
|
-
item:
|
|
2657
|
-
|
|
2658
|
-
type:
|
|
2659
|
-
id:
|
|
2660
|
-
phase:
|
|
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
|
-
|
|
2663
|
-
type:
|
|
2664
|
-
id:
|
|
2665
|
-
encrypted_content:
|
|
2728
|
+
z15.object({
|
|
2729
|
+
type: z15.literal("reasoning"),
|
|
2730
|
+
id: z15.string(),
|
|
2731
|
+
encrypted_content: z15.string().nullish()
|
|
2666
2732
|
}),
|
|
2667
|
-
|
|
2668
|
-
type:
|
|
2669
|
-
id:
|
|
2670
|
-
call_id:
|
|
2671
|
-
name:
|
|
2672
|
-
arguments:
|
|
2673
|
-
status:
|
|
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
|
-
|
|
2676
|
-
type:
|
|
2677
|
-
id:
|
|
2678
|
-
code:
|
|
2679
|
-
container_id:
|
|
2680
|
-
outputs:
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
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
|
-
|
|
2688
|
-
type:
|
|
2689
|
-
id:
|
|
2690
|
-
result:
|
|
2753
|
+
z15.object({
|
|
2754
|
+
type: z15.literal("image_generation_call"),
|
|
2755
|
+
id: z15.string(),
|
|
2756
|
+
result: z15.string()
|
|
2691
2757
|
}),
|
|
2692
|
-
|
|
2693
|
-
type:
|
|
2694
|
-
id:
|
|
2695
|
-
status:
|
|
2696
|
-
action:
|
|
2697
|
-
|
|
2698
|
-
type:
|
|
2699
|
-
query:
|
|
2700
|
-
sources:
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
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
|
-
|
|
2708
|
-
type:
|
|
2709
|
-
url:
|
|
2773
|
+
z15.object({
|
|
2774
|
+
type: z15.literal("open_page"),
|
|
2775
|
+
url: z15.string().nullish()
|
|
2710
2776
|
}),
|
|
2711
|
-
|
|
2712
|
-
type:
|
|
2713
|
-
url:
|
|
2714
|
-
pattern:
|
|
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
|
-
|
|
2719
|
-
type:
|
|
2720
|
-
id:
|
|
2721
|
-
queries:
|
|
2722
|
-
results:
|
|
2723
|
-
|
|
2724
|
-
attributes:
|
|
2725
|
-
file_id:
|
|
2726
|
-
filename:
|
|
2727
|
-
score:
|
|
2728
|
-
text:
|
|
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
|
-
|
|
2733
|
-
type:
|
|
2734
|
-
id:
|
|
2735
|
-
call_id:
|
|
2736
|
-
action:
|
|
2737
|
-
type:
|
|
2738
|
-
command:
|
|
2739
|
-
timeout_ms:
|
|
2740
|
-
user:
|
|
2741
|
-
working_directory:
|
|
2742
|
-
env:
|
|
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
|
-
|
|
2746
|
-
type:
|
|
2747
|
-
id:
|
|
2748
|
-
status:
|
|
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
|
-
|
|
2753
|
-
type:
|
|
2754
|
-
item_id:
|
|
2755
|
-
output_index:
|
|
2756
|
-
delta:
|
|
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
|
-
|
|
2759
|
-
type:
|
|
2760
|
-
item_id:
|
|
2761
|
-
output_index:
|
|
2762
|
-
partial_image_b64:
|
|
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
|
-
|
|
2765
|
-
type:
|
|
2766
|
-
item_id:
|
|
2767
|
-
output_index:
|
|
2768
|
-
delta:
|
|
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
|
-
|
|
2771
|
-
type:
|
|
2772
|
-
item_id:
|
|
2773
|
-
output_index:
|
|
2774
|
-
code:
|
|
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
|
-
|
|
2777
|
-
type:
|
|
2778
|
-
annotation:
|
|
2779
|
-
|
|
2780
|
-
type:
|
|
2781
|
-
start_index:
|
|
2782
|
-
end_index:
|
|
2783
|
-
url:
|
|
2784
|
-
title:
|
|
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
|
-
|
|
2787
|
-
type:
|
|
2788
|
-
file_id:
|
|
2789
|
-
filename:
|
|
2790
|
-
index:
|
|
2791
|
-
start_index:
|
|
2792
|
-
end_index:
|
|
2793
|
-
quote:
|
|
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
|
-
|
|
2798
|
-
type:
|
|
2799
|
-
item_id:
|
|
2800
|
-
summary_index:
|
|
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
|
-
|
|
2803
|
-
type:
|
|
2804
|
-
item_id:
|
|
2805
|
-
summary_index:
|
|
2806
|
-
delta:
|
|
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
|
-
|
|
2809
|
-
type:
|
|
2810
|
-
item_id:
|
|
2811
|
-
summary_index:
|
|
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
|
-
|
|
2814
|
-
type:
|
|
2815
|
-
sequence_number:
|
|
2816
|
-
error:
|
|
2817
|
-
type:
|
|
2818
|
-
code:
|
|
2819
|
-
message:
|
|
2820
|
-
param:
|
|
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
|
-
|
|
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 =
|
|
2832
|
-
() =>
|
|
2833
|
-
|
|
2834
|
-
id:
|
|
2835
|
-
created_at:
|
|
2836
|
-
error:
|
|
2837
|
-
message:
|
|
2838
|
-
type:
|
|
2839
|
-
param:
|
|
2840
|
-
code:
|
|
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:
|
|
2843
|
-
output:
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
type:
|
|
2847
|
-
role:
|
|
2848
|
-
id:
|
|
2849
|
-
phase:
|
|
2850
|
-
content:
|
|
2851
|
-
|
|
2852
|
-
type:
|
|
2853
|
-
text:
|
|
2854
|
-
logprobs:
|
|
2855
|
-
|
|
2856
|
-
token:
|
|
2857
|
-
logprob:
|
|
2858
|
-
top_logprobs:
|
|
2859
|
-
|
|
2860
|
-
token:
|
|
2861
|
-
logprob:
|
|
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:
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
type:
|
|
2870
|
-
start_index:
|
|
2871
|
-
end_index:
|
|
2872
|
-
url:
|
|
2873
|
-
title:
|
|
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
|
-
|
|
2876
|
-
type:
|
|
2877
|
-
file_id:
|
|
2878
|
-
filename:
|
|
2879
|
-
index:
|
|
2880
|
-
start_index:
|
|
2881
|
-
end_index:
|
|
2882
|
-
quote:
|
|
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
|
-
|
|
2885
|
-
type:
|
|
2886
|
-
container_id:
|
|
2887
|
-
file_id:
|
|
2888
|
-
filename:
|
|
2889
|
-
start_index:
|
|
2890
|
-
end_index:
|
|
2891
|
-
index:
|
|
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
|
-
|
|
2894
|
-
type:
|
|
2895
|
-
file_id:
|
|
2896
|
-
index:
|
|
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
|
-
|
|
2904
|
-
type:
|
|
2905
|
-
id:
|
|
2906
|
-
status:
|
|
2907
|
-
action:
|
|
2908
|
-
|
|
2909
|
-
type:
|
|
2910
|
-
query:
|
|
2911
|
-
sources:
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
type:
|
|
2916
|
-
name:
|
|
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
|
-
|
|
2922
|
-
type:
|
|
2923
|
-
url:
|
|
2987
|
+
z15.object({
|
|
2988
|
+
type: z15.literal("open_page"),
|
|
2989
|
+
url: z15.string().nullish()
|
|
2924
2990
|
}),
|
|
2925
|
-
|
|
2926
|
-
type:
|
|
2927
|
-
url:
|
|
2928
|
-
pattern:
|
|
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
|
-
|
|
2933
|
-
type:
|
|
2934
|
-
id:
|
|
2935
|
-
queries:
|
|
2936
|
-
results:
|
|
2937
|
-
|
|
2938
|
-
attributes:
|
|
2939
|
-
|
|
2940
|
-
|
|
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:
|
|
2943
|
-
filename:
|
|
2944
|
-
score:
|
|
2945
|
-
text:
|
|
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
|
-
|
|
2950
|
-
type:
|
|
2951
|
-
id:
|
|
2952
|
-
code:
|
|
2953
|
-
container_id:
|
|
2954
|
-
outputs:
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
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
|
-
|
|
2962
|
-
type:
|
|
2963
|
-
id:
|
|
2964
|
-
result:
|
|
3027
|
+
z15.object({
|
|
3028
|
+
type: z15.literal("image_generation_call"),
|
|
3029
|
+
id: z15.string(),
|
|
3030
|
+
result: z15.string()
|
|
2965
3031
|
}),
|
|
2966
|
-
|
|
2967
|
-
type:
|
|
2968
|
-
id:
|
|
2969
|
-
call_id:
|
|
2970
|
-
action:
|
|
2971
|
-
type:
|
|
2972
|
-
command:
|
|
2973
|
-
timeout_ms:
|
|
2974
|
-
user:
|
|
2975
|
-
working_directory:
|
|
2976
|
-
env:
|
|
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
|
-
|
|
2980
|
-
type:
|
|
2981
|
-
call_id:
|
|
2982
|
-
name:
|
|
2983
|
-
arguments:
|
|
2984
|
-
id:
|
|
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
|
-
|
|
2987
|
-
type:
|
|
2988
|
-
id:
|
|
2989
|
-
status:
|
|
3052
|
+
z15.object({
|
|
3053
|
+
type: z15.literal("computer_call"),
|
|
3054
|
+
id: z15.string(),
|
|
3055
|
+
status: z15.string().optional()
|
|
2990
3056
|
}),
|
|
2991
|
-
|
|
2992
|
-
type:
|
|
2993
|
-
id:
|
|
2994
|
-
encrypted_content:
|
|
2995
|
-
summary:
|
|
2996
|
-
|
|
2997
|
-
type:
|
|
2998
|
-
text:
|
|
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:
|
|
3005
|
-
incomplete_details:
|
|
3006
|
-
usage:
|
|
3007
|
-
input_tokens:
|
|
3008
|
-
input_tokens_details:
|
|
3009
|
-
output_tokens:
|
|
3010
|
-
output_tokens_details:
|
|
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
|
|
3019
|
-
zodSchema as
|
|
3084
|
+
lazyValidator as lazyValidator13,
|
|
3085
|
+
zodSchema as zodSchema14
|
|
3020
3086
|
} from "@ai-sdk/provider-utils";
|
|
3021
|
-
import { z as
|
|
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 =
|
|
3104
|
-
() =>
|
|
3105
|
-
|
|
3106
|
-
conversation:
|
|
3107
|
-
include:
|
|
3108
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
3135
|
-
metadata:
|
|
3136
|
-
parallelToolCalls:
|
|
3137
|
-
previousResponseId:
|
|
3138
|
-
promptCacheKey:
|
|
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:
|
|
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:
|
|
3159
|
-
reasoningSummary:
|
|
3160
|
-
safetyIdentifier:
|
|
3161
|
-
serviceTier:
|
|
3162
|
-
store:
|
|
3163
|
-
strictJsonSchema:
|
|
3164
|
-
textVerbosity:
|
|
3165
|
-
truncation:
|
|
3166
|
-
user:
|
|
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
|
|
3246
|
+
zodSchema as zodSchema15
|
|
3181
3247
|
} from "@ai-sdk/provider-utils";
|
|
3182
|
-
import { z as
|
|
3248
|
+
import { z as z17 } from "zod/v4";
|
|
3183
3249
|
var codeInterpreterInputSchema = lazySchema2(
|
|
3184
|
-
() =>
|
|
3185
|
-
|
|
3186
|
-
code:
|
|
3187
|
-
containerId:
|
|
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
|
-
() =>
|
|
3193
|
-
|
|
3194
|
-
outputs:
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
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
|
-
() =>
|
|
3205
|
-
|
|
3206
|
-
container:
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
fileIds:
|
|
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
|
|
3295
|
+
zodSchema as zodSchema16
|
|
3230
3296
|
} from "@ai-sdk/provider-utils";
|
|
3231
|
-
import { z as
|
|
3232
|
-
var comparisonFilterSchema =
|
|
3233
|
-
key:
|
|
3234
|
-
type:
|
|
3235
|
-
value:
|
|
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 =
|
|
3238
|
-
type:
|
|
3239
|
-
filters:
|
|
3240
|
-
|
|
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
|
-
() =>
|
|
3245
|
-
|
|
3246
|
-
vectorStoreIds:
|
|
3247
|
-
maxNumResults:
|
|
3248
|
-
ranking:
|
|
3249
|
-
ranker:
|
|
3250
|
-
scoreThreshold:
|
|
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:
|
|
3318
|
+
filters: z18.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
3253
3319
|
})
|
|
3254
3320
|
)
|
|
3255
3321
|
);
|
|
3256
3322
|
var fileSearchOutputSchema = lazySchema3(
|
|
3257
|
-
() =>
|
|
3258
|
-
|
|
3259
|
-
queries:
|
|
3260
|
-
results:
|
|
3261
|
-
|
|
3262
|
-
attributes:
|
|
3263
|
-
fileId:
|
|
3264
|
-
filename:
|
|
3265
|
-
score:
|
|
3266
|
-
text:
|
|
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:
|
|
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
|
|
3349
|
+
zodSchema as zodSchema17
|
|
3284
3350
|
} from "@ai-sdk/provider-utils";
|
|
3285
|
-
import { z as
|
|
3351
|
+
import { z as z19 } from "zod/v4";
|
|
3286
3352
|
var webSearchArgsSchema = lazySchema4(
|
|
3287
|
-
() =>
|
|
3288
|
-
|
|
3289
|
-
externalWebAccess:
|
|
3290
|
-
filters:
|
|
3291
|
-
searchContextSize:
|
|
3292
|
-
userLocation:
|
|
3293
|
-
type:
|
|
3294
|
-
country:
|
|
3295
|
-
city:
|
|
3296
|
-
region:
|
|
3297
|
-
timezone:
|
|
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(() =>
|
|
3368
|
+
var webSearchInputSchema = lazySchema4(() => zodSchema17(z19.object({})));
|
|
3303
3369
|
var webSearchOutputSchema = lazySchema4(
|
|
3304
|
-
() =>
|
|
3305
|
-
|
|
3306
|
-
action:
|
|
3307
|
-
|
|
3308
|
-
type:
|
|
3309
|
-
query:
|
|
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
|
-
|
|
3312
|
-
type:
|
|
3313
|
-
url:
|
|
3377
|
+
z19.object({
|
|
3378
|
+
type: z19.literal("openPage"),
|
|
3379
|
+
url: z19.string().nullish()
|
|
3314
3380
|
}),
|
|
3315
|
-
|
|
3316
|
-
type:
|
|
3317
|
-
url:
|
|
3318
|
-
pattern:
|
|
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:
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
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
|
|
3407
|
+
zodSchema as zodSchema18
|
|
3342
3408
|
} from "@ai-sdk/provider-utils";
|
|
3343
|
-
import { z as
|
|
3409
|
+
import { z as z20 } from "zod/v4";
|
|
3344
3410
|
var webSearchPreviewArgsSchema = lazySchema5(
|
|
3345
|
-
() =>
|
|
3346
|
-
|
|
3347
|
-
searchContextSize:
|
|
3348
|
-
userLocation:
|
|
3349
|
-
type:
|
|
3350
|
-
country:
|
|
3351
|
-
city:
|
|
3352
|
-
region:
|
|
3353
|
-
timezone:
|
|
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
|
-
() =>
|
|
3425
|
+
() => zodSchema18(z20.object({}))
|
|
3360
3426
|
);
|
|
3361
3427
|
var webSearchPreviewOutputSchema = lazySchema5(
|
|
3362
|
-
() =>
|
|
3363
|
-
|
|
3364
|
-
action:
|
|
3365
|
-
|
|
3366
|
-
type:
|
|
3367
|
-
query:
|
|
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
|
-
|
|
3370
|
-
type:
|
|
3371
|
-
url:
|
|
3435
|
+
z20.object({
|
|
3436
|
+
type: z20.literal("openPage"),
|
|
3437
|
+
url: z20.string().nullish()
|
|
3372
3438
|
}),
|
|
3373
|
-
|
|
3374
|
-
type:
|
|
3375
|
-
url:
|
|
3376
|
-
pattern:
|
|
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
|
|
3459
|
+
zodSchema as zodSchema19
|
|
3394
3460
|
} from "@ai-sdk/provider-utils";
|
|
3395
|
-
import { z as
|
|
3461
|
+
import { z as z21 } from "zod/v4";
|
|
3396
3462
|
var imageGenerationArgsSchema = lazySchema6(
|
|
3397
|
-
() =>
|
|
3398
|
-
|
|
3399
|
-
background:
|
|
3400
|
-
inputFidelity:
|
|
3401
|
-
inputImageMask:
|
|
3402
|
-
fileId:
|
|
3403
|
-
imageUrl:
|
|
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:
|
|
3406
|
-
moderation:
|
|
3407
|
-
outputCompression:
|
|
3408
|
-
outputFormat:
|
|
3409
|
-
partialImages:
|
|
3410
|
-
quality:
|
|
3411
|
-
size:
|
|
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(() =>
|
|
3481
|
+
var imageGenerationInputSchema = lazySchema6(() => zodSchema19(z21.object({})));
|
|
3416
3482
|
var imageGenerationOutputSchema = lazySchema6(
|
|
3417
|
-
() =>
|
|
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
|
|
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,
|