@ai-sdk/openai 3.0.55 → 3.0.58
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 +19 -0
- package/dist/index.d.mts +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +1221 -1125
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1165 -1065
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +30 -1
- package/dist/internal/index.d.ts +30 -1
- package/dist/internal/index.js +1220 -1118
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1166 -1063
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +12 -3
- package/package.json +2 -2
- package/src/image/openai-image-model-options.ts +123 -0
- package/src/image/openai-image-model.ts +40 -77
- package/src/index.ts +5 -0
- package/src/internal/index.ts +1 -1
- package/src/openai-provider.ts +1 -1
- package/src/responses/openai-responses-api.ts +3 -0
- package/src/responses/openai-responses-language-model.ts +11 -0
- package/src/image/openai-image-options.ts +0 -34
package/dist/internal/index.mjs
CHANGED
|
@@ -1734,6 +1734,7 @@ import {
|
|
|
1734
1734
|
convertToFormData,
|
|
1735
1735
|
createJsonResponseHandler as createJsonResponseHandler4,
|
|
1736
1736
|
downloadBlob,
|
|
1737
|
+
parseProviderOptions as parseProviderOptions4,
|
|
1737
1738
|
postFormDataToApi,
|
|
1738
1739
|
postJsonToApi as postJsonToApi4
|
|
1739
1740
|
} from "@ai-sdk/provider-utils";
|
|
@@ -1768,7 +1769,12 @@ var openaiImageResponseSchema = lazySchema7(
|
|
|
1768
1769
|
)
|
|
1769
1770
|
);
|
|
1770
1771
|
|
|
1771
|
-
// src/image/openai-image-options.ts
|
|
1772
|
+
// src/image/openai-image-model-options.ts
|
|
1773
|
+
import {
|
|
1774
|
+
lazySchema as lazySchema8,
|
|
1775
|
+
zodSchema as zodSchema8
|
|
1776
|
+
} from "@ai-sdk/provider-utils";
|
|
1777
|
+
import { z as z9 } from "zod/v4";
|
|
1772
1778
|
var modelMaxImagesPerCall = {
|
|
1773
1779
|
"dall-e-3": 1,
|
|
1774
1780
|
"dall-e-2": 10,
|
|
@@ -1790,6 +1796,65 @@ function hasDefaultResponseFormat(modelId) {
|
|
|
1790
1796
|
(prefix) => modelId.startsWith(prefix)
|
|
1791
1797
|
);
|
|
1792
1798
|
}
|
|
1799
|
+
var baseImageModelOptionsObject = z9.object({
|
|
1800
|
+
/**
|
|
1801
|
+
* Quality of the generated image(s).
|
|
1802
|
+
*
|
|
1803
|
+
* Valid values: `standard`, `hd`, `low`, `medium`, `high`, `auto`.
|
|
1804
|
+
*/
|
|
1805
|
+
quality: z9.enum(["standard", "hd", "low", "medium", "high", "auto"]).optional(),
|
|
1806
|
+
/**
|
|
1807
|
+
* Background behavior for the generated image(s).
|
|
1808
|
+
*
|
|
1809
|
+
* If `transparent`, the output format must support transparency
|
|
1810
|
+
* (i.e. `png` or `webp`).
|
|
1811
|
+
*/
|
|
1812
|
+
background: z9.enum(["transparent", "opaque", "auto"]).optional(),
|
|
1813
|
+
/**
|
|
1814
|
+
* Format in which the generated image(s) are returned.
|
|
1815
|
+
*/
|
|
1816
|
+
outputFormat: z9.enum(["png", "jpeg", "webp"]).optional(),
|
|
1817
|
+
/**
|
|
1818
|
+
* Compression level (0-100) for the generated image(s). Applies to the
|
|
1819
|
+
* `jpeg` and `webp` output formats.
|
|
1820
|
+
*/
|
|
1821
|
+
outputCompression: z9.number().int().min(0).max(100).optional(),
|
|
1822
|
+
/**
|
|
1823
|
+
* A unique identifier representing your end-user, which can help OpenAI
|
|
1824
|
+
* to monitor and detect abuse.
|
|
1825
|
+
*/
|
|
1826
|
+
user: z9.string().optional()
|
|
1827
|
+
});
|
|
1828
|
+
var openaiImageModelOptions = lazySchema8(
|
|
1829
|
+
() => zodSchema8(baseImageModelOptionsObject)
|
|
1830
|
+
);
|
|
1831
|
+
var openaiImageModelGenerationOptions = lazySchema8(
|
|
1832
|
+
() => zodSchema8(
|
|
1833
|
+
baseImageModelOptionsObject.extend({
|
|
1834
|
+
/**
|
|
1835
|
+
* Style of the generated image. `vivid` produces hyper-real and
|
|
1836
|
+
* dramatic images; `natural` produces more subdued, less hyper-real
|
|
1837
|
+
* looking images.
|
|
1838
|
+
*/
|
|
1839
|
+
style: z9.enum(["vivid", "natural"]).optional(),
|
|
1840
|
+
/**
|
|
1841
|
+
* Content moderation level for the generated image(s). `low` applies
|
|
1842
|
+
* less restrictive filtering.
|
|
1843
|
+
*/
|
|
1844
|
+
moderation: z9.enum(["auto", "low"]).optional()
|
|
1845
|
+
})
|
|
1846
|
+
)
|
|
1847
|
+
);
|
|
1848
|
+
var openaiImageModelEditOptions = lazySchema8(
|
|
1849
|
+
() => zodSchema8(
|
|
1850
|
+
baseImageModelOptionsObject.extend({
|
|
1851
|
+
/**
|
|
1852
|
+
* Fidelity of the output image(s) to the input image(s).
|
|
1853
|
+
*/
|
|
1854
|
+
inputFidelity: z9.enum(["high", "low"]).optional()
|
|
1855
|
+
})
|
|
1856
|
+
)
|
|
1857
|
+
);
|
|
1793
1858
|
|
|
1794
1859
|
// src/image/openai-image-model.ts
|
|
1795
1860
|
var OpenAIImageModel = class {
|
|
@@ -1831,6 +1896,11 @@ var OpenAIImageModel = class {
|
|
|
1831
1896
|
}
|
|
1832
1897
|
const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
|
|
1833
1898
|
if (files != null) {
|
|
1899
|
+
const openaiOptions2 = (_d = await parseProviderOptions4({
|
|
1900
|
+
provider: "openai",
|
|
1901
|
+
providerOptions,
|
|
1902
|
+
schema: openaiImageModelEditOptions
|
|
1903
|
+
})) != null ? _d : {};
|
|
1834
1904
|
const { value: response2, responseHeaders: responseHeaders2 } = await postFormDataToApi({
|
|
1835
1905
|
url: this.config.url({
|
|
1836
1906
|
path: "/images/edits",
|
|
@@ -1857,7 +1927,12 @@ var OpenAIImageModel = class {
|
|
|
1857
1927
|
mask: mask != null ? await fileToBlob(mask) : void 0,
|
|
1858
1928
|
n,
|
|
1859
1929
|
size,
|
|
1860
|
-
|
|
1930
|
+
quality: openaiOptions2.quality,
|
|
1931
|
+
background: openaiOptions2.background,
|
|
1932
|
+
output_format: openaiOptions2.outputFormat,
|
|
1933
|
+
output_compression: openaiOptions2.outputCompression,
|
|
1934
|
+
input_fidelity: openaiOptions2.inputFidelity,
|
|
1935
|
+
user: openaiOptions2.user
|
|
1861
1936
|
}),
|
|
1862
1937
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
1863
1938
|
successfulResponseHandler: createJsonResponseHandler4(
|
|
@@ -1901,6 +1976,11 @@ var OpenAIImageModel = class {
|
|
|
1901
1976
|
}
|
|
1902
1977
|
};
|
|
1903
1978
|
}
|
|
1979
|
+
const openaiOptions = (_h = await parseProviderOptions4({
|
|
1980
|
+
provider: "openai",
|
|
1981
|
+
providerOptions,
|
|
1982
|
+
schema: openaiImageModelGenerationOptions
|
|
1983
|
+
})) != null ? _h : {};
|
|
1904
1984
|
const { value: response, responseHeaders } = await postJsonToApi4({
|
|
1905
1985
|
url: this.config.url({
|
|
1906
1986
|
path: "/images/generations",
|
|
@@ -1912,7 +1992,13 @@ var OpenAIImageModel = class {
|
|
|
1912
1992
|
prompt,
|
|
1913
1993
|
n,
|
|
1914
1994
|
size,
|
|
1915
|
-
|
|
1995
|
+
quality: openaiOptions.quality,
|
|
1996
|
+
style: openaiOptions.style,
|
|
1997
|
+
background: openaiOptions.background,
|
|
1998
|
+
moderation: openaiOptions.moderation,
|
|
1999
|
+
output_format: openaiOptions.outputFormat,
|
|
2000
|
+
output_compression: openaiOptions.outputCompression,
|
|
2001
|
+
user: openaiOptions.user,
|
|
1916
2002
|
...!hasDefaultResponseFormat(this.modelId) ? { response_format: "b64_json" } : {}
|
|
1917
2003
|
},
|
|
1918
2004
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
@@ -1990,38 +2076,38 @@ import {
|
|
|
1990
2076
|
convertBase64ToUint8Array as convertBase64ToUint8Array2,
|
|
1991
2077
|
createJsonResponseHandler as createJsonResponseHandler5,
|
|
1992
2078
|
mediaTypeToExtension,
|
|
1993
|
-
parseProviderOptions as
|
|
2079
|
+
parseProviderOptions as parseProviderOptions5,
|
|
1994
2080
|
postFormDataToApi as postFormDataToApi2
|
|
1995
2081
|
} from "@ai-sdk/provider-utils";
|
|
1996
2082
|
|
|
1997
2083
|
// src/transcription/openai-transcription-api.ts
|
|
1998
|
-
import { lazySchema as
|
|
1999
|
-
import { z as
|
|
2000
|
-
var openaiTranscriptionResponseSchema =
|
|
2001
|
-
() =>
|
|
2002
|
-
|
|
2003
|
-
text:
|
|
2004
|
-
language:
|
|
2005
|
-
duration:
|
|
2006
|
-
words:
|
|
2007
|
-
|
|
2008
|
-
word:
|
|
2009
|
-
start:
|
|
2010
|
-
end:
|
|
2084
|
+
import { lazySchema as lazySchema9, zodSchema as zodSchema9 } from "@ai-sdk/provider-utils";
|
|
2085
|
+
import { z as z10 } from "zod/v4";
|
|
2086
|
+
var openaiTranscriptionResponseSchema = lazySchema9(
|
|
2087
|
+
() => zodSchema9(
|
|
2088
|
+
z10.object({
|
|
2089
|
+
text: z10.string(),
|
|
2090
|
+
language: z10.string().nullish(),
|
|
2091
|
+
duration: z10.number().nullish(),
|
|
2092
|
+
words: z10.array(
|
|
2093
|
+
z10.object({
|
|
2094
|
+
word: z10.string(),
|
|
2095
|
+
start: z10.number(),
|
|
2096
|
+
end: z10.number()
|
|
2011
2097
|
})
|
|
2012
2098
|
).nullish(),
|
|
2013
|
-
segments:
|
|
2014
|
-
|
|
2015
|
-
id:
|
|
2016
|
-
seek:
|
|
2017
|
-
start:
|
|
2018
|
-
end:
|
|
2019
|
-
text:
|
|
2020
|
-
tokens:
|
|
2021
|
-
temperature:
|
|
2022
|
-
avg_logprob:
|
|
2023
|
-
compression_ratio:
|
|
2024
|
-
no_speech_prob:
|
|
2099
|
+
segments: z10.array(
|
|
2100
|
+
z10.object({
|
|
2101
|
+
id: z10.number(),
|
|
2102
|
+
seek: z10.number(),
|
|
2103
|
+
start: z10.number(),
|
|
2104
|
+
end: z10.number(),
|
|
2105
|
+
text: z10.string(),
|
|
2106
|
+
tokens: z10.array(z10.number()),
|
|
2107
|
+
temperature: z10.number(),
|
|
2108
|
+
avg_logprob: z10.number(),
|
|
2109
|
+
compression_ratio: z10.number(),
|
|
2110
|
+
no_speech_prob: z10.number()
|
|
2025
2111
|
})
|
|
2026
2112
|
).nullish()
|
|
2027
2113
|
})
|
|
@@ -2030,35 +2116,35 @@ var openaiTranscriptionResponseSchema = lazySchema8(
|
|
|
2030
2116
|
|
|
2031
2117
|
// src/transcription/openai-transcription-options.ts
|
|
2032
2118
|
import {
|
|
2033
|
-
lazySchema as
|
|
2034
|
-
zodSchema as
|
|
2119
|
+
lazySchema as lazySchema10,
|
|
2120
|
+
zodSchema as zodSchema10
|
|
2035
2121
|
} from "@ai-sdk/provider-utils";
|
|
2036
|
-
import { z as
|
|
2037
|
-
var openAITranscriptionModelOptions =
|
|
2038
|
-
() =>
|
|
2039
|
-
|
|
2122
|
+
import { z as z11 } from "zod/v4";
|
|
2123
|
+
var openAITranscriptionModelOptions = lazySchema10(
|
|
2124
|
+
() => zodSchema10(
|
|
2125
|
+
z11.object({
|
|
2040
2126
|
/**
|
|
2041
2127
|
* Additional information to include in the transcription response.
|
|
2042
2128
|
*/
|
|
2043
|
-
include:
|
|
2129
|
+
include: z11.array(z11.string()).optional(),
|
|
2044
2130
|
/**
|
|
2045
2131
|
* The language of the input audio in ISO-639-1 format.
|
|
2046
2132
|
*/
|
|
2047
|
-
language:
|
|
2133
|
+
language: z11.string().optional(),
|
|
2048
2134
|
/**
|
|
2049
2135
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
2050
2136
|
*/
|
|
2051
|
-
prompt:
|
|
2137
|
+
prompt: z11.string().optional(),
|
|
2052
2138
|
/**
|
|
2053
2139
|
* The sampling temperature, between 0 and 1.
|
|
2054
2140
|
* @default 0
|
|
2055
2141
|
*/
|
|
2056
|
-
temperature:
|
|
2142
|
+
temperature: z11.number().min(0).max(1).default(0).optional(),
|
|
2057
2143
|
/**
|
|
2058
2144
|
* The timestamp granularities to populate for this transcription.
|
|
2059
2145
|
* @default ['segment']
|
|
2060
2146
|
*/
|
|
2061
|
-
timestampGranularities:
|
|
2147
|
+
timestampGranularities: z11.array(z11.enum(["word", "segment"])).default(["segment"]).optional()
|
|
2062
2148
|
})
|
|
2063
2149
|
)
|
|
2064
2150
|
);
|
|
@@ -2138,7 +2224,7 @@ var OpenAITranscriptionModel = class {
|
|
|
2138
2224
|
providerOptions
|
|
2139
2225
|
}) {
|
|
2140
2226
|
const warnings = [];
|
|
2141
|
-
const openAIOptions = await
|
|
2227
|
+
const openAIOptions = await parseProviderOptions5({
|
|
2142
2228
|
provider: "openai",
|
|
2143
2229
|
providerOptions,
|
|
2144
2230
|
schema: openAITranscriptionModelOptions
|
|
@@ -2234,21 +2320,21 @@ var OpenAITranscriptionModel = class {
|
|
|
2234
2320
|
import {
|
|
2235
2321
|
combineHeaders as combineHeaders6,
|
|
2236
2322
|
createBinaryResponseHandler,
|
|
2237
|
-
parseProviderOptions as
|
|
2323
|
+
parseProviderOptions as parseProviderOptions6,
|
|
2238
2324
|
postJsonToApi as postJsonToApi5
|
|
2239
2325
|
} from "@ai-sdk/provider-utils";
|
|
2240
2326
|
|
|
2241
2327
|
// src/speech/openai-speech-options.ts
|
|
2242
2328
|
import {
|
|
2243
|
-
lazySchema as
|
|
2244
|
-
zodSchema as
|
|
2329
|
+
lazySchema as lazySchema11,
|
|
2330
|
+
zodSchema as zodSchema11
|
|
2245
2331
|
} from "@ai-sdk/provider-utils";
|
|
2246
|
-
import { z as
|
|
2247
|
-
var openaiSpeechModelOptionsSchema =
|
|
2248
|
-
() =>
|
|
2249
|
-
|
|
2250
|
-
instructions:
|
|
2251
|
-
speed:
|
|
2332
|
+
import { z as z12 } from "zod/v4";
|
|
2333
|
+
var openaiSpeechModelOptionsSchema = lazySchema11(
|
|
2334
|
+
() => zodSchema11(
|
|
2335
|
+
z12.object({
|
|
2336
|
+
instructions: z12.string().nullish(),
|
|
2337
|
+
speed: z12.number().min(0.25).max(4).default(1).nullish()
|
|
2252
2338
|
})
|
|
2253
2339
|
)
|
|
2254
2340
|
);
|
|
@@ -2273,7 +2359,7 @@ var OpenAISpeechModel = class {
|
|
|
2273
2359
|
providerOptions
|
|
2274
2360
|
}) {
|
|
2275
2361
|
const warnings = [];
|
|
2276
|
-
const openAIOptions = await
|
|
2362
|
+
const openAIOptions = await parseProviderOptions6({
|
|
2277
2363
|
provider: "openai",
|
|
2278
2364
|
providerOptions,
|
|
2279
2365
|
schema: openaiSpeechModelOptionsSchema
|
|
@@ -2364,7 +2450,7 @@ import {
|
|
|
2364
2450
|
createJsonResponseHandler as createJsonResponseHandler6,
|
|
2365
2451
|
createToolNameMapping,
|
|
2366
2452
|
generateId as generateId2,
|
|
2367
|
-
parseProviderOptions as
|
|
2453
|
+
parseProviderOptions as parseProviderOptions8,
|
|
2368
2454
|
postJsonToApi as postJsonToApi6
|
|
2369
2455
|
} from "@ai-sdk/provider-utils";
|
|
2370
2456
|
|
|
@@ -2415,50 +2501,50 @@ import {
|
|
|
2415
2501
|
convertToBase64 as convertToBase642,
|
|
2416
2502
|
isNonNullable,
|
|
2417
2503
|
parseJSON,
|
|
2418
|
-
parseProviderOptions as
|
|
2504
|
+
parseProviderOptions as parseProviderOptions7,
|
|
2419
2505
|
validateTypes
|
|
2420
2506
|
} from "@ai-sdk/provider-utils";
|
|
2421
|
-
import { z as
|
|
2507
|
+
import { z as z17 } from "zod/v4";
|
|
2422
2508
|
|
|
2423
2509
|
// src/tool/apply-patch.ts
|
|
2424
2510
|
import {
|
|
2425
2511
|
createProviderToolFactoryWithOutputSchema,
|
|
2426
|
-
lazySchema as
|
|
2427
|
-
zodSchema as
|
|
2512
|
+
lazySchema as lazySchema12,
|
|
2513
|
+
zodSchema as zodSchema12
|
|
2428
2514
|
} from "@ai-sdk/provider-utils";
|
|
2429
|
-
import { z as
|
|
2430
|
-
var applyPatchInputSchema =
|
|
2431
|
-
() =>
|
|
2432
|
-
|
|
2433
|
-
callId:
|
|
2434
|
-
operation:
|
|
2435
|
-
|
|
2436
|
-
type:
|
|
2437
|
-
path:
|
|
2438
|
-
diff:
|
|
2515
|
+
import { z as z13 } from "zod/v4";
|
|
2516
|
+
var applyPatchInputSchema = lazySchema12(
|
|
2517
|
+
() => zodSchema12(
|
|
2518
|
+
z13.object({
|
|
2519
|
+
callId: z13.string(),
|
|
2520
|
+
operation: z13.discriminatedUnion("type", [
|
|
2521
|
+
z13.object({
|
|
2522
|
+
type: z13.literal("create_file"),
|
|
2523
|
+
path: z13.string(),
|
|
2524
|
+
diff: z13.string()
|
|
2439
2525
|
}),
|
|
2440
|
-
|
|
2441
|
-
type:
|
|
2442
|
-
path:
|
|
2526
|
+
z13.object({
|
|
2527
|
+
type: z13.literal("delete_file"),
|
|
2528
|
+
path: z13.string()
|
|
2443
2529
|
}),
|
|
2444
|
-
|
|
2445
|
-
type:
|
|
2446
|
-
path:
|
|
2447
|
-
diff:
|
|
2530
|
+
z13.object({
|
|
2531
|
+
type: z13.literal("update_file"),
|
|
2532
|
+
path: z13.string(),
|
|
2533
|
+
diff: z13.string()
|
|
2448
2534
|
})
|
|
2449
2535
|
])
|
|
2450
2536
|
})
|
|
2451
2537
|
)
|
|
2452
2538
|
);
|
|
2453
|
-
var applyPatchOutputSchema =
|
|
2454
|
-
() =>
|
|
2455
|
-
|
|
2456
|
-
status:
|
|
2457
|
-
output:
|
|
2539
|
+
var applyPatchOutputSchema = lazySchema12(
|
|
2540
|
+
() => zodSchema12(
|
|
2541
|
+
z13.object({
|
|
2542
|
+
status: z13.enum(["completed", "failed"]),
|
|
2543
|
+
output: z13.string().optional()
|
|
2458
2544
|
})
|
|
2459
2545
|
)
|
|
2460
2546
|
);
|
|
2461
|
-
var applyPatchArgsSchema =
|
|
2547
|
+
var applyPatchArgsSchema = lazySchema12(() => zodSchema12(z13.object({})));
|
|
2462
2548
|
var applyPatchToolFactory = createProviderToolFactoryWithOutputSchema({
|
|
2463
2549
|
id: "openai.apply_patch",
|
|
2464
2550
|
inputSchema: applyPatchInputSchema,
|
|
@@ -2469,26 +2555,26 @@ var applyPatch = applyPatchToolFactory;
|
|
|
2469
2555
|
// src/tool/local-shell.ts
|
|
2470
2556
|
import {
|
|
2471
2557
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
|
|
2472
|
-
lazySchema as
|
|
2473
|
-
zodSchema as
|
|
2558
|
+
lazySchema as lazySchema13,
|
|
2559
|
+
zodSchema as zodSchema13
|
|
2474
2560
|
} from "@ai-sdk/provider-utils";
|
|
2475
|
-
import { z as
|
|
2476
|
-
var localShellInputSchema =
|
|
2477
|
-
() =>
|
|
2478
|
-
|
|
2479
|
-
action:
|
|
2480
|
-
type:
|
|
2481
|
-
command:
|
|
2482
|
-
timeoutMs:
|
|
2483
|
-
user:
|
|
2484
|
-
workingDirectory:
|
|
2485
|
-
env:
|
|
2561
|
+
import { z as z14 } from "zod/v4";
|
|
2562
|
+
var localShellInputSchema = lazySchema13(
|
|
2563
|
+
() => zodSchema13(
|
|
2564
|
+
z14.object({
|
|
2565
|
+
action: z14.object({
|
|
2566
|
+
type: z14.literal("exec"),
|
|
2567
|
+
command: z14.array(z14.string()),
|
|
2568
|
+
timeoutMs: z14.number().optional(),
|
|
2569
|
+
user: z14.string().optional(),
|
|
2570
|
+
workingDirectory: z14.string().optional(),
|
|
2571
|
+
env: z14.record(z14.string(), z14.string()).optional()
|
|
2486
2572
|
})
|
|
2487
2573
|
})
|
|
2488
2574
|
)
|
|
2489
2575
|
);
|
|
2490
|
-
var localShellOutputSchema =
|
|
2491
|
-
() =>
|
|
2576
|
+
var localShellOutputSchema = lazySchema13(
|
|
2577
|
+
() => zodSchema13(z14.object({ output: z14.string() }))
|
|
2492
2578
|
);
|
|
2493
2579
|
var localShell = createProviderToolFactoryWithOutputSchema2({
|
|
2494
2580
|
id: "openai.local_shell",
|
|
@@ -2499,91 +2585,91 @@ var localShell = createProviderToolFactoryWithOutputSchema2({
|
|
|
2499
2585
|
// src/tool/shell.ts
|
|
2500
2586
|
import {
|
|
2501
2587
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
|
|
2502
|
-
lazySchema as
|
|
2503
|
-
zodSchema as
|
|
2588
|
+
lazySchema as lazySchema14,
|
|
2589
|
+
zodSchema as zodSchema14
|
|
2504
2590
|
} from "@ai-sdk/provider-utils";
|
|
2505
|
-
import { z as
|
|
2506
|
-
var shellInputSchema =
|
|
2507
|
-
() =>
|
|
2508
|
-
|
|
2509
|
-
action:
|
|
2510
|
-
commands:
|
|
2511
|
-
timeoutMs:
|
|
2512
|
-
maxOutputLength:
|
|
2591
|
+
import { z as z15 } from "zod/v4";
|
|
2592
|
+
var shellInputSchema = lazySchema14(
|
|
2593
|
+
() => zodSchema14(
|
|
2594
|
+
z15.object({
|
|
2595
|
+
action: z15.object({
|
|
2596
|
+
commands: z15.array(z15.string()),
|
|
2597
|
+
timeoutMs: z15.number().optional(),
|
|
2598
|
+
maxOutputLength: z15.number().optional()
|
|
2513
2599
|
})
|
|
2514
2600
|
})
|
|
2515
2601
|
)
|
|
2516
2602
|
);
|
|
2517
|
-
var shellOutputSchema =
|
|
2518
|
-
() =>
|
|
2519
|
-
|
|
2520
|
-
output:
|
|
2521
|
-
|
|
2522
|
-
stdout:
|
|
2523
|
-
stderr:
|
|
2524
|
-
outcome:
|
|
2525
|
-
|
|
2526
|
-
|
|
2603
|
+
var shellOutputSchema = lazySchema14(
|
|
2604
|
+
() => zodSchema14(
|
|
2605
|
+
z15.object({
|
|
2606
|
+
output: z15.array(
|
|
2607
|
+
z15.object({
|
|
2608
|
+
stdout: z15.string(),
|
|
2609
|
+
stderr: z15.string(),
|
|
2610
|
+
outcome: z15.discriminatedUnion("type", [
|
|
2611
|
+
z15.object({ type: z15.literal("timeout") }),
|
|
2612
|
+
z15.object({ type: z15.literal("exit"), exitCode: z15.number() })
|
|
2527
2613
|
])
|
|
2528
2614
|
})
|
|
2529
2615
|
)
|
|
2530
2616
|
})
|
|
2531
2617
|
)
|
|
2532
2618
|
);
|
|
2533
|
-
var shellSkillsSchema =
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
type:
|
|
2537
|
-
skillId:
|
|
2538
|
-
version:
|
|
2619
|
+
var shellSkillsSchema = z15.array(
|
|
2620
|
+
z15.discriminatedUnion("type", [
|
|
2621
|
+
z15.object({
|
|
2622
|
+
type: z15.literal("skillReference"),
|
|
2623
|
+
skillId: z15.string(),
|
|
2624
|
+
version: z15.string().optional()
|
|
2539
2625
|
}),
|
|
2540
|
-
|
|
2541
|
-
type:
|
|
2542
|
-
name:
|
|
2543
|
-
description:
|
|
2544
|
-
source:
|
|
2545
|
-
type:
|
|
2546
|
-
mediaType:
|
|
2547
|
-
data:
|
|
2626
|
+
z15.object({
|
|
2627
|
+
type: z15.literal("inline"),
|
|
2628
|
+
name: z15.string(),
|
|
2629
|
+
description: z15.string(),
|
|
2630
|
+
source: z15.object({
|
|
2631
|
+
type: z15.literal("base64"),
|
|
2632
|
+
mediaType: z15.literal("application/zip"),
|
|
2633
|
+
data: z15.string()
|
|
2548
2634
|
})
|
|
2549
2635
|
})
|
|
2550
2636
|
])
|
|
2551
2637
|
).optional();
|
|
2552
|
-
var shellArgsSchema =
|
|
2553
|
-
() =>
|
|
2554
|
-
|
|
2555
|
-
environment:
|
|
2556
|
-
|
|
2557
|
-
type:
|
|
2558
|
-
fileIds:
|
|
2559
|
-
memoryLimit:
|
|
2560
|
-
networkPolicy:
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
type:
|
|
2564
|
-
allowedDomains:
|
|
2565
|
-
domainSecrets:
|
|
2566
|
-
|
|
2567
|
-
domain:
|
|
2568
|
-
name:
|
|
2569
|
-
value:
|
|
2638
|
+
var shellArgsSchema = lazySchema14(
|
|
2639
|
+
() => zodSchema14(
|
|
2640
|
+
z15.object({
|
|
2641
|
+
environment: z15.union([
|
|
2642
|
+
z15.object({
|
|
2643
|
+
type: z15.literal("containerAuto"),
|
|
2644
|
+
fileIds: z15.array(z15.string()).optional(),
|
|
2645
|
+
memoryLimit: z15.enum(["1g", "4g", "16g", "64g"]).optional(),
|
|
2646
|
+
networkPolicy: z15.discriminatedUnion("type", [
|
|
2647
|
+
z15.object({ type: z15.literal("disabled") }),
|
|
2648
|
+
z15.object({
|
|
2649
|
+
type: z15.literal("allowlist"),
|
|
2650
|
+
allowedDomains: z15.array(z15.string()),
|
|
2651
|
+
domainSecrets: z15.array(
|
|
2652
|
+
z15.object({
|
|
2653
|
+
domain: z15.string(),
|
|
2654
|
+
name: z15.string(),
|
|
2655
|
+
value: z15.string()
|
|
2570
2656
|
})
|
|
2571
2657
|
).optional()
|
|
2572
2658
|
})
|
|
2573
2659
|
]).optional(),
|
|
2574
2660
|
skills: shellSkillsSchema
|
|
2575
2661
|
}),
|
|
2576
|
-
|
|
2577
|
-
type:
|
|
2578
|
-
containerId:
|
|
2662
|
+
z15.object({
|
|
2663
|
+
type: z15.literal("containerReference"),
|
|
2664
|
+
containerId: z15.string()
|
|
2579
2665
|
}),
|
|
2580
|
-
|
|
2581
|
-
type:
|
|
2582
|
-
skills:
|
|
2583
|
-
|
|
2584
|
-
name:
|
|
2585
|
-
description:
|
|
2586
|
-
path:
|
|
2666
|
+
z15.object({
|
|
2667
|
+
type: z15.literal("local").optional(),
|
|
2668
|
+
skills: z15.array(
|
|
2669
|
+
z15.object({
|
|
2670
|
+
name: z15.string(),
|
|
2671
|
+
description: z15.string(),
|
|
2672
|
+
path: z15.string()
|
|
2587
2673
|
})
|
|
2588
2674
|
).optional()
|
|
2589
2675
|
})
|
|
@@ -2600,31 +2686,31 @@ var shell = createProviderToolFactoryWithOutputSchema3({
|
|
|
2600
2686
|
// src/tool/tool-search.ts
|
|
2601
2687
|
import {
|
|
2602
2688
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
|
|
2603
|
-
lazySchema as
|
|
2604
|
-
zodSchema as
|
|
2689
|
+
lazySchema as lazySchema15,
|
|
2690
|
+
zodSchema as zodSchema15
|
|
2605
2691
|
} from "@ai-sdk/provider-utils";
|
|
2606
|
-
import { z as
|
|
2607
|
-
var toolSearchArgsSchema =
|
|
2608
|
-
() =>
|
|
2609
|
-
|
|
2610
|
-
execution:
|
|
2611
|
-
description:
|
|
2612
|
-
parameters:
|
|
2692
|
+
import { z as z16 } from "zod/v4";
|
|
2693
|
+
var toolSearchArgsSchema = lazySchema15(
|
|
2694
|
+
() => zodSchema15(
|
|
2695
|
+
z16.object({
|
|
2696
|
+
execution: z16.enum(["server", "client"]).optional(),
|
|
2697
|
+
description: z16.string().optional(),
|
|
2698
|
+
parameters: z16.record(z16.string(), z16.unknown()).optional()
|
|
2613
2699
|
})
|
|
2614
2700
|
)
|
|
2615
2701
|
);
|
|
2616
|
-
var toolSearchInputSchema =
|
|
2617
|
-
() =>
|
|
2618
|
-
|
|
2619
|
-
arguments:
|
|
2620
|
-
call_id:
|
|
2702
|
+
var toolSearchInputSchema = lazySchema15(
|
|
2703
|
+
() => zodSchema15(
|
|
2704
|
+
z16.object({
|
|
2705
|
+
arguments: z16.unknown().optional(),
|
|
2706
|
+
call_id: z16.string().nullish()
|
|
2621
2707
|
})
|
|
2622
2708
|
)
|
|
2623
2709
|
);
|
|
2624
|
-
var toolSearchOutputSchema =
|
|
2625
|
-
() =>
|
|
2626
|
-
|
|
2627
|
-
tools:
|
|
2710
|
+
var toolSearchOutputSchema = lazySchema15(
|
|
2711
|
+
() => zodSchema15(
|
|
2712
|
+
z16.object({
|
|
2713
|
+
tools: z16.array(z16.record(z16.string(), z16.unknown()))
|
|
2628
2714
|
})
|
|
2629
2715
|
)
|
|
2630
2716
|
);
|
|
@@ -2930,7 +3016,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2930
3016
|
break;
|
|
2931
3017
|
}
|
|
2932
3018
|
case "reasoning": {
|
|
2933
|
-
const providerOptions = await
|
|
3019
|
+
const providerOptions = await parseProviderOptions7({
|
|
2934
3020
|
provider: providerOptionsName,
|
|
2935
3021
|
providerOptions: part.providerOptions,
|
|
2936
3022
|
schema: openaiResponsesReasoningProviderOptionsSchema
|
|
@@ -3238,9 +3324,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
3238
3324
|
}
|
|
3239
3325
|
return { input, warnings };
|
|
3240
3326
|
}
|
|
3241
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
3242
|
-
itemId:
|
|
3243
|
-
reasoningEncryptedContent:
|
|
3327
|
+
var openaiResponsesReasoningProviderOptionsSchema = z17.object({
|
|
3328
|
+
itemId: z17.string().nullish(),
|
|
3329
|
+
reasoningEncryptedContent: z17.string().nullish()
|
|
3244
3330
|
});
|
|
3245
3331
|
|
|
3246
3332
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -3263,544 +3349,546 @@ function mapOpenAIResponseFinishReason({
|
|
|
3263
3349
|
|
|
3264
3350
|
// src/responses/openai-responses-api.ts
|
|
3265
3351
|
import {
|
|
3266
|
-
lazySchema as
|
|
3267
|
-
zodSchema as
|
|
3352
|
+
lazySchema as lazySchema16,
|
|
3353
|
+
zodSchema as zodSchema16
|
|
3268
3354
|
} from "@ai-sdk/provider-utils";
|
|
3269
|
-
import { z as
|
|
3270
|
-
var jsonValueSchema =
|
|
3271
|
-
() =>
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3355
|
+
import { z as z18 } from "zod/v4";
|
|
3356
|
+
var jsonValueSchema = z18.lazy(
|
|
3357
|
+
() => z18.union([
|
|
3358
|
+
z18.string(),
|
|
3359
|
+
z18.number(),
|
|
3360
|
+
z18.boolean(),
|
|
3361
|
+
z18.null(),
|
|
3362
|
+
z18.array(jsonValueSchema),
|
|
3363
|
+
z18.record(z18.string(), jsonValueSchema.optional())
|
|
3278
3364
|
])
|
|
3279
3365
|
);
|
|
3280
|
-
var openaiResponsesChunkSchema =
|
|
3281
|
-
() =>
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
type:
|
|
3285
|
-
item_id:
|
|
3286
|
-
delta:
|
|
3287
|
-
logprobs:
|
|
3288
|
-
|
|
3289
|
-
token:
|
|
3290
|
-
logprob:
|
|
3291
|
-
top_logprobs:
|
|
3292
|
-
|
|
3293
|
-
token:
|
|
3294
|
-
logprob:
|
|
3366
|
+
var openaiResponsesChunkSchema = lazySchema16(
|
|
3367
|
+
() => zodSchema16(
|
|
3368
|
+
z18.union([
|
|
3369
|
+
z18.object({
|
|
3370
|
+
type: z18.literal("response.output_text.delta"),
|
|
3371
|
+
item_id: z18.string(),
|
|
3372
|
+
delta: z18.string(),
|
|
3373
|
+
logprobs: z18.array(
|
|
3374
|
+
z18.object({
|
|
3375
|
+
token: z18.string(),
|
|
3376
|
+
logprob: z18.number(),
|
|
3377
|
+
top_logprobs: z18.array(
|
|
3378
|
+
z18.object({
|
|
3379
|
+
token: z18.string(),
|
|
3380
|
+
logprob: z18.number()
|
|
3295
3381
|
})
|
|
3296
3382
|
)
|
|
3297
3383
|
})
|
|
3298
3384
|
).nullish()
|
|
3299
3385
|
}),
|
|
3300
|
-
|
|
3301
|
-
type:
|
|
3302
|
-
response:
|
|
3303
|
-
incomplete_details:
|
|
3304
|
-
usage:
|
|
3305
|
-
input_tokens:
|
|
3306
|
-
input_tokens_details:
|
|
3307
|
-
output_tokens:
|
|
3308
|
-
output_tokens_details:
|
|
3386
|
+
z18.object({
|
|
3387
|
+
type: z18.enum(["response.completed", "response.incomplete"]),
|
|
3388
|
+
response: z18.object({
|
|
3389
|
+
incomplete_details: z18.object({ reason: z18.string() }).nullish(),
|
|
3390
|
+
usage: z18.object({
|
|
3391
|
+
input_tokens: z18.number(),
|
|
3392
|
+
input_tokens_details: z18.object({ cached_tokens: z18.number().nullish() }).nullish(),
|
|
3393
|
+
output_tokens: z18.number(),
|
|
3394
|
+
output_tokens_details: z18.object({ reasoning_tokens: z18.number().nullish() }).nullish()
|
|
3309
3395
|
}),
|
|
3310
|
-
service_tier:
|
|
3396
|
+
service_tier: z18.string().nullish()
|
|
3311
3397
|
})
|
|
3312
3398
|
}),
|
|
3313
|
-
|
|
3314
|
-
type:
|
|
3315
|
-
response:
|
|
3316
|
-
error:
|
|
3317
|
-
code:
|
|
3318
|
-
message:
|
|
3399
|
+
z18.object({
|
|
3400
|
+
type: z18.literal("response.failed"),
|
|
3401
|
+
response: z18.object({
|
|
3402
|
+
error: z18.object({
|
|
3403
|
+
code: z18.string().nullish(),
|
|
3404
|
+
message: z18.string()
|
|
3319
3405
|
}).nullish(),
|
|
3320
|
-
incomplete_details:
|
|
3321
|
-
usage:
|
|
3322
|
-
input_tokens:
|
|
3323
|
-
input_tokens_details:
|
|
3324
|
-
output_tokens:
|
|
3325
|
-
output_tokens_details:
|
|
3406
|
+
incomplete_details: z18.object({ reason: z18.string() }).nullish(),
|
|
3407
|
+
usage: z18.object({
|
|
3408
|
+
input_tokens: z18.number(),
|
|
3409
|
+
input_tokens_details: z18.object({ cached_tokens: z18.number().nullish() }).nullish(),
|
|
3410
|
+
output_tokens: z18.number(),
|
|
3411
|
+
output_tokens_details: z18.object({ reasoning_tokens: z18.number().nullish() }).nullish()
|
|
3326
3412
|
}).nullish(),
|
|
3327
|
-
service_tier:
|
|
3413
|
+
service_tier: z18.string().nullish()
|
|
3328
3414
|
})
|
|
3329
3415
|
}),
|
|
3330
|
-
|
|
3331
|
-
type:
|
|
3332
|
-
response:
|
|
3333
|
-
id:
|
|
3334
|
-
created_at:
|
|
3335
|
-
model:
|
|
3336
|
-
service_tier:
|
|
3416
|
+
z18.object({
|
|
3417
|
+
type: z18.literal("response.created"),
|
|
3418
|
+
response: z18.object({
|
|
3419
|
+
id: z18.string(),
|
|
3420
|
+
created_at: z18.number(),
|
|
3421
|
+
model: z18.string(),
|
|
3422
|
+
service_tier: z18.string().nullish()
|
|
3337
3423
|
})
|
|
3338
3424
|
}),
|
|
3339
|
-
|
|
3340
|
-
type:
|
|
3341
|
-
output_index:
|
|
3342
|
-
item:
|
|
3343
|
-
|
|
3344
|
-
type:
|
|
3345
|
-
id:
|
|
3346
|
-
phase:
|
|
3425
|
+
z18.object({
|
|
3426
|
+
type: z18.literal("response.output_item.added"),
|
|
3427
|
+
output_index: z18.number(),
|
|
3428
|
+
item: z18.discriminatedUnion("type", [
|
|
3429
|
+
z18.object({
|
|
3430
|
+
type: z18.literal("message"),
|
|
3431
|
+
id: z18.string(),
|
|
3432
|
+
phase: z18.enum(["commentary", "final_answer"]).nullish()
|
|
3347
3433
|
}),
|
|
3348
|
-
|
|
3349
|
-
type:
|
|
3350
|
-
id:
|
|
3351
|
-
encrypted_content:
|
|
3434
|
+
z18.object({
|
|
3435
|
+
type: z18.literal("reasoning"),
|
|
3436
|
+
id: z18.string(),
|
|
3437
|
+
encrypted_content: z18.string().nullish()
|
|
3352
3438
|
}),
|
|
3353
|
-
|
|
3354
|
-
type:
|
|
3355
|
-
id:
|
|
3356
|
-
call_id:
|
|
3357
|
-
name:
|
|
3358
|
-
arguments:
|
|
3439
|
+
z18.object({
|
|
3440
|
+
type: z18.literal("function_call"),
|
|
3441
|
+
id: z18.string(),
|
|
3442
|
+
call_id: z18.string(),
|
|
3443
|
+
name: z18.string(),
|
|
3444
|
+
arguments: z18.string(),
|
|
3445
|
+
namespace: z18.string().nullish()
|
|
3359
3446
|
}),
|
|
3360
|
-
|
|
3361
|
-
type:
|
|
3362
|
-
id:
|
|
3363
|
-
status:
|
|
3447
|
+
z18.object({
|
|
3448
|
+
type: z18.literal("web_search_call"),
|
|
3449
|
+
id: z18.string(),
|
|
3450
|
+
status: z18.string()
|
|
3364
3451
|
}),
|
|
3365
|
-
|
|
3366
|
-
type:
|
|
3367
|
-
id:
|
|
3368
|
-
status:
|
|
3452
|
+
z18.object({
|
|
3453
|
+
type: z18.literal("computer_call"),
|
|
3454
|
+
id: z18.string(),
|
|
3455
|
+
status: z18.string()
|
|
3369
3456
|
}),
|
|
3370
|
-
|
|
3371
|
-
type:
|
|
3372
|
-
id:
|
|
3457
|
+
z18.object({
|
|
3458
|
+
type: z18.literal("file_search_call"),
|
|
3459
|
+
id: z18.string()
|
|
3373
3460
|
}),
|
|
3374
|
-
|
|
3375
|
-
type:
|
|
3376
|
-
id:
|
|
3461
|
+
z18.object({
|
|
3462
|
+
type: z18.literal("image_generation_call"),
|
|
3463
|
+
id: z18.string()
|
|
3377
3464
|
}),
|
|
3378
|
-
|
|
3379
|
-
type:
|
|
3380
|
-
id:
|
|
3381
|
-
container_id:
|
|
3382
|
-
code:
|
|
3383
|
-
outputs:
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3465
|
+
z18.object({
|
|
3466
|
+
type: z18.literal("code_interpreter_call"),
|
|
3467
|
+
id: z18.string(),
|
|
3468
|
+
container_id: z18.string(),
|
|
3469
|
+
code: z18.string().nullable(),
|
|
3470
|
+
outputs: z18.array(
|
|
3471
|
+
z18.discriminatedUnion("type", [
|
|
3472
|
+
z18.object({ type: z18.literal("logs"), logs: z18.string() }),
|
|
3473
|
+
z18.object({ type: z18.literal("image"), url: z18.string() })
|
|
3387
3474
|
])
|
|
3388
3475
|
).nullable(),
|
|
3389
|
-
status:
|
|
3476
|
+
status: z18.string()
|
|
3390
3477
|
}),
|
|
3391
|
-
|
|
3392
|
-
type:
|
|
3393
|
-
id:
|
|
3394
|
-
status:
|
|
3395
|
-
approval_request_id:
|
|
3478
|
+
z18.object({
|
|
3479
|
+
type: z18.literal("mcp_call"),
|
|
3480
|
+
id: z18.string(),
|
|
3481
|
+
status: z18.string(),
|
|
3482
|
+
approval_request_id: z18.string().nullish()
|
|
3396
3483
|
}),
|
|
3397
|
-
|
|
3398
|
-
type:
|
|
3399
|
-
id:
|
|
3484
|
+
z18.object({
|
|
3485
|
+
type: z18.literal("mcp_list_tools"),
|
|
3486
|
+
id: z18.string()
|
|
3400
3487
|
}),
|
|
3401
|
-
|
|
3402
|
-
type:
|
|
3403
|
-
id:
|
|
3488
|
+
z18.object({
|
|
3489
|
+
type: z18.literal("mcp_approval_request"),
|
|
3490
|
+
id: z18.string()
|
|
3404
3491
|
}),
|
|
3405
|
-
|
|
3406
|
-
type:
|
|
3407
|
-
id:
|
|
3408
|
-
call_id:
|
|
3409
|
-
status:
|
|
3410
|
-
operation:
|
|
3411
|
-
|
|
3412
|
-
type:
|
|
3413
|
-
path:
|
|
3414
|
-
diff:
|
|
3492
|
+
z18.object({
|
|
3493
|
+
type: z18.literal("apply_patch_call"),
|
|
3494
|
+
id: z18.string(),
|
|
3495
|
+
call_id: z18.string(),
|
|
3496
|
+
status: z18.enum(["in_progress", "completed"]),
|
|
3497
|
+
operation: z18.discriminatedUnion("type", [
|
|
3498
|
+
z18.object({
|
|
3499
|
+
type: z18.literal("create_file"),
|
|
3500
|
+
path: z18.string(),
|
|
3501
|
+
diff: z18.string()
|
|
3415
3502
|
}),
|
|
3416
|
-
|
|
3417
|
-
type:
|
|
3418
|
-
path:
|
|
3503
|
+
z18.object({
|
|
3504
|
+
type: z18.literal("delete_file"),
|
|
3505
|
+
path: z18.string()
|
|
3419
3506
|
}),
|
|
3420
|
-
|
|
3421
|
-
type:
|
|
3422
|
-
path:
|
|
3423
|
-
diff:
|
|
3507
|
+
z18.object({
|
|
3508
|
+
type: z18.literal("update_file"),
|
|
3509
|
+
path: z18.string(),
|
|
3510
|
+
diff: z18.string()
|
|
3424
3511
|
})
|
|
3425
3512
|
])
|
|
3426
3513
|
}),
|
|
3427
|
-
|
|
3428
|
-
type:
|
|
3429
|
-
id:
|
|
3430
|
-
call_id:
|
|
3431
|
-
name:
|
|
3432
|
-
input:
|
|
3514
|
+
z18.object({
|
|
3515
|
+
type: z18.literal("custom_tool_call"),
|
|
3516
|
+
id: z18.string(),
|
|
3517
|
+
call_id: z18.string(),
|
|
3518
|
+
name: z18.string(),
|
|
3519
|
+
input: z18.string()
|
|
3433
3520
|
}),
|
|
3434
|
-
|
|
3435
|
-
type:
|
|
3436
|
-
id:
|
|
3437
|
-
call_id:
|
|
3438
|
-
status:
|
|
3439
|
-
action:
|
|
3440
|
-
commands:
|
|
3521
|
+
z18.object({
|
|
3522
|
+
type: z18.literal("shell_call"),
|
|
3523
|
+
id: z18.string(),
|
|
3524
|
+
call_id: z18.string(),
|
|
3525
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
3526
|
+
action: z18.object({
|
|
3527
|
+
commands: z18.array(z18.string())
|
|
3441
3528
|
})
|
|
3442
3529
|
}),
|
|
3443
|
-
|
|
3444
|
-
type:
|
|
3445
|
-
id:
|
|
3446
|
-
call_id:
|
|
3447
|
-
status:
|
|
3448
|
-
output:
|
|
3449
|
-
|
|
3450
|
-
stdout:
|
|
3451
|
-
stderr:
|
|
3452
|
-
outcome:
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
type:
|
|
3456
|
-
exit_code:
|
|
3530
|
+
z18.object({
|
|
3531
|
+
type: z18.literal("shell_call_output"),
|
|
3532
|
+
id: z18.string(),
|
|
3533
|
+
call_id: z18.string(),
|
|
3534
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
3535
|
+
output: z18.array(
|
|
3536
|
+
z18.object({
|
|
3537
|
+
stdout: z18.string(),
|
|
3538
|
+
stderr: z18.string(),
|
|
3539
|
+
outcome: z18.discriminatedUnion("type", [
|
|
3540
|
+
z18.object({ type: z18.literal("timeout") }),
|
|
3541
|
+
z18.object({
|
|
3542
|
+
type: z18.literal("exit"),
|
|
3543
|
+
exit_code: z18.number()
|
|
3457
3544
|
})
|
|
3458
3545
|
])
|
|
3459
3546
|
})
|
|
3460
3547
|
)
|
|
3461
3548
|
}),
|
|
3462
|
-
|
|
3463
|
-
type:
|
|
3464
|
-
id:
|
|
3465
|
-
execution:
|
|
3466
|
-
call_id:
|
|
3467
|
-
status:
|
|
3468
|
-
arguments:
|
|
3549
|
+
z18.object({
|
|
3550
|
+
type: z18.literal("tool_search_call"),
|
|
3551
|
+
id: z18.string(),
|
|
3552
|
+
execution: z18.enum(["server", "client"]),
|
|
3553
|
+
call_id: z18.string().nullable(),
|
|
3554
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
3555
|
+
arguments: z18.unknown()
|
|
3469
3556
|
}),
|
|
3470
|
-
|
|
3471
|
-
type:
|
|
3472
|
-
id:
|
|
3473
|
-
execution:
|
|
3474
|
-
call_id:
|
|
3475
|
-
status:
|
|
3476
|
-
tools:
|
|
3557
|
+
z18.object({
|
|
3558
|
+
type: z18.literal("tool_search_output"),
|
|
3559
|
+
id: z18.string(),
|
|
3560
|
+
execution: z18.enum(["server", "client"]),
|
|
3561
|
+
call_id: z18.string().nullable(),
|
|
3562
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
3563
|
+
tools: z18.array(z18.record(z18.string(), jsonValueSchema.optional()))
|
|
3477
3564
|
})
|
|
3478
3565
|
])
|
|
3479
3566
|
}),
|
|
3480
|
-
|
|
3481
|
-
type:
|
|
3482
|
-
output_index:
|
|
3483
|
-
item:
|
|
3484
|
-
|
|
3485
|
-
type:
|
|
3486
|
-
id:
|
|
3487
|
-
phase:
|
|
3567
|
+
z18.object({
|
|
3568
|
+
type: z18.literal("response.output_item.done"),
|
|
3569
|
+
output_index: z18.number(),
|
|
3570
|
+
item: z18.discriminatedUnion("type", [
|
|
3571
|
+
z18.object({
|
|
3572
|
+
type: z18.literal("message"),
|
|
3573
|
+
id: z18.string(),
|
|
3574
|
+
phase: z18.enum(["commentary", "final_answer"]).nullish()
|
|
3488
3575
|
}),
|
|
3489
|
-
|
|
3490
|
-
type:
|
|
3491
|
-
id:
|
|
3492
|
-
encrypted_content:
|
|
3576
|
+
z18.object({
|
|
3577
|
+
type: z18.literal("reasoning"),
|
|
3578
|
+
id: z18.string(),
|
|
3579
|
+
encrypted_content: z18.string().nullish()
|
|
3493
3580
|
}),
|
|
3494
|
-
|
|
3495
|
-
type:
|
|
3496
|
-
id:
|
|
3497
|
-
call_id:
|
|
3498
|
-
name:
|
|
3499
|
-
arguments:
|
|
3500
|
-
status:
|
|
3581
|
+
z18.object({
|
|
3582
|
+
type: z18.literal("function_call"),
|
|
3583
|
+
id: z18.string(),
|
|
3584
|
+
call_id: z18.string(),
|
|
3585
|
+
name: z18.string(),
|
|
3586
|
+
arguments: z18.string(),
|
|
3587
|
+
status: z18.literal("completed"),
|
|
3588
|
+
namespace: z18.string().nullish()
|
|
3501
3589
|
}),
|
|
3502
|
-
|
|
3503
|
-
type:
|
|
3504
|
-
id:
|
|
3505
|
-
call_id:
|
|
3506
|
-
name:
|
|
3507
|
-
input:
|
|
3508
|
-
status:
|
|
3590
|
+
z18.object({
|
|
3591
|
+
type: z18.literal("custom_tool_call"),
|
|
3592
|
+
id: z18.string(),
|
|
3593
|
+
call_id: z18.string(),
|
|
3594
|
+
name: z18.string(),
|
|
3595
|
+
input: z18.string(),
|
|
3596
|
+
status: z18.literal("completed")
|
|
3509
3597
|
}),
|
|
3510
|
-
|
|
3511
|
-
type:
|
|
3512
|
-
id:
|
|
3513
|
-
code:
|
|
3514
|
-
container_id:
|
|
3515
|
-
outputs:
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3598
|
+
z18.object({
|
|
3599
|
+
type: z18.literal("code_interpreter_call"),
|
|
3600
|
+
id: z18.string(),
|
|
3601
|
+
code: z18.string().nullable(),
|
|
3602
|
+
container_id: z18.string(),
|
|
3603
|
+
outputs: z18.array(
|
|
3604
|
+
z18.discriminatedUnion("type", [
|
|
3605
|
+
z18.object({ type: z18.literal("logs"), logs: z18.string() }),
|
|
3606
|
+
z18.object({ type: z18.literal("image"), url: z18.string() })
|
|
3519
3607
|
])
|
|
3520
3608
|
).nullable()
|
|
3521
3609
|
}),
|
|
3522
|
-
|
|
3523
|
-
type:
|
|
3524
|
-
id:
|
|
3525
|
-
result:
|
|
3610
|
+
z18.object({
|
|
3611
|
+
type: z18.literal("image_generation_call"),
|
|
3612
|
+
id: z18.string(),
|
|
3613
|
+
result: z18.string()
|
|
3526
3614
|
}),
|
|
3527
|
-
|
|
3528
|
-
type:
|
|
3529
|
-
id:
|
|
3530
|
-
status:
|
|
3531
|
-
action:
|
|
3532
|
-
|
|
3533
|
-
type:
|
|
3534
|
-
query:
|
|
3535
|
-
sources:
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3615
|
+
z18.object({
|
|
3616
|
+
type: z18.literal("web_search_call"),
|
|
3617
|
+
id: z18.string(),
|
|
3618
|
+
status: z18.string(),
|
|
3619
|
+
action: z18.discriminatedUnion("type", [
|
|
3620
|
+
z18.object({
|
|
3621
|
+
type: z18.literal("search"),
|
|
3622
|
+
query: z18.string().nullish(),
|
|
3623
|
+
sources: z18.array(
|
|
3624
|
+
z18.discriminatedUnion("type", [
|
|
3625
|
+
z18.object({ type: z18.literal("url"), url: z18.string() }),
|
|
3626
|
+
z18.object({ type: z18.literal("api"), name: z18.string() })
|
|
3539
3627
|
])
|
|
3540
3628
|
).nullish()
|
|
3541
3629
|
}),
|
|
3542
|
-
|
|
3543
|
-
type:
|
|
3544
|
-
url:
|
|
3630
|
+
z18.object({
|
|
3631
|
+
type: z18.literal("open_page"),
|
|
3632
|
+
url: z18.string().nullish()
|
|
3545
3633
|
}),
|
|
3546
|
-
|
|
3547
|
-
type:
|
|
3548
|
-
url:
|
|
3549
|
-
pattern:
|
|
3634
|
+
z18.object({
|
|
3635
|
+
type: z18.literal("find_in_page"),
|
|
3636
|
+
url: z18.string().nullish(),
|
|
3637
|
+
pattern: z18.string().nullish()
|
|
3550
3638
|
})
|
|
3551
3639
|
]).nullish()
|
|
3552
3640
|
}),
|
|
3553
|
-
|
|
3554
|
-
type:
|
|
3555
|
-
id:
|
|
3556
|
-
queries:
|
|
3557
|
-
results:
|
|
3558
|
-
|
|
3559
|
-
attributes:
|
|
3560
|
-
|
|
3561
|
-
|
|
3641
|
+
z18.object({
|
|
3642
|
+
type: z18.literal("file_search_call"),
|
|
3643
|
+
id: z18.string(),
|
|
3644
|
+
queries: z18.array(z18.string()),
|
|
3645
|
+
results: z18.array(
|
|
3646
|
+
z18.object({
|
|
3647
|
+
attributes: z18.record(
|
|
3648
|
+
z18.string(),
|
|
3649
|
+
z18.union([z18.string(), z18.number(), z18.boolean()])
|
|
3562
3650
|
),
|
|
3563
|
-
file_id:
|
|
3564
|
-
filename:
|
|
3565
|
-
score:
|
|
3566
|
-
text:
|
|
3651
|
+
file_id: z18.string(),
|
|
3652
|
+
filename: z18.string(),
|
|
3653
|
+
score: z18.number(),
|
|
3654
|
+
text: z18.string()
|
|
3567
3655
|
})
|
|
3568
3656
|
).nullish()
|
|
3569
3657
|
}),
|
|
3570
|
-
|
|
3571
|
-
type:
|
|
3572
|
-
id:
|
|
3573
|
-
call_id:
|
|
3574
|
-
action:
|
|
3575
|
-
type:
|
|
3576
|
-
command:
|
|
3577
|
-
timeout_ms:
|
|
3578
|
-
user:
|
|
3579
|
-
working_directory:
|
|
3580
|
-
env:
|
|
3658
|
+
z18.object({
|
|
3659
|
+
type: z18.literal("local_shell_call"),
|
|
3660
|
+
id: z18.string(),
|
|
3661
|
+
call_id: z18.string(),
|
|
3662
|
+
action: z18.object({
|
|
3663
|
+
type: z18.literal("exec"),
|
|
3664
|
+
command: z18.array(z18.string()),
|
|
3665
|
+
timeout_ms: z18.number().optional(),
|
|
3666
|
+
user: z18.string().optional(),
|
|
3667
|
+
working_directory: z18.string().optional(),
|
|
3668
|
+
env: z18.record(z18.string(), z18.string()).optional()
|
|
3581
3669
|
})
|
|
3582
3670
|
}),
|
|
3583
|
-
|
|
3584
|
-
type:
|
|
3585
|
-
id:
|
|
3586
|
-
status:
|
|
3671
|
+
z18.object({
|
|
3672
|
+
type: z18.literal("computer_call"),
|
|
3673
|
+
id: z18.string(),
|
|
3674
|
+
status: z18.literal("completed")
|
|
3587
3675
|
}),
|
|
3588
|
-
|
|
3589
|
-
type:
|
|
3590
|
-
id:
|
|
3591
|
-
status:
|
|
3592
|
-
arguments:
|
|
3593
|
-
name:
|
|
3594
|
-
server_label:
|
|
3595
|
-
output:
|
|
3596
|
-
error:
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
type:
|
|
3600
|
-
code:
|
|
3601
|
-
message:
|
|
3676
|
+
z18.object({
|
|
3677
|
+
type: z18.literal("mcp_call"),
|
|
3678
|
+
id: z18.string(),
|
|
3679
|
+
status: z18.string(),
|
|
3680
|
+
arguments: z18.string(),
|
|
3681
|
+
name: z18.string(),
|
|
3682
|
+
server_label: z18.string(),
|
|
3683
|
+
output: z18.string().nullish(),
|
|
3684
|
+
error: z18.union([
|
|
3685
|
+
z18.string(),
|
|
3686
|
+
z18.object({
|
|
3687
|
+
type: z18.string().optional(),
|
|
3688
|
+
code: z18.union([z18.number(), z18.string()]).optional(),
|
|
3689
|
+
message: z18.string().optional()
|
|
3602
3690
|
}).loose()
|
|
3603
3691
|
]).nullish(),
|
|
3604
|
-
approval_request_id:
|
|
3692
|
+
approval_request_id: z18.string().nullish()
|
|
3605
3693
|
}),
|
|
3606
|
-
|
|
3607
|
-
type:
|
|
3608
|
-
id:
|
|
3609
|
-
server_label:
|
|
3610
|
-
tools:
|
|
3611
|
-
|
|
3612
|
-
name:
|
|
3613
|
-
description:
|
|
3614
|
-
input_schema:
|
|
3615
|
-
annotations:
|
|
3694
|
+
z18.object({
|
|
3695
|
+
type: z18.literal("mcp_list_tools"),
|
|
3696
|
+
id: z18.string(),
|
|
3697
|
+
server_label: z18.string(),
|
|
3698
|
+
tools: z18.array(
|
|
3699
|
+
z18.object({
|
|
3700
|
+
name: z18.string(),
|
|
3701
|
+
description: z18.string().optional(),
|
|
3702
|
+
input_schema: z18.any(),
|
|
3703
|
+
annotations: z18.record(z18.string(), z18.unknown()).optional()
|
|
3616
3704
|
})
|
|
3617
3705
|
),
|
|
3618
|
-
error:
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
type:
|
|
3622
|
-
code:
|
|
3623
|
-
message:
|
|
3706
|
+
error: z18.union([
|
|
3707
|
+
z18.string(),
|
|
3708
|
+
z18.object({
|
|
3709
|
+
type: z18.string().optional(),
|
|
3710
|
+
code: z18.union([z18.number(), z18.string()]).optional(),
|
|
3711
|
+
message: z18.string().optional()
|
|
3624
3712
|
}).loose()
|
|
3625
3713
|
]).optional()
|
|
3626
3714
|
}),
|
|
3627
|
-
|
|
3628
|
-
type:
|
|
3629
|
-
id:
|
|
3630
|
-
server_label:
|
|
3631
|
-
name:
|
|
3632
|
-
arguments:
|
|
3633
|
-
approval_request_id:
|
|
3715
|
+
z18.object({
|
|
3716
|
+
type: z18.literal("mcp_approval_request"),
|
|
3717
|
+
id: z18.string(),
|
|
3718
|
+
server_label: z18.string(),
|
|
3719
|
+
name: z18.string(),
|
|
3720
|
+
arguments: z18.string(),
|
|
3721
|
+
approval_request_id: z18.string().optional()
|
|
3634
3722
|
}),
|
|
3635
|
-
|
|
3636
|
-
type:
|
|
3637
|
-
id:
|
|
3638
|
-
call_id:
|
|
3639
|
-
status:
|
|
3640
|
-
operation:
|
|
3641
|
-
|
|
3642
|
-
type:
|
|
3643
|
-
path:
|
|
3644
|
-
diff:
|
|
3723
|
+
z18.object({
|
|
3724
|
+
type: z18.literal("apply_patch_call"),
|
|
3725
|
+
id: z18.string(),
|
|
3726
|
+
call_id: z18.string(),
|
|
3727
|
+
status: z18.enum(["in_progress", "completed"]),
|
|
3728
|
+
operation: z18.discriminatedUnion("type", [
|
|
3729
|
+
z18.object({
|
|
3730
|
+
type: z18.literal("create_file"),
|
|
3731
|
+
path: z18.string(),
|
|
3732
|
+
diff: z18.string()
|
|
3645
3733
|
}),
|
|
3646
|
-
|
|
3647
|
-
type:
|
|
3648
|
-
path:
|
|
3734
|
+
z18.object({
|
|
3735
|
+
type: z18.literal("delete_file"),
|
|
3736
|
+
path: z18.string()
|
|
3649
3737
|
}),
|
|
3650
|
-
|
|
3651
|
-
type:
|
|
3652
|
-
path:
|
|
3653
|
-
diff:
|
|
3738
|
+
z18.object({
|
|
3739
|
+
type: z18.literal("update_file"),
|
|
3740
|
+
path: z18.string(),
|
|
3741
|
+
diff: z18.string()
|
|
3654
3742
|
})
|
|
3655
3743
|
])
|
|
3656
3744
|
}),
|
|
3657
|
-
|
|
3658
|
-
type:
|
|
3659
|
-
id:
|
|
3660
|
-
call_id:
|
|
3661
|
-
status:
|
|
3662
|
-
action:
|
|
3663
|
-
commands:
|
|
3745
|
+
z18.object({
|
|
3746
|
+
type: z18.literal("shell_call"),
|
|
3747
|
+
id: z18.string(),
|
|
3748
|
+
call_id: z18.string(),
|
|
3749
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
3750
|
+
action: z18.object({
|
|
3751
|
+
commands: z18.array(z18.string())
|
|
3664
3752
|
})
|
|
3665
3753
|
}),
|
|
3666
|
-
|
|
3667
|
-
type:
|
|
3668
|
-
id:
|
|
3669
|
-
call_id:
|
|
3670
|
-
status:
|
|
3671
|
-
output:
|
|
3672
|
-
|
|
3673
|
-
stdout:
|
|
3674
|
-
stderr:
|
|
3675
|
-
outcome:
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
type:
|
|
3679
|
-
exit_code:
|
|
3754
|
+
z18.object({
|
|
3755
|
+
type: z18.literal("shell_call_output"),
|
|
3756
|
+
id: z18.string(),
|
|
3757
|
+
call_id: z18.string(),
|
|
3758
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
3759
|
+
output: z18.array(
|
|
3760
|
+
z18.object({
|
|
3761
|
+
stdout: z18.string(),
|
|
3762
|
+
stderr: z18.string(),
|
|
3763
|
+
outcome: z18.discriminatedUnion("type", [
|
|
3764
|
+
z18.object({ type: z18.literal("timeout") }),
|
|
3765
|
+
z18.object({
|
|
3766
|
+
type: z18.literal("exit"),
|
|
3767
|
+
exit_code: z18.number()
|
|
3680
3768
|
})
|
|
3681
3769
|
])
|
|
3682
3770
|
})
|
|
3683
3771
|
)
|
|
3684
3772
|
}),
|
|
3685
|
-
|
|
3686
|
-
type:
|
|
3687
|
-
id:
|
|
3688
|
-
execution:
|
|
3689
|
-
call_id:
|
|
3690
|
-
status:
|
|
3691
|
-
arguments:
|
|
3773
|
+
z18.object({
|
|
3774
|
+
type: z18.literal("tool_search_call"),
|
|
3775
|
+
id: z18.string(),
|
|
3776
|
+
execution: z18.enum(["server", "client"]),
|
|
3777
|
+
call_id: z18.string().nullable(),
|
|
3778
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
3779
|
+
arguments: z18.unknown()
|
|
3692
3780
|
}),
|
|
3693
|
-
|
|
3694
|
-
type:
|
|
3695
|
-
id:
|
|
3696
|
-
execution:
|
|
3697
|
-
call_id:
|
|
3698
|
-
status:
|
|
3699
|
-
tools:
|
|
3781
|
+
z18.object({
|
|
3782
|
+
type: z18.literal("tool_search_output"),
|
|
3783
|
+
id: z18.string(),
|
|
3784
|
+
execution: z18.enum(["server", "client"]),
|
|
3785
|
+
call_id: z18.string().nullable(),
|
|
3786
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
3787
|
+
tools: z18.array(z18.record(z18.string(), jsonValueSchema.optional()))
|
|
3700
3788
|
})
|
|
3701
3789
|
])
|
|
3702
3790
|
}),
|
|
3703
|
-
|
|
3704
|
-
type:
|
|
3705
|
-
item_id:
|
|
3706
|
-
output_index:
|
|
3707
|
-
delta:
|
|
3791
|
+
z18.object({
|
|
3792
|
+
type: z18.literal("response.function_call_arguments.delta"),
|
|
3793
|
+
item_id: z18.string(),
|
|
3794
|
+
output_index: z18.number(),
|
|
3795
|
+
delta: z18.string()
|
|
3708
3796
|
}),
|
|
3709
|
-
|
|
3710
|
-
type:
|
|
3711
|
-
item_id:
|
|
3712
|
-
output_index:
|
|
3713
|
-
delta:
|
|
3797
|
+
z18.object({
|
|
3798
|
+
type: z18.literal("response.custom_tool_call_input.delta"),
|
|
3799
|
+
item_id: z18.string(),
|
|
3800
|
+
output_index: z18.number(),
|
|
3801
|
+
delta: z18.string()
|
|
3714
3802
|
}),
|
|
3715
|
-
|
|
3716
|
-
type:
|
|
3717
|
-
item_id:
|
|
3718
|
-
output_index:
|
|
3719
|
-
partial_image_b64:
|
|
3803
|
+
z18.object({
|
|
3804
|
+
type: z18.literal("response.image_generation_call.partial_image"),
|
|
3805
|
+
item_id: z18.string(),
|
|
3806
|
+
output_index: z18.number(),
|
|
3807
|
+
partial_image_b64: z18.string()
|
|
3720
3808
|
}),
|
|
3721
|
-
|
|
3722
|
-
type:
|
|
3723
|
-
item_id:
|
|
3724
|
-
output_index:
|
|
3725
|
-
delta:
|
|
3809
|
+
z18.object({
|
|
3810
|
+
type: z18.literal("response.code_interpreter_call_code.delta"),
|
|
3811
|
+
item_id: z18.string(),
|
|
3812
|
+
output_index: z18.number(),
|
|
3813
|
+
delta: z18.string()
|
|
3726
3814
|
}),
|
|
3727
|
-
|
|
3728
|
-
type:
|
|
3729
|
-
item_id:
|
|
3730
|
-
output_index:
|
|
3731
|
-
code:
|
|
3815
|
+
z18.object({
|
|
3816
|
+
type: z18.literal("response.code_interpreter_call_code.done"),
|
|
3817
|
+
item_id: z18.string(),
|
|
3818
|
+
output_index: z18.number(),
|
|
3819
|
+
code: z18.string()
|
|
3732
3820
|
}),
|
|
3733
|
-
|
|
3734
|
-
type:
|
|
3735
|
-
annotation:
|
|
3736
|
-
|
|
3737
|
-
type:
|
|
3738
|
-
start_index:
|
|
3739
|
-
end_index:
|
|
3740
|
-
url:
|
|
3741
|
-
title:
|
|
3821
|
+
z18.object({
|
|
3822
|
+
type: z18.literal("response.output_text.annotation.added"),
|
|
3823
|
+
annotation: z18.discriminatedUnion("type", [
|
|
3824
|
+
z18.object({
|
|
3825
|
+
type: z18.literal("url_citation"),
|
|
3826
|
+
start_index: z18.number(),
|
|
3827
|
+
end_index: z18.number(),
|
|
3828
|
+
url: z18.string(),
|
|
3829
|
+
title: z18.string()
|
|
3742
3830
|
}),
|
|
3743
|
-
|
|
3744
|
-
type:
|
|
3745
|
-
file_id:
|
|
3746
|
-
filename:
|
|
3747
|
-
index:
|
|
3831
|
+
z18.object({
|
|
3832
|
+
type: z18.literal("file_citation"),
|
|
3833
|
+
file_id: z18.string(),
|
|
3834
|
+
filename: z18.string(),
|
|
3835
|
+
index: z18.number()
|
|
3748
3836
|
}),
|
|
3749
|
-
|
|
3750
|
-
type:
|
|
3751
|
-
container_id:
|
|
3752
|
-
file_id:
|
|
3753
|
-
filename:
|
|
3754
|
-
start_index:
|
|
3755
|
-
end_index:
|
|
3837
|
+
z18.object({
|
|
3838
|
+
type: z18.literal("container_file_citation"),
|
|
3839
|
+
container_id: z18.string(),
|
|
3840
|
+
file_id: z18.string(),
|
|
3841
|
+
filename: z18.string(),
|
|
3842
|
+
start_index: z18.number(),
|
|
3843
|
+
end_index: z18.number()
|
|
3756
3844
|
}),
|
|
3757
|
-
|
|
3758
|
-
type:
|
|
3759
|
-
file_id:
|
|
3760
|
-
index:
|
|
3845
|
+
z18.object({
|
|
3846
|
+
type: z18.literal("file_path"),
|
|
3847
|
+
file_id: z18.string(),
|
|
3848
|
+
index: z18.number()
|
|
3761
3849
|
})
|
|
3762
3850
|
])
|
|
3763
3851
|
}),
|
|
3764
|
-
|
|
3765
|
-
type:
|
|
3766
|
-
item_id:
|
|
3767
|
-
summary_index:
|
|
3852
|
+
z18.object({
|
|
3853
|
+
type: z18.literal("response.reasoning_summary_part.added"),
|
|
3854
|
+
item_id: z18.string(),
|
|
3855
|
+
summary_index: z18.number()
|
|
3768
3856
|
}),
|
|
3769
|
-
|
|
3770
|
-
type:
|
|
3771
|
-
item_id:
|
|
3772
|
-
summary_index:
|
|
3773
|
-
delta:
|
|
3857
|
+
z18.object({
|
|
3858
|
+
type: z18.literal("response.reasoning_summary_text.delta"),
|
|
3859
|
+
item_id: z18.string(),
|
|
3860
|
+
summary_index: z18.number(),
|
|
3861
|
+
delta: z18.string()
|
|
3774
3862
|
}),
|
|
3775
|
-
|
|
3776
|
-
type:
|
|
3777
|
-
item_id:
|
|
3778
|
-
summary_index:
|
|
3863
|
+
z18.object({
|
|
3864
|
+
type: z18.literal("response.reasoning_summary_part.done"),
|
|
3865
|
+
item_id: z18.string(),
|
|
3866
|
+
summary_index: z18.number()
|
|
3779
3867
|
}),
|
|
3780
|
-
|
|
3781
|
-
type:
|
|
3782
|
-
item_id:
|
|
3783
|
-
output_index:
|
|
3784
|
-
delta:
|
|
3785
|
-
obfuscation:
|
|
3868
|
+
z18.object({
|
|
3869
|
+
type: z18.literal("response.apply_patch_call_operation_diff.delta"),
|
|
3870
|
+
item_id: z18.string(),
|
|
3871
|
+
output_index: z18.number(),
|
|
3872
|
+
delta: z18.string(),
|
|
3873
|
+
obfuscation: z18.string().nullish()
|
|
3786
3874
|
}),
|
|
3787
|
-
|
|
3788
|
-
type:
|
|
3789
|
-
item_id:
|
|
3790
|
-
output_index:
|
|
3791
|
-
diff:
|
|
3875
|
+
z18.object({
|
|
3876
|
+
type: z18.literal("response.apply_patch_call_operation_diff.done"),
|
|
3877
|
+
item_id: z18.string(),
|
|
3878
|
+
output_index: z18.number(),
|
|
3879
|
+
diff: z18.string()
|
|
3792
3880
|
}),
|
|
3793
|
-
|
|
3794
|
-
type:
|
|
3795
|
-
sequence_number:
|
|
3796
|
-
error:
|
|
3797
|
-
type:
|
|
3798
|
-
code:
|
|
3799
|
-
message:
|
|
3800
|
-
param:
|
|
3881
|
+
z18.object({
|
|
3882
|
+
type: z18.literal("error"),
|
|
3883
|
+
sequence_number: z18.number(),
|
|
3884
|
+
error: z18.object({
|
|
3885
|
+
type: z18.string(),
|
|
3886
|
+
code: z18.string(),
|
|
3887
|
+
message: z18.string(),
|
|
3888
|
+
param: z18.string().nullish()
|
|
3801
3889
|
})
|
|
3802
3890
|
}),
|
|
3803
|
-
|
|
3891
|
+
z18.object({ type: z18.string() }).loose().transform((value) => ({
|
|
3804
3892
|
type: "unknown_chunk",
|
|
3805
3893
|
message: value.type
|
|
3806
3894
|
}))
|
|
@@ -3808,302 +3896,303 @@ var openaiResponsesChunkSchema = lazySchema15(
|
|
|
3808
3896
|
])
|
|
3809
3897
|
)
|
|
3810
3898
|
);
|
|
3811
|
-
var openaiResponsesResponseSchema =
|
|
3812
|
-
() =>
|
|
3813
|
-
|
|
3814
|
-
id:
|
|
3815
|
-
created_at:
|
|
3816
|
-
error:
|
|
3817
|
-
message:
|
|
3818
|
-
type:
|
|
3819
|
-
param:
|
|
3820
|
-
code:
|
|
3899
|
+
var openaiResponsesResponseSchema = lazySchema16(
|
|
3900
|
+
() => zodSchema16(
|
|
3901
|
+
z18.object({
|
|
3902
|
+
id: z18.string().optional(),
|
|
3903
|
+
created_at: z18.number().optional(),
|
|
3904
|
+
error: z18.object({
|
|
3905
|
+
message: z18.string(),
|
|
3906
|
+
type: z18.string(),
|
|
3907
|
+
param: z18.string().nullish(),
|
|
3908
|
+
code: z18.string()
|
|
3821
3909
|
}).nullish(),
|
|
3822
|
-
model:
|
|
3823
|
-
output:
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
type:
|
|
3827
|
-
role:
|
|
3828
|
-
id:
|
|
3829
|
-
phase:
|
|
3830
|
-
content:
|
|
3831
|
-
|
|
3832
|
-
type:
|
|
3833
|
-
text:
|
|
3834
|
-
logprobs:
|
|
3835
|
-
|
|
3836
|
-
token:
|
|
3837
|
-
logprob:
|
|
3838
|
-
top_logprobs:
|
|
3839
|
-
|
|
3840
|
-
token:
|
|
3841
|
-
logprob:
|
|
3910
|
+
model: z18.string().optional(),
|
|
3911
|
+
output: z18.array(
|
|
3912
|
+
z18.discriminatedUnion("type", [
|
|
3913
|
+
z18.object({
|
|
3914
|
+
type: z18.literal("message"),
|
|
3915
|
+
role: z18.literal("assistant"),
|
|
3916
|
+
id: z18.string(),
|
|
3917
|
+
phase: z18.enum(["commentary", "final_answer"]).nullish(),
|
|
3918
|
+
content: z18.array(
|
|
3919
|
+
z18.object({
|
|
3920
|
+
type: z18.literal("output_text"),
|
|
3921
|
+
text: z18.string(),
|
|
3922
|
+
logprobs: z18.array(
|
|
3923
|
+
z18.object({
|
|
3924
|
+
token: z18.string(),
|
|
3925
|
+
logprob: z18.number(),
|
|
3926
|
+
top_logprobs: z18.array(
|
|
3927
|
+
z18.object({
|
|
3928
|
+
token: z18.string(),
|
|
3929
|
+
logprob: z18.number()
|
|
3842
3930
|
})
|
|
3843
3931
|
)
|
|
3844
3932
|
})
|
|
3845
3933
|
).nullish(),
|
|
3846
|
-
annotations:
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
type:
|
|
3850
|
-
start_index:
|
|
3851
|
-
end_index:
|
|
3852
|
-
url:
|
|
3853
|
-
title:
|
|
3934
|
+
annotations: z18.array(
|
|
3935
|
+
z18.discriminatedUnion("type", [
|
|
3936
|
+
z18.object({
|
|
3937
|
+
type: z18.literal("url_citation"),
|
|
3938
|
+
start_index: z18.number(),
|
|
3939
|
+
end_index: z18.number(),
|
|
3940
|
+
url: z18.string(),
|
|
3941
|
+
title: z18.string()
|
|
3854
3942
|
}),
|
|
3855
|
-
|
|
3856
|
-
type:
|
|
3857
|
-
file_id:
|
|
3858
|
-
filename:
|
|
3859
|
-
index:
|
|
3943
|
+
z18.object({
|
|
3944
|
+
type: z18.literal("file_citation"),
|
|
3945
|
+
file_id: z18.string(),
|
|
3946
|
+
filename: z18.string(),
|
|
3947
|
+
index: z18.number()
|
|
3860
3948
|
}),
|
|
3861
|
-
|
|
3862
|
-
type:
|
|
3863
|
-
container_id:
|
|
3864
|
-
file_id:
|
|
3865
|
-
filename:
|
|
3866
|
-
start_index:
|
|
3867
|
-
end_index:
|
|
3949
|
+
z18.object({
|
|
3950
|
+
type: z18.literal("container_file_citation"),
|
|
3951
|
+
container_id: z18.string(),
|
|
3952
|
+
file_id: z18.string(),
|
|
3953
|
+
filename: z18.string(),
|
|
3954
|
+
start_index: z18.number(),
|
|
3955
|
+
end_index: z18.number()
|
|
3868
3956
|
}),
|
|
3869
|
-
|
|
3870
|
-
type:
|
|
3871
|
-
file_id:
|
|
3872
|
-
index:
|
|
3957
|
+
z18.object({
|
|
3958
|
+
type: z18.literal("file_path"),
|
|
3959
|
+
file_id: z18.string(),
|
|
3960
|
+
index: z18.number()
|
|
3873
3961
|
})
|
|
3874
3962
|
])
|
|
3875
3963
|
)
|
|
3876
3964
|
})
|
|
3877
3965
|
)
|
|
3878
3966
|
}),
|
|
3879
|
-
|
|
3880
|
-
type:
|
|
3881
|
-
id:
|
|
3882
|
-
status:
|
|
3883
|
-
action:
|
|
3884
|
-
|
|
3885
|
-
type:
|
|
3886
|
-
query:
|
|
3887
|
-
sources:
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
type:
|
|
3892
|
-
name:
|
|
3967
|
+
z18.object({
|
|
3968
|
+
type: z18.literal("web_search_call"),
|
|
3969
|
+
id: z18.string(),
|
|
3970
|
+
status: z18.string(),
|
|
3971
|
+
action: z18.discriminatedUnion("type", [
|
|
3972
|
+
z18.object({
|
|
3973
|
+
type: z18.literal("search"),
|
|
3974
|
+
query: z18.string().nullish(),
|
|
3975
|
+
sources: z18.array(
|
|
3976
|
+
z18.discriminatedUnion("type", [
|
|
3977
|
+
z18.object({ type: z18.literal("url"), url: z18.string() }),
|
|
3978
|
+
z18.object({
|
|
3979
|
+
type: z18.literal("api"),
|
|
3980
|
+
name: z18.string()
|
|
3893
3981
|
})
|
|
3894
3982
|
])
|
|
3895
3983
|
).nullish()
|
|
3896
3984
|
}),
|
|
3897
|
-
|
|
3898
|
-
type:
|
|
3899
|
-
url:
|
|
3985
|
+
z18.object({
|
|
3986
|
+
type: z18.literal("open_page"),
|
|
3987
|
+
url: z18.string().nullish()
|
|
3900
3988
|
}),
|
|
3901
|
-
|
|
3902
|
-
type:
|
|
3903
|
-
url:
|
|
3904
|
-
pattern:
|
|
3989
|
+
z18.object({
|
|
3990
|
+
type: z18.literal("find_in_page"),
|
|
3991
|
+
url: z18.string().nullish(),
|
|
3992
|
+
pattern: z18.string().nullish()
|
|
3905
3993
|
})
|
|
3906
3994
|
]).nullish()
|
|
3907
3995
|
}),
|
|
3908
|
-
|
|
3909
|
-
type:
|
|
3910
|
-
id:
|
|
3911
|
-
queries:
|
|
3912
|
-
results:
|
|
3913
|
-
|
|
3914
|
-
attributes:
|
|
3915
|
-
|
|
3916
|
-
|
|
3996
|
+
z18.object({
|
|
3997
|
+
type: z18.literal("file_search_call"),
|
|
3998
|
+
id: z18.string(),
|
|
3999
|
+
queries: z18.array(z18.string()),
|
|
4000
|
+
results: z18.array(
|
|
4001
|
+
z18.object({
|
|
4002
|
+
attributes: z18.record(
|
|
4003
|
+
z18.string(),
|
|
4004
|
+
z18.union([z18.string(), z18.number(), z18.boolean()])
|
|
3917
4005
|
),
|
|
3918
|
-
file_id:
|
|
3919
|
-
filename:
|
|
3920
|
-
score:
|
|
3921
|
-
text:
|
|
4006
|
+
file_id: z18.string(),
|
|
4007
|
+
filename: z18.string(),
|
|
4008
|
+
score: z18.number(),
|
|
4009
|
+
text: z18.string()
|
|
3922
4010
|
})
|
|
3923
4011
|
).nullish()
|
|
3924
4012
|
}),
|
|
3925
|
-
|
|
3926
|
-
type:
|
|
3927
|
-
id:
|
|
3928
|
-
code:
|
|
3929
|
-
container_id:
|
|
3930
|
-
outputs:
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
4013
|
+
z18.object({
|
|
4014
|
+
type: z18.literal("code_interpreter_call"),
|
|
4015
|
+
id: z18.string(),
|
|
4016
|
+
code: z18.string().nullable(),
|
|
4017
|
+
container_id: z18.string(),
|
|
4018
|
+
outputs: z18.array(
|
|
4019
|
+
z18.discriminatedUnion("type", [
|
|
4020
|
+
z18.object({ type: z18.literal("logs"), logs: z18.string() }),
|
|
4021
|
+
z18.object({ type: z18.literal("image"), url: z18.string() })
|
|
3934
4022
|
])
|
|
3935
4023
|
).nullable()
|
|
3936
4024
|
}),
|
|
3937
|
-
|
|
3938
|
-
type:
|
|
3939
|
-
id:
|
|
3940
|
-
result:
|
|
4025
|
+
z18.object({
|
|
4026
|
+
type: z18.literal("image_generation_call"),
|
|
4027
|
+
id: z18.string(),
|
|
4028
|
+
result: z18.string()
|
|
3941
4029
|
}),
|
|
3942
|
-
|
|
3943
|
-
type:
|
|
3944
|
-
id:
|
|
3945
|
-
call_id:
|
|
3946
|
-
action:
|
|
3947
|
-
type:
|
|
3948
|
-
command:
|
|
3949
|
-
timeout_ms:
|
|
3950
|
-
user:
|
|
3951
|
-
working_directory:
|
|
3952
|
-
env:
|
|
4030
|
+
z18.object({
|
|
4031
|
+
type: z18.literal("local_shell_call"),
|
|
4032
|
+
id: z18.string(),
|
|
4033
|
+
call_id: z18.string(),
|
|
4034
|
+
action: z18.object({
|
|
4035
|
+
type: z18.literal("exec"),
|
|
4036
|
+
command: z18.array(z18.string()),
|
|
4037
|
+
timeout_ms: z18.number().optional(),
|
|
4038
|
+
user: z18.string().optional(),
|
|
4039
|
+
working_directory: z18.string().optional(),
|
|
4040
|
+
env: z18.record(z18.string(), z18.string()).optional()
|
|
3953
4041
|
})
|
|
3954
4042
|
}),
|
|
3955
|
-
|
|
3956
|
-
type:
|
|
3957
|
-
call_id:
|
|
3958
|
-
name:
|
|
3959
|
-
arguments:
|
|
3960
|
-
id:
|
|
4043
|
+
z18.object({
|
|
4044
|
+
type: z18.literal("function_call"),
|
|
4045
|
+
call_id: z18.string(),
|
|
4046
|
+
name: z18.string(),
|
|
4047
|
+
arguments: z18.string(),
|
|
4048
|
+
id: z18.string(),
|
|
4049
|
+
namespace: z18.string().nullish()
|
|
3961
4050
|
}),
|
|
3962
|
-
|
|
3963
|
-
type:
|
|
3964
|
-
call_id:
|
|
3965
|
-
name:
|
|
3966
|
-
input:
|
|
3967
|
-
id:
|
|
4051
|
+
z18.object({
|
|
4052
|
+
type: z18.literal("custom_tool_call"),
|
|
4053
|
+
call_id: z18.string(),
|
|
4054
|
+
name: z18.string(),
|
|
4055
|
+
input: z18.string(),
|
|
4056
|
+
id: z18.string()
|
|
3968
4057
|
}),
|
|
3969
|
-
|
|
3970
|
-
type:
|
|
3971
|
-
id:
|
|
3972
|
-
status:
|
|
4058
|
+
z18.object({
|
|
4059
|
+
type: z18.literal("computer_call"),
|
|
4060
|
+
id: z18.string(),
|
|
4061
|
+
status: z18.string().optional()
|
|
3973
4062
|
}),
|
|
3974
|
-
|
|
3975
|
-
type:
|
|
3976
|
-
id:
|
|
3977
|
-
encrypted_content:
|
|
3978
|
-
summary:
|
|
3979
|
-
|
|
3980
|
-
type:
|
|
3981
|
-
text:
|
|
4063
|
+
z18.object({
|
|
4064
|
+
type: z18.literal("reasoning"),
|
|
4065
|
+
id: z18.string(),
|
|
4066
|
+
encrypted_content: z18.string().nullish(),
|
|
4067
|
+
summary: z18.array(
|
|
4068
|
+
z18.object({
|
|
4069
|
+
type: z18.literal("summary_text"),
|
|
4070
|
+
text: z18.string()
|
|
3982
4071
|
})
|
|
3983
4072
|
)
|
|
3984
4073
|
}),
|
|
3985
|
-
|
|
3986
|
-
type:
|
|
3987
|
-
id:
|
|
3988
|
-
status:
|
|
3989
|
-
arguments:
|
|
3990
|
-
name:
|
|
3991
|
-
server_label:
|
|
3992
|
-
output:
|
|
3993
|
-
error:
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
type:
|
|
3997
|
-
code:
|
|
3998
|
-
message:
|
|
4074
|
+
z18.object({
|
|
4075
|
+
type: z18.literal("mcp_call"),
|
|
4076
|
+
id: z18.string(),
|
|
4077
|
+
status: z18.string(),
|
|
4078
|
+
arguments: z18.string(),
|
|
4079
|
+
name: z18.string(),
|
|
4080
|
+
server_label: z18.string(),
|
|
4081
|
+
output: z18.string().nullish(),
|
|
4082
|
+
error: z18.union([
|
|
4083
|
+
z18.string(),
|
|
4084
|
+
z18.object({
|
|
4085
|
+
type: z18.string().optional(),
|
|
4086
|
+
code: z18.union([z18.number(), z18.string()]).optional(),
|
|
4087
|
+
message: z18.string().optional()
|
|
3999
4088
|
}).loose()
|
|
4000
4089
|
]).nullish(),
|
|
4001
|
-
approval_request_id:
|
|
4090
|
+
approval_request_id: z18.string().nullish()
|
|
4002
4091
|
}),
|
|
4003
|
-
|
|
4004
|
-
type:
|
|
4005
|
-
id:
|
|
4006
|
-
server_label:
|
|
4007
|
-
tools:
|
|
4008
|
-
|
|
4009
|
-
name:
|
|
4010
|
-
description:
|
|
4011
|
-
input_schema:
|
|
4012
|
-
annotations:
|
|
4092
|
+
z18.object({
|
|
4093
|
+
type: z18.literal("mcp_list_tools"),
|
|
4094
|
+
id: z18.string(),
|
|
4095
|
+
server_label: z18.string(),
|
|
4096
|
+
tools: z18.array(
|
|
4097
|
+
z18.object({
|
|
4098
|
+
name: z18.string(),
|
|
4099
|
+
description: z18.string().optional(),
|
|
4100
|
+
input_schema: z18.any(),
|
|
4101
|
+
annotations: z18.record(z18.string(), z18.unknown()).optional()
|
|
4013
4102
|
})
|
|
4014
4103
|
),
|
|
4015
|
-
error:
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
type:
|
|
4019
|
-
code:
|
|
4020
|
-
message:
|
|
4104
|
+
error: z18.union([
|
|
4105
|
+
z18.string(),
|
|
4106
|
+
z18.object({
|
|
4107
|
+
type: z18.string().optional(),
|
|
4108
|
+
code: z18.union([z18.number(), z18.string()]).optional(),
|
|
4109
|
+
message: z18.string().optional()
|
|
4021
4110
|
}).loose()
|
|
4022
4111
|
]).optional()
|
|
4023
4112
|
}),
|
|
4024
|
-
|
|
4025
|
-
type:
|
|
4026
|
-
id:
|
|
4027
|
-
server_label:
|
|
4028
|
-
name:
|
|
4029
|
-
arguments:
|
|
4030
|
-
approval_request_id:
|
|
4113
|
+
z18.object({
|
|
4114
|
+
type: z18.literal("mcp_approval_request"),
|
|
4115
|
+
id: z18.string(),
|
|
4116
|
+
server_label: z18.string(),
|
|
4117
|
+
name: z18.string(),
|
|
4118
|
+
arguments: z18.string(),
|
|
4119
|
+
approval_request_id: z18.string().optional()
|
|
4031
4120
|
}),
|
|
4032
|
-
|
|
4033
|
-
type:
|
|
4034
|
-
id:
|
|
4035
|
-
call_id:
|
|
4036
|
-
status:
|
|
4037
|
-
operation:
|
|
4038
|
-
|
|
4039
|
-
type:
|
|
4040
|
-
path:
|
|
4041
|
-
diff:
|
|
4121
|
+
z18.object({
|
|
4122
|
+
type: z18.literal("apply_patch_call"),
|
|
4123
|
+
id: z18.string(),
|
|
4124
|
+
call_id: z18.string(),
|
|
4125
|
+
status: z18.enum(["in_progress", "completed"]),
|
|
4126
|
+
operation: z18.discriminatedUnion("type", [
|
|
4127
|
+
z18.object({
|
|
4128
|
+
type: z18.literal("create_file"),
|
|
4129
|
+
path: z18.string(),
|
|
4130
|
+
diff: z18.string()
|
|
4042
4131
|
}),
|
|
4043
|
-
|
|
4044
|
-
type:
|
|
4045
|
-
path:
|
|
4132
|
+
z18.object({
|
|
4133
|
+
type: z18.literal("delete_file"),
|
|
4134
|
+
path: z18.string()
|
|
4046
4135
|
}),
|
|
4047
|
-
|
|
4048
|
-
type:
|
|
4049
|
-
path:
|
|
4050
|
-
diff:
|
|
4136
|
+
z18.object({
|
|
4137
|
+
type: z18.literal("update_file"),
|
|
4138
|
+
path: z18.string(),
|
|
4139
|
+
diff: z18.string()
|
|
4051
4140
|
})
|
|
4052
4141
|
])
|
|
4053
4142
|
}),
|
|
4054
|
-
|
|
4055
|
-
type:
|
|
4056
|
-
id:
|
|
4057
|
-
call_id:
|
|
4058
|
-
status:
|
|
4059
|
-
action:
|
|
4060
|
-
commands:
|
|
4143
|
+
z18.object({
|
|
4144
|
+
type: z18.literal("shell_call"),
|
|
4145
|
+
id: z18.string(),
|
|
4146
|
+
call_id: z18.string(),
|
|
4147
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
4148
|
+
action: z18.object({
|
|
4149
|
+
commands: z18.array(z18.string())
|
|
4061
4150
|
})
|
|
4062
4151
|
}),
|
|
4063
|
-
|
|
4064
|
-
type:
|
|
4065
|
-
id:
|
|
4066
|
-
call_id:
|
|
4067
|
-
status:
|
|
4068
|
-
output:
|
|
4069
|
-
|
|
4070
|
-
stdout:
|
|
4071
|
-
stderr:
|
|
4072
|
-
outcome:
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
type:
|
|
4076
|
-
exit_code:
|
|
4152
|
+
z18.object({
|
|
4153
|
+
type: z18.literal("shell_call_output"),
|
|
4154
|
+
id: z18.string(),
|
|
4155
|
+
call_id: z18.string(),
|
|
4156
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
4157
|
+
output: z18.array(
|
|
4158
|
+
z18.object({
|
|
4159
|
+
stdout: z18.string(),
|
|
4160
|
+
stderr: z18.string(),
|
|
4161
|
+
outcome: z18.discriminatedUnion("type", [
|
|
4162
|
+
z18.object({ type: z18.literal("timeout") }),
|
|
4163
|
+
z18.object({
|
|
4164
|
+
type: z18.literal("exit"),
|
|
4165
|
+
exit_code: z18.number()
|
|
4077
4166
|
})
|
|
4078
4167
|
])
|
|
4079
4168
|
})
|
|
4080
4169
|
)
|
|
4081
4170
|
}),
|
|
4082
|
-
|
|
4083
|
-
type:
|
|
4084
|
-
id:
|
|
4085
|
-
execution:
|
|
4086
|
-
call_id:
|
|
4087
|
-
status:
|
|
4088
|
-
arguments:
|
|
4171
|
+
z18.object({
|
|
4172
|
+
type: z18.literal("tool_search_call"),
|
|
4173
|
+
id: z18.string(),
|
|
4174
|
+
execution: z18.enum(["server", "client"]),
|
|
4175
|
+
call_id: z18.string().nullable(),
|
|
4176
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
4177
|
+
arguments: z18.unknown()
|
|
4089
4178
|
}),
|
|
4090
|
-
|
|
4091
|
-
type:
|
|
4092
|
-
id:
|
|
4093
|
-
execution:
|
|
4094
|
-
call_id:
|
|
4095
|
-
status:
|
|
4096
|
-
tools:
|
|
4179
|
+
z18.object({
|
|
4180
|
+
type: z18.literal("tool_search_output"),
|
|
4181
|
+
id: z18.string(),
|
|
4182
|
+
execution: z18.enum(["server", "client"]),
|
|
4183
|
+
call_id: z18.string().nullable(),
|
|
4184
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
4185
|
+
tools: z18.array(z18.record(z18.string(), jsonValueSchema.optional()))
|
|
4097
4186
|
})
|
|
4098
4187
|
])
|
|
4099
4188
|
).optional(),
|
|
4100
|
-
service_tier:
|
|
4101
|
-
incomplete_details:
|
|
4102
|
-
usage:
|
|
4103
|
-
input_tokens:
|
|
4104
|
-
input_tokens_details:
|
|
4105
|
-
output_tokens:
|
|
4106
|
-
output_tokens_details:
|
|
4189
|
+
service_tier: z18.string().nullish(),
|
|
4190
|
+
incomplete_details: z18.object({ reason: z18.string() }).nullish(),
|
|
4191
|
+
usage: z18.object({
|
|
4192
|
+
input_tokens: z18.number(),
|
|
4193
|
+
input_tokens_details: z18.object({ cached_tokens: z18.number().nullish() }).nullish(),
|
|
4194
|
+
output_tokens: z18.number(),
|
|
4195
|
+
output_tokens_details: z18.object({ reasoning_tokens: z18.number().nullish() }).nullish()
|
|
4107
4196
|
}).optional()
|
|
4108
4197
|
})
|
|
4109
4198
|
)
|
|
@@ -4111,10 +4200,10 @@ var openaiResponsesResponseSchema = lazySchema15(
|
|
|
4111
4200
|
|
|
4112
4201
|
// src/responses/openai-responses-options.ts
|
|
4113
4202
|
import {
|
|
4114
|
-
lazySchema as
|
|
4115
|
-
zodSchema as
|
|
4203
|
+
lazySchema as lazySchema17,
|
|
4204
|
+
zodSchema as zodSchema17
|
|
4116
4205
|
} from "@ai-sdk/provider-utils";
|
|
4117
|
-
import { z as
|
|
4206
|
+
import { z as z19 } from "zod/v4";
|
|
4118
4207
|
var TOP_LOGPROBS_MAX = 20;
|
|
4119
4208
|
var openaiResponsesReasoningModelIds = [
|
|
4120
4209
|
"o1",
|
|
@@ -4179,9 +4268,9 @@ var openaiResponsesModelIds = [
|
|
|
4179
4268
|
"gpt-5-chat-latest",
|
|
4180
4269
|
...openaiResponsesReasoningModelIds
|
|
4181
4270
|
];
|
|
4182
|
-
var openaiLanguageModelResponsesOptionsSchema =
|
|
4183
|
-
() =>
|
|
4184
|
-
|
|
4271
|
+
var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
|
|
4272
|
+
() => zodSchema17(
|
|
4273
|
+
z19.object({
|
|
4185
4274
|
/**
|
|
4186
4275
|
* The ID of the OpenAI Conversation to continue.
|
|
4187
4276
|
* You must create a conversation first via the OpenAI API.
|
|
@@ -4189,13 +4278,13 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
|
4189
4278
|
* Defaults to `undefined`.
|
|
4190
4279
|
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
4191
4280
|
*/
|
|
4192
|
-
conversation:
|
|
4281
|
+
conversation: z19.string().nullish(),
|
|
4193
4282
|
/**
|
|
4194
4283
|
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
4195
4284
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
|
|
4196
4285
|
*/
|
|
4197
|
-
include:
|
|
4198
|
-
|
|
4286
|
+
include: z19.array(
|
|
4287
|
+
z19.enum([
|
|
4199
4288
|
"reasoning.encrypted_content",
|
|
4200
4289
|
// handled internally by default, only needed for unknown reasoning models
|
|
4201
4290
|
"file_search_call.results",
|
|
@@ -4207,7 +4296,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
|
4207
4296
|
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
4208
4297
|
* Defaults to `undefined`.
|
|
4209
4298
|
*/
|
|
4210
|
-
instructions:
|
|
4299
|
+
instructions: z19.string().nullish(),
|
|
4211
4300
|
/**
|
|
4212
4301
|
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
4213
4302
|
* the response size and can slow down response times. However, it can
|
|
@@ -4222,30 +4311,30 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
|
4222
4311
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
4223
4312
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
4224
4313
|
*/
|
|
4225
|
-
logprobs:
|
|
4314
|
+
logprobs: z19.union([z19.boolean(), z19.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
4226
4315
|
/**
|
|
4227
4316
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
4228
4317
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
4229
4318
|
* Any further attempts to call a tool by the model will be ignored.
|
|
4230
4319
|
*/
|
|
4231
|
-
maxToolCalls:
|
|
4320
|
+
maxToolCalls: z19.number().nullish(),
|
|
4232
4321
|
/**
|
|
4233
4322
|
* Additional metadata to store with the generation.
|
|
4234
4323
|
*/
|
|
4235
|
-
metadata:
|
|
4324
|
+
metadata: z19.any().nullish(),
|
|
4236
4325
|
/**
|
|
4237
4326
|
* Whether to use parallel tool calls. Defaults to `true`.
|
|
4238
4327
|
*/
|
|
4239
|
-
parallelToolCalls:
|
|
4328
|
+
parallelToolCalls: z19.boolean().nullish(),
|
|
4240
4329
|
/**
|
|
4241
4330
|
* The ID of the previous response. You can use it to continue a conversation.
|
|
4242
4331
|
* Defaults to `undefined`.
|
|
4243
4332
|
*/
|
|
4244
|
-
previousResponseId:
|
|
4333
|
+
previousResponseId: z19.string().nullish(),
|
|
4245
4334
|
/**
|
|
4246
4335
|
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
4247
4336
|
*/
|
|
4248
|
-
promptCacheKey:
|
|
4337
|
+
promptCacheKey: z19.string().nullish(),
|
|
4249
4338
|
/**
|
|
4250
4339
|
* The retention policy for the prompt cache.
|
|
4251
4340
|
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
@@ -4254,7 +4343,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
|
4254
4343
|
*
|
|
4255
4344
|
* @default 'in_memory'
|
|
4256
4345
|
*/
|
|
4257
|
-
promptCacheRetention:
|
|
4346
|
+
promptCacheRetention: z19.enum(["in_memory", "24h"]).nullish(),
|
|
4258
4347
|
/**
|
|
4259
4348
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
4260
4349
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
@@ -4265,17 +4354,17 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
|
4265
4354
|
* OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
|
|
4266
4355
|
* an error.
|
|
4267
4356
|
*/
|
|
4268
|
-
reasoningEffort:
|
|
4357
|
+
reasoningEffort: z19.string().nullish(),
|
|
4269
4358
|
/**
|
|
4270
4359
|
* Controls reasoning summary output from the model.
|
|
4271
4360
|
* Set to "auto" to automatically receive the richest level available,
|
|
4272
4361
|
* or "detailed" for comprehensive summaries.
|
|
4273
4362
|
*/
|
|
4274
|
-
reasoningSummary:
|
|
4363
|
+
reasoningSummary: z19.string().nullish(),
|
|
4275
4364
|
/**
|
|
4276
4365
|
* The identifier for safety monitoring and tracking.
|
|
4277
4366
|
*/
|
|
4278
|
-
safetyIdentifier:
|
|
4367
|
+
safetyIdentifier: z19.string().nullish(),
|
|
4279
4368
|
/**
|
|
4280
4369
|
* Service tier for the request.
|
|
4281
4370
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
@@ -4283,34 +4372,34 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
|
4283
4372
|
*
|
|
4284
4373
|
* Defaults to 'auto'.
|
|
4285
4374
|
*/
|
|
4286
|
-
serviceTier:
|
|
4375
|
+
serviceTier: z19.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
4287
4376
|
/**
|
|
4288
4377
|
* Whether to store the generation. Defaults to `true`.
|
|
4289
4378
|
*/
|
|
4290
|
-
store:
|
|
4379
|
+
store: z19.boolean().nullish(),
|
|
4291
4380
|
/**
|
|
4292
4381
|
* Whether to use strict JSON schema validation.
|
|
4293
4382
|
* Defaults to `true`.
|
|
4294
4383
|
*/
|
|
4295
|
-
strictJsonSchema:
|
|
4384
|
+
strictJsonSchema: z19.boolean().nullish(),
|
|
4296
4385
|
/**
|
|
4297
4386
|
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
4298
4387
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
4299
4388
|
* Valid values: 'low', 'medium', 'high'.
|
|
4300
4389
|
*/
|
|
4301
|
-
textVerbosity:
|
|
4390
|
+
textVerbosity: z19.enum(["low", "medium", "high"]).nullish(),
|
|
4302
4391
|
/**
|
|
4303
4392
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
4304
4393
|
* 'disabled' turns truncation off.
|
|
4305
4394
|
*/
|
|
4306
|
-
truncation:
|
|
4395
|
+
truncation: z19.enum(["auto", "disabled"]).nullish(),
|
|
4307
4396
|
/**
|
|
4308
4397
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
4309
4398
|
* monitor and detect abuse.
|
|
4310
4399
|
* Defaults to `undefined`.
|
|
4311
4400
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
4312
4401
|
*/
|
|
4313
|
-
user:
|
|
4402
|
+
user: z19.string().nullish(),
|
|
4314
4403
|
/**
|
|
4315
4404
|
* Override the system message mode for this model.
|
|
4316
4405
|
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
@@ -4319,7 +4408,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
|
4319
4408
|
*
|
|
4320
4409
|
* If not specified, the mode is automatically determined based on the model.
|
|
4321
4410
|
*/
|
|
4322
|
-
systemMessageMode:
|
|
4411
|
+
systemMessageMode: z19.enum(["system", "developer", "remove"]).optional(),
|
|
4323
4412
|
/**
|
|
4324
4413
|
* Force treating this model as a reasoning model.
|
|
4325
4414
|
*
|
|
@@ -4329,7 +4418,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
|
4329
4418
|
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
4330
4419
|
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
4331
4420
|
*/
|
|
4332
|
-
forceReasoning:
|
|
4421
|
+
forceReasoning: z19.boolean().optional()
|
|
4333
4422
|
})
|
|
4334
4423
|
)
|
|
4335
4424
|
);
|
|
@@ -4343,37 +4432,37 @@ import { validateTypes as validateTypes2 } from "@ai-sdk/provider-utils";
|
|
|
4343
4432
|
// src/tool/code-interpreter.ts
|
|
4344
4433
|
import {
|
|
4345
4434
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
|
|
4346
|
-
lazySchema as
|
|
4347
|
-
zodSchema as
|
|
4435
|
+
lazySchema as lazySchema18,
|
|
4436
|
+
zodSchema as zodSchema18
|
|
4348
4437
|
} from "@ai-sdk/provider-utils";
|
|
4349
|
-
import { z as
|
|
4350
|
-
var codeInterpreterInputSchema =
|
|
4351
|
-
() =>
|
|
4352
|
-
|
|
4353
|
-
code:
|
|
4354
|
-
containerId:
|
|
4438
|
+
import { z as z20 } from "zod/v4";
|
|
4439
|
+
var codeInterpreterInputSchema = lazySchema18(
|
|
4440
|
+
() => zodSchema18(
|
|
4441
|
+
z20.object({
|
|
4442
|
+
code: z20.string().nullish(),
|
|
4443
|
+
containerId: z20.string()
|
|
4355
4444
|
})
|
|
4356
4445
|
)
|
|
4357
4446
|
);
|
|
4358
|
-
var codeInterpreterOutputSchema =
|
|
4359
|
-
() =>
|
|
4360
|
-
|
|
4361
|
-
outputs:
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4447
|
+
var codeInterpreterOutputSchema = lazySchema18(
|
|
4448
|
+
() => zodSchema18(
|
|
4449
|
+
z20.object({
|
|
4450
|
+
outputs: z20.array(
|
|
4451
|
+
z20.discriminatedUnion("type", [
|
|
4452
|
+
z20.object({ type: z20.literal("logs"), logs: z20.string() }),
|
|
4453
|
+
z20.object({ type: z20.literal("image"), url: z20.string() })
|
|
4365
4454
|
])
|
|
4366
4455
|
).nullish()
|
|
4367
4456
|
})
|
|
4368
4457
|
)
|
|
4369
4458
|
);
|
|
4370
|
-
var codeInterpreterArgsSchema =
|
|
4371
|
-
() =>
|
|
4372
|
-
|
|
4373
|
-
container:
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
fileIds:
|
|
4459
|
+
var codeInterpreterArgsSchema = lazySchema18(
|
|
4460
|
+
() => zodSchema18(
|
|
4461
|
+
z20.object({
|
|
4462
|
+
container: z20.union([
|
|
4463
|
+
z20.string(),
|
|
4464
|
+
z20.object({
|
|
4465
|
+
fileIds: z20.array(z20.string()).optional()
|
|
4377
4466
|
})
|
|
4378
4467
|
]).optional()
|
|
4379
4468
|
})
|
|
@@ -4391,45 +4480,45 @@ var codeInterpreter = (args = {}) => {
|
|
|
4391
4480
|
// src/tool/file-search.ts
|
|
4392
4481
|
import {
|
|
4393
4482
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
|
|
4394
|
-
lazySchema as
|
|
4395
|
-
zodSchema as
|
|
4483
|
+
lazySchema as lazySchema19,
|
|
4484
|
+
zodSchema as zodSchema19
|
|
4396
4485
|
} from "@ai-sdk/provider-utils";
|
|
4397
|
-
import { z as
|
|
4398
|
-
var comparisonFilterSchema =
|
|
4399
|
-
key:
|
|
4400
|
-
type:
|
|
4401
|
-
value:
|
|
4486
|
+
import { z as z21 } from "zod/v4";
|
|
4487
|
+
var comparisonFilterSchema = z21.object({
|
|
4488
|
+
key: z21.string(),
|
|
4489
|
+
type: z21.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
4490
|
+
value: z21.union([z21.string(), z21.number(), z21.boolean(), z21.array(z21.string())])
|
|
4402
4491
|
});
|
|
4403
|
-
var compoundFilterSchema =
|
|
4404
|
-
type:
|
|
4405
|
-
filters:
|
|
4406
|
-
|
|
4492
|
+
var compoundFilterSchema = z21.object({
|
|
4493
|
+
type: z21.enum(["and", "or"]),
|
|
4494
|
+
filters: z21.array(
|
|
4495
|
+
z21.union([comparisonFilterSchema, z21.lazy(() => compoundFilterSchema)])
|
|
4407
4496
|
)
|
|
4408
4497
|
});
|
|
4409
|
-
var fileSearchArgsSchema =
|
|
4410
|
-
() =>
|
|
4411
|
-
|
|
4412
|
-
vectorStoreIds:
|
|
4413
|
-
maxNumResults:
|
|
4414
|
-
ranking:
|
|
4415
|
-
ranker:
|
|
4416
|
-
scoreThreshold:
|
|
4498
|
+
var fileSearchArgsSchema = lazySchema19(
|
|
4499
|
+
() => zodSchema19(
|
|
4500
|
+
z21.object({
|
|
4501
|
+
vectorStoreIds: z21.array(z21.string()),
|
|
4502
|
+
maxNumResults: z21.number().optional(),
|
|
4503
|
+
ranking: z21.object({
|
|
4504
|
+
ranker: z21.string().optional(),
|
|
4505
|
+
scoreThreshold: z21.number().optional()
|
|
4417
4506
|
}).optional(),
|
|
4418
|
-
filters:
|
|
4507
|
+
filters: z21.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
4419
4508
|
})
|
|
4420
4509
|
)
|
|
4421
4510
|
);
|
|
4422
|
-
var fileSearchOutputSchema =
|
|
4423
|
-
() =>
|
|
4424
|
-
|
|
4425
|
-
queries:
|
|
4426
|
-
results:
|
|
4427
|
-
|
|
4428
|
-
attributes:
|
|
4429
|
-
fileId:
|
|
4430
|
-
filename:
|
|
4431
|
-
score:
|
|
4432
|
-
text:
|
|
4511
|
+
var fileSearchOutputSchema = lazySchema19(
|
|
4512
|
+
() => zodSchema19(
|
|
4513
|
+
z21.object({
|
|
4514
|
+
queries: z21.array(z21.string()),
|
|
4515
|
+
results: z21.array(
|
|
4516
|
+
z21.object({
|
|
4517
|
+
attributes: z21.record(z21.string(), z21.unknown()),
|
|
4518
|
+
fileId: z21.string(),
|
|
4519
|
+
filename: z21.string(),
|
|
4520
|
+
score: z21.number(),
|
|
4521
|
+
text: z21.string()
|
|
4433
4522
|
})
|
|
4434
4523
|
).nullable()
|
|
4435
4524
|
})
|
|
@@ -4437,39 +4526,39 @@ var fileSearchOutputSchema = lazySchema18(
|
|
|
4437
4526
|
);
|
|
4438
4527
|
var fileSearch = createProviderToolFactoryWithOutputSchema6({
|
|
4439
4528
|
id: "openai.file_search",
|
|
4440
|
-
inputSchema:
|
|
4529
|
+
inputSchema: z21.object({}),
|
|
4441
4530
|
outputSchema: fileSearchOutputSchema
|
|
4442
4531
|
});
|
|
4443
4532
|
|
|
4444
4533
|
// src/tool/image-generation.ts
|
|
4445
4534
|
import {
|
|
4446
4535
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
|
|
4447
|
-
lazySchema as
|
|
4448
|
-
zodSchema as
|
|
4536
|
+
lazySchema as lazySchema20,
|
|
4537
|
+
zodSchema as zodSchema20
|
|
4449
4538
|
} from "@ai-sdk/provider-utils";
|
|
4450
|
-
import { z as
|
|
4451
|
-
var imageGenerationArgsSchema =
|
|
4452
|
-
() =>
|
|
4453
|
-
|
|
4454
|
-
background:
|
|
4455
|
-
inputFidelity:
|
|
4456
|
-
inputImageMask:
|
|
4457
|
-
fileId:
|
|
4458
|
-
imageUrl:
|
|
4539
|
+
import { z as z22 } from "zod/v4";
|
|
4540
|
+
var imageGenerationArgsSchema = lazySchema20(
|
|
4541
|
+
() => zodSchema20(
|
|
4542
|
+
z22.object({
|
|
4543
|
+
background: z22.enum(["auto", "opaque", "transparent"]).optional(),
|
|
4544
|
+
inputFidelity: z22.enum(["low", "high"]).optional(),
|
|
4545
|
+
inputImageMask: z22.object({
|
|
4546
|
+
fileId: z22.string().optional(),
|
|
4547
|
+
imageUrl: z22.string().optional()
|
|
4459
4548
|
}).optional(),
|
|
4460
|
-
model:
|
|
4461
|
-
moderation:
|
|
4462
|
-
outputCompression:
|
|
4463
|
-
outputFormat:
|
|
4464
|
-
partialImages:
|
|
4465
|
-
quality:
|
|
4466
|
-
size:
|
|
4549
|
+
model: z22.string().optional(),
|
|
4550
|
+
moderation: z22.enum(["auto"]).optional(),
|
|
4551
|
+
outputCompression: z22.number().int().min(0).max(100).optional(),
|
|
4552
|
+
outputFormat: z22.enum(["png", "jpeg", "webp"]).optional(),
|
|
4553
|
+
partialImages: z22.number().int().min(0).max(3).optional(),
|
|
4554
|
+
quality: z22.enum(["auto", "low", "medium", "high"]).optional(),
|
|
4555
|
+
size: z22.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
4467
4556
|
}).strict()
|
|
4468
4557
|
)
|
|
4469
4558
|
);
|
|
4470
|
-
var imageGenerationInputSchema =
|
|
4471
|
-
var imageGenerationOutputSchema =
|
|
4472
|
-
() =>
|
|
4559
|
+
var imageGenerationInputSchema = lazySchema20(() => zodSchema20(z22.object({})));
|
|
4560
|
+
var imageGenerationOutputSchema = lazySchema20(
|
|
4561
|
+
() => zodSchema20(z22.object({ result: z22.string() }))
|
|
4473
4562
|
);
|
|
4474
4563
|
var imageGenerationToolFactory = createProviderToolFactoryWithOutputSchema7({
|
|
4475
4564
|
id: "openai.image_generation",
|
|
@@ -4483,29 +4572,29 @@ var imageGeneration = (args = {}) => {
|
|
|
4483
4572
|
// src/tool/custom.ts
|
|
4484
4573
|
import {
|
|
4485
4574
|
createProviderToolFactory,
|
|
4486
|
-
lazySchema as
|
|
4487
|
-
zodSchema as
|
|
4575
|
+
lazySchema as lazySchema21,
|
|
4576
|
+
zodSchema as zodSchema21
|
|
4488
4577
|
} from "@ai-sdk/provider-utils";
|
|
4489
|
-
import { z as
|
|
4490
|
-
var customArgsSchema =
|
|
4491
|
-
() =>
|
|
4492
|
-
|
|
4493
|
-
name:
|
|
4494
|
-
description:
|
|
4495
|
-
format:
|
|
4496
|
-
|
|
4497
|
-
type:
|
|
4498
|
-
syntax:
|
|
4499
|
-
definition:
|
|
4578
|
+
import { z as z23 } from "zod/v4";
|
|
4579
|
+
var customArgsSchema = lazySchema21(
|
|
4580
|
+
() => zodSchema21(
|
|
4581
|
+
z23.object({
|
|
4582
|
+
name: z23.string(),
|
|
4583
|
+
description: z23.string().optional(),
|
|
4584
|
+
format: z23.union([
|
|
4585
|
+
z23.object({
|
|
4586
|
+
type: z23.literal("grammar"),
|
|
4587
|
+
syntax: z23.enum(["regex", "lark"]),
|
|
4588
|
+
definition: z23.string()
|
|
4500
4589
|
}),
|
|
4501
|
-
|
|
4502
|
-
type:
|
|
4590
|
+
z23.object({
|
|
4591
|
+
type: z23.literal("text")
|
|
4503
4592
|
})
|
|
4504
4593
|
]).optional()
|
|
4505
4594
|
})
|
|
4506
4595
|
)
|
|
4507
4596
|
);
|
|
4508
|
-
var customInputSchema =
|
|
4597
|
+
var customInputSchema = lazySchema21(() => zodSchema21(z23.string()));
|
|
4509
4598
|
var customToolFactory = createProviderToolFactory({
|
|
4510
4599
|
id: "openai.custom",
|
|
4511
4600
|
inputSchema: customInputSchema
|
|
@@ -4514,60 +4603,60 @@ var customToolFactory = createProviderToolFactory({
|
|
|
4514
4603
|
// src/tool/mcp.ts
|
|
4515
4604
|
import {
|
|
4516
4605
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
|
|
4517
|
-
lazySchema as
|
|
4518
|
-
zodSchema as
|
|
4606
|
+
lazySchema as lazySchema22,
|
|
4607
|
+
zodSchema as zodSchema22
|
|
4519
4608
|
} from "@ai-sdk/provider-utils";
|
|
4520
|
-
import { z as
|
|
4521
|
-
var jsonValueSchema2 =
|
|
4522
|
-
() =>
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4609
|
+
import { z as z24 } from "zod/v4";
|
|
4610
|
+
var jsonValueSchema2 = z24.lazy(
|
|
4611
|
+
() => z24.union([
|
|
4612
|
+
z24.string(),
|
|
4613
|
+
z24.number(),
|
|
4614
|
+
z24.boolean(),
|
|
4615
|
+
z24.null(),
|
|
4616
|
+
z24.array(jsonValueSchema2),
|
|
4617
|
+
z24.record(z24.string(), jsonValueSchema2)
|
|
4529
4618
|
])
|
|
4530
4619
|
);
|
|
4531
|
-
var mcpArgsSchema =
|
|
4532
|
-
() =>
|
|
4533
|
-
|
|
4534
|
-
serverLabel:
|
|
4535
|
-
allowedTools:
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
readOnly:
|
|
4539
|
-
toolNames:
|
|
4620
|
+
var mcpArgsSchema = lazySchema22(
|
|
4621
|
+
() => zodSchema22(
|
|
4622
|
+
z24.object({
|
|
4623
|
+
serverLabel: z24.string(),
|
|
4624
|
+
allowedTools: z24.union([
|
|
4625
|
+
z24.array(z24.string()),
|
|
4626
|
+
z24.object({
|
|
4627
|
+
readOnly: z24.boolean().optional(),
|
|
4628
|
+
toolNames: z24.array(z24.string()).optional()
|
|
4540
4629
|
})
|
|
4541
4630
|
]).optional(),
|
|
4542
|
-
authorization:
|
|
4543
|
-
connectorId:
|
|
4544
|
-
headers:
|
|
4545
|
-
requireApproval:
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
never:
|
|
4549
|
-
toolNames:
|
|
4631
|
+
authorization: z24.string().optional(),
|
|
4632
|
+
connectorId: z24.string().optional(),
|
|
4633
|
+
headers: z24.record(z24.string(), z24.string()).optional(),
|
|
4634
|
+
requireApproval: z24.union([
|
|
4635
|
+
z24.enum(["always", "never"]),
|
|
4636
|
+
z24.object({
|
|
4637
|
+
never: z24.object({
|
|
4638
|
+
toolNames: z24.array(z24.string()).optional()
|
|
4550
4639
|
}).optional()
|
|
4551
4640
|
})
|
|
4552
4641
|
]).optional(),
|
|
4553
|
-
serverDescription:
|
|
4554
|
-
serverUrl:
|
|
4642
|
+
serverDescription: z24.string().optional(),
|
|
4643
|
+
serverUrl: z24.string().optional()
|
|
4555
4644
|
}).refine(
|
|
4556
4645
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
4557
4646
|
"One of serverUrl or connectorId must be provided."
|
|
4558
4647
|
)
|
|
4559
4648
|
)
|
|
4560
4649
|
);
|
|
4561
|
-
var mcpInputSchema =
|
|
4562
|
-
var mcpOutputSchema =
|
|
4563
|
-
() =>
|
|
4564
|
-
|
|
4565
|
-
type:
|
|
4566
|
-
serverLabel:
|
|
4567
|
-
name:
|
|
4568
|
-
arguments:
|
|
4569
|
-
output:
|
|
4570
|
-
error:
|
|
4650
|
+
var mcpInputSchema = lazySchema22(() => zodSchema22(z24.object({})));
|
|
4651
|
+
var mcpOutputSchema = lazySchema22(
|
|
4652
|
+
() => zodSchema22(
|
|
4653
|
+
z24.object({
|
|
4654
|
+
type: z24.literal("call"),
|
|
4655
|
+
serverLabel: z24.string(),
|
|
4656
|
+
name: z24.string(),
|
|
4657
|
+
arguments: z24.string(),
|
|
4658
|
+
output: z24.string().nullish(),
|
|
4659
|
+
error: z24.union([z24.string(), jsonValueSchema2]).optional()
|
|
4571
4660
|
})
|
|
4572
4661
|
)
|
|
4573
4662
|
);
|
|
@@ -4580,70 +4669,15 @@ var mcpToolFactory = createProviderToolFactoryWithOutputSchema8({
|
|
|
4580
4669
|
// src/tool/web-search.ts
|
|
4581
4670
|
import {
|
|
4582
4671
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
|
|
4583
|
-
lazySchema as lazySchema22,
|
|
4584
|
-
zodSchema as zodSchema22
|
|
4585
|
-
} from "@ai-sdk/provider-utils";
|
|
4586
|
-
import { z as z24 } from "zod/v4";
|
|
4587
|
-
var webSearchArgsSchema = lazySchema22(
|
|
4588
|
-
() => zodSchema22(
|
|
4589
|
-
z24.object({
|
|
4590
|
-
externalWebAccess: z24.boolean().optional(),
|
|
4591
|
-
filters: z24.object({ allowedDomains: z24.array(z24.string()).optional() }).optional(),
|
|
4592
|
-
searchContextSize: z24.enum(["low", "medium", "high"]).optional(),
|
|
4593
|
-
userLocation: z24.object({
|
|
4594
|
-
type: z24.literal("approximate"),
|
|
4595
|
-
country: z24.string().optional(),
|
|
4596
|
-
city: z24.string().optional(),
|
|
4597
|
-
region: z24.string().optional(),
|
|
4598
|
-
timezone: z24.string().optional()
|
|
4599
|
-
}).optional()
|
|
4600
|
-
})
|
|
4601
|
-
)
|
|
4602
|
-
);
|
|
4603
|
-
var webSearchInputSchema = lazySchema22(() => zodSchema22(z24.object({})));
|
|
4604
|
-
var webSearchOutputSchema = lazySchema22(
|
|
4605
|
-
() => zodSchema22(
|
|
4606
|
-
z24.object({
|
|
4607
|
-
action: z24.discriminatedUnion("type", [
|
|
4608
|
-
z24.object({
|
|
4609
|
-
type: z24.literal("search"),
|
|
4610
|
-
query: z24.string().optional()
|
|
4611
|
-
}),
|
|
4612
|
-
z24.object({
|
|
4613
|
-
type: z24.literal("openPage"),
|
|
4614
|
-
url: z24.string().nullish()
|
|
4615
|
-
}),
|
|
4616
|
-
z24.object({
|
|
4617
|
-
type: z24.literal("findInPage"),
|
|
4618
|
-
url: z24.string().nullish(),
|
|
4619
|
-
pattern: z24.string().nullish()
|
|
4620
|
-
})
|
|
4621
|
-
]).optional(),
|
|
4622
|
-
sources: z24.array(
|
|
4623
|
-
z24.discriminatedUnion("type", [
|
|
4624
|
-
z24.object({ type: z24.literal("url"), url: z24.string() }),
|
|
4625
|
-
z24.object({ type: z24.literal("api"), name: z24.string() })
|
|
4626
|
-
])
|
|
4627
|
-
).optional()
|
|
4628
|
-
})
|
|
4629
|
-
)
|
|
4630
|
-
);
|
|
4631
|
-
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema9({
|
|
4632
|
-
id: "openai.web_search",
|
|
4633
|
-
inputSchema: webSearchInputSchema,
|
|
4634
|
-
outputSchema: webSearchOutputSchema
|
|
4635
|
-
});
|
|
4636
|
-
|
|
4637
|
-
// src/tool/web-search-preview.ts
|
|
4638
|
-
import {
|
|
4639
|
-
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema10,
|
|
4640
4672
|
lazySchema as lazySchema23,
|
|
4641
4673
|
zodSchema as zodSchema23
|
|
4642
4674
|
} from "@ai-sdk/provider-utils";
|
|
4643
4675
|
import { z as z25 } from "zod/v4";
|
|
4644
|
-
var
|
|
4676
|
+
var webSearchArgsSchema = lazySchema23(
|
|
4645
4677
|
() => zodSchema23(
|
|
4646
4678
|
z25.object({
|
|
4679
|
+
externalWebAccess: z25.boolean().optional(),
|
|
4680
|
+
filters: z25.object({ allowedDomains: z25.array(z25.string()).optional() }).optional(),
|
|
4647
4681
|
searchContextSize: z25.enum(["low", "medium", "high"]).optional(),
|
|
4648
4682
|
userLocation: z25.object({
|
|
4649
4683
|
type: z25.literal("approximate"),
|
|
@@ -4655,10 +4689,8 @@ var webSearchPreviewArgsSchema = lazySchema23(
|
|
|
4655
4689
|
})
|
|
4656
4690
|
)
|
|
4657
4691
|
);
|
|
4658
|
-
var
|
|
4659
|
-
|
|
4660
|
-
);
|
|
4661
|
-
var webSearchPreviewOutputSchema = lazySchema23(
|
|
4692
|
+
var webSearchInputSchema = lazySchema23(() => zodSchema23(z25.object({})));
|
|
4693
|
+
var webSearchOutputSchema = lazySchema23(
|
|
4662
4694
|
() => zodSchema23(
|
|
4663
4695
|
z25.object({
|
|
4664
4696
|
action: z25.discriminatedUnion("type", [
|
|
@@ -4675,6 +4707,63 @@ var webSearchPreviewOutputSchema = lazySchema23(
|
|
|
4675
4707
|
url: z25.string().nullish(),
|
|
4676
4708
|
pattern: z25.string().nullish()
|
|
4677
4709
|
})
|
|
4710
|
+
]).optional(),
|
|
4711
|
+
sources: z25.array(
|
|
4712
|
+
z25.discriminatedUnion("type", [
|
|
4713
|
+
z25.object({ type: z25.literal("url"), url: z25.string() }),
|
|
4714
|
+
z25.object({ type: z25.literal("api"), name: z25.string() })
|
|
4715
|
+
])
|
|
4716
|
+
).optional()
|
|
4717
|
+
})
|
|
4718
|
+
)
|
|
4719
|
+
);
|
|
4720
|
+
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema9({
|
|
4721
|
+
id: "openai.web_search",
|
|
4722
|
+
inputSchema: webSearchInputSchema,
|
|
4723
|
+
outputSchema: webSearchOutputSchema
|
|
4724
|
+
});
|
|
4725
|
+
|
|
4726
|
+
// src/tool/web-search-preview.ts
|
|
4727
|
+
import {
|
|
4728
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema10,
|
|
4729
|
+
lazySchema as lazySchema24,
|
|
4730
|
+
zodSchema as zodSchema24
|
|
4731
|
+
} from "@ai-sdk/provider-utils";
|
|
4732
|
+
import { z as z26 } from "zod/v4";
|
|
4733
|
+
var webSearchPreviewArgsSchema = lazySchema24(
|
|
4734
|
+
() => zodSchema24(
|
|
4735
|
+
z26.object({
|
|
4736
|
+
searchContextSize: z26.enum(["low", "medium", "high"]).optional(),
|
|
4737
|
+
userLocation: z26.object({
|
|
4738
|
+
type: z26.literal("approximate"),
|
|
4739
|
+
country: z26.string().optional(),
|
|
4740
|
+
city: z26.string().optional(),
|
|
4741
|
+
region: z26.string().optional(),
|
|
4742
|
+
timezone: z26.string().optional()
|
|
4743
|
+
}).optional()
|
|
4744
|
+
})
|
|
4745
|
+
)
|
|
4746
|
+
);
|
|
4747
|
+
var webSearchPreviewInputSchema = lazySchema24(
|
|
4748
|
+
() => zodSchema24(z26.object({}))
|
|
4749
|
+
);
|
|
4750
|
+
var webSearchPreviewOutputSchema = lazySchema24(
|
|
4751
|
+
() => zodSchema24(
|
|
4752
|
+
z26.object({
|
|
4753
|
+
action: z26.discriminatedUnion("type", [
|
|
4754
|
+
z26.object({
|
|
4755
|
+
type: z26.literal("search"),
|
|
4756
|
+
query: z26.string().optional()
|
|
4757
|
+
}),
|
|
4758
|
+
z26.object({
|
|
4759
|
+
type: z26.literal("openPage"),
|
|
4760
|
+
url: z26.string().nullish()
|
|
4761
|
+
}),
|
|
4762
|
+
z26.object({
|
|
4763
|
+
type: z26.literal("findInPage"),
|
|
4764
|
+
url: z26.string().nullish(),
|
|
4765
|
+
pattern: z26.string().nullish()
|
|
4766
|
+
})
|
|
4678
4767
|
]).optional()
|
|
4679
4768
|
})
|
|
4680
4769
|
)
|
|
@@ -5018,13 +5107,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5018
5107
|
warnings.push({ type: "unsupported", feature: "stopSequences" });
|
|
5019
5108
|
}
|
|
5020
5109
|
const providerOptionsName = this.config.provider.includes("azure") ? "azure" : "openai";
|
|
5021
|
-
let openaiOptions = await
|
|
5110
|
+
let openaiOptions = await parseProviderOptions8({
|
|
5022
5111
|
provider: providerOptionsName,
|
|
5023
5112
|
providerOptions,
|
|
5024
5113
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
5025
5114
|
});
|
|
5026
5115
|
if (openaiOptions == null && providerOptionsName !== "openai") {
|
|
5027
|
-
openaiOptions = await
|
|
5116
|
+
openaiOptions = await parseProviderOptions8({
|
|
5028
5117
|
provider: "openai",
|
|
5029
5118
|
providerOptions,
|
|
5030
5119
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
@@ -5493,7 +5582,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5493
5582
|
input: part.arguments,
|
|
5494
5583
|
providerMetadata: {
|
|
5495
5584
|
[providerOptionsName]: {
|
|
5496
|
-
itemId: part.id
|
|
5585
|
+
itemId: part.id,
|
|
5586
|
+
...part.namespace != null && { namespace: part.namespace }
|
|
5497
5587
|
}
|
|
5498
5588
|
}
|
|
5499
5589
|
});
|
|
@@ -5976,7 +6066,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5976
6066
|
hasFunctionCall = true;
|
|
5977
6067
|
controller.enqueue({
|
|
5978
6068
|
type: "tool-input-end",
|
|
5979
|
-
id: value.item.call_id
|
|
6069
|
+
id: value.item.call_id,
|
|
6070
|
+
...value.item.namespace != null && {
|
|
6071
|
+
providerMetadata: {
|
|
6072
|
+
[providerOptionsName]: {
|
|
6073
|
+
namespace: value.item.namespace
|
|
6074
|
+
}
|
|
6075
|
+
}
|
|
6076
|
+
}
|
|
5980
6077
|
});
|
|
5981
6078
|
controller.enqueue({
|
|
5982
6079
|
type: "tool-call",
|
|
@@ -5985,7 +6082,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5985
6082
|
input: value.item.arguments,
|
|
5986
6083
|
providerMetadata: {
|
|
5987
6084
|
[providerOptionsName]: {
|
|
5988
|
-
itemId: value.item.id
|
|
6085
|
+
itemId: value.item.id,
|
|
6086
|
+
...value.item.namespace != null && {
|
|
6087
|
+
namespace: value.item.namespace
|
|
6088
|
+
}
|
|
5989
6089
|
}
|
|
5990
6090
|
}
|
|
5991
6091
|
});
|
|
@@ -6673,6 +6773,9 @@ export {
|
|
|
6673
6773
|
modelMaxImagesPerCall,
|
|
6674
6774
|
openAITranscriptionModelOptions,
|
|
6675
6775
|
openaiEmbeddingModelOptions,
|
|
6776
|
+
openaiImageModelEditOptions,
|
|
6777
|
+
openaiImageModelGenerationOptions,
|
|
6778
|
+
openaiImageModelOptions,
|
|
6676
6779
|
openaiLanguageModelChatOptions,
|
|
6677
6780
|
openaiLanguageModelCompletionOptions,
|
|
6678
6781
|
openaiSpeechModelOptionsSchema,
|