@ai-sdk/openai 3.0.54 → 3.0.57
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 +22 -0
- package/dist/index.d.mts +28 -1
- package/dist/index.d.ts +28 -1
- package/dist/index.js +1204 -1122
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1176 -1063
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +28 -1
- package/dist/internal/index.d.ts +28 -1
- package/dist/internal/index.js +1203 -1115
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1177 -1061
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +12 -3
- package/package.json +4 -4
- package/src/chat/convert-openai-chat-usage.ts +1 -1
- package/src/chat/convert-to-openai-chat-messages.ts +3 -3
- package/src/chat/map-openai-finish-reason.ts +1 -1
- package/src/chat/openai-chat-api.ts +6 -2
- package/src/chat/openai-chat-language-model.ts +14 -14
- package/src/chat/openai-chat-options.ts +5 -1
- package/src/chat/openai-chat-prepare-tools.ts +3 -3
- package/src/completion/convert-openai-completion-usage.ts +1 -1
- package/src/completion/convert-to-openai-completion-prompt.ts +1 -1
- package/src/completion/map-openai-finish-reason.ts +1 -1
- package/src/completion/openai-completion-api.ts +5 -1
- package/src/completion/openai-completion-language-model.ts +6 -6
- package/src/completion/openai-completion-options.ts +5 -1
- package/src/embedding/openai-embedding-model.ts +3 -3
- package/src/embedding/openai-embedding-options.ts +5 -1
- package/src/image/openai-image-model-options.ts +123 -0
- package/src/image/openai-image-model.ts +43 -80
- package/src/index.ts +5 -0
- package/src/internal/index.ts +1 -1
- package/src/openai-config.ts +1 -1
- package/src/openai-provider.ts +9 -9
- package/src/responses/convert-openai-responses-usage.ts +1 -1
- package/src/responses/convert-to-openai-responses-input.ts +5 -5
- package/src/responses/map-openai-responses-finish-reason.ts +1 -1
- package/src/responses/openai-responses-api.ts +6 -2
- package/src/responses/openai-responses-language-model.ts +35 -35
- package/src/responses/openai-responses-options.ts +5 -1
- package/src/responses/openai-responses-prepare-tools.ts +4 -4
- package/src/responses/openai-responses-provider-metadata.ts +2 -2
- package/src/speech/openai-speech-model.ts +4 -4
- package/src/speech/openai-speech-options.ts +5 -1
- package/src/tool/file-search.ts +1 -1
- package/src/tool/mcp.ts +1 -1
- package/src/tool/tool-search.ts +2 -2
- package/src/transcription/openai-transcription-model.ts +4 -4
- package/src/transcription/openai-transcription-options.ts +5 -1
- package/src/image/openai-image-options.ts +0 -34
package/dist/internal/index.mjs
CHANGED
|
@@ -307,7 +307,10 @@ function mapOpenAIFinishReason(finishReason) {
|
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
// src/chat/openai-chat-api.ts
|
|
310
|
-
import {
|
|
310
|
+
import {
|
|
311
|
+
lazySchema,
|
|
312
|
+
zodSchema
|
|
313
|
+
} from "@ai-sdk/provider-utils";
|
|
311
314
|
import { z as z2 } from "zod/v4";
|
|
312
315
|
var openaiChatResponseSchema = lazySchema(
|
|
313
316
|
() => zodSchema(
|
|
@@ -449,7 +452,10 @@ var openaiChatChunkSchema = lazySchema(
|
|
|
449
452
|
);
|
|
450
453
|
|
|
451
454
|
// src/chat/openai-chat-options.ts
|
|
452
|
-
import {
|
|
455
|
+
import {
|
|
456
|
+
lazySchema as lazySchema2,
|
|
457
|
+
zodSchema as zodSchema2
|
|
458
|
+
} from "@ai-sdk/provider-utils";
|
|
453
459
|
import { z as z3 } from "zod/v4";
|
|
454
460
|
var openaiLanguageModelChatOptions = lazySchema2(
|
|
455
461
|
() => zodSchema2(
|
|
@@ -1271,7 +1277,10 @@ function mapOpenAIFinishReason2(finishReason) {
|
|
|
1271
1277
|
|
|
1272
1278
|
// src/completion/openai-completion-api.ts
|
|
1273
1279
|
import { z as z4 } from "zod/v4";
|
|
1274
|
-
import {
|
|
1280
|
+
import {
|
|
1281
|
+
lazySchema as lazySchema3,
|
|
1282
|
+
zodSchema as zodSchema3
|
|
1283
|
+
} from "@ai-sdk/provider-utils";
|
|
1275
1284
|
var openaiCompletionResponseSchema = lazySchema3(
|
|
1276
1285
|
() => zodSchema3(
|
|
1277
1286
|
z4.object({
|
|
@@ -1328,7 +1337,10 @@ var openaiCompletionChunkSchema = lazySchema3(
|
|
|
1328
1337
|
);
|
|
1329
1338
|
|
|
1330
1339
|
// src/completion/openai-completion-options.ts
|
|
1331
|
-
import {
|
|
1340
|
+
import {
|
|
1341
|
+
lazySchema as lazySchema4,
|
|
1342
|
+
zodSchema as zodSchema4
|
|
1343
|
+
} from "@ai-sdk/provider-utils";
|
|
1332
1344
|
import { z as z5 } from "zod/v4";
|
|
1333
1345
|
var openaiLanguageModelCompletionOptions = lazySchema4(
|
|
1334
1346
|
() => zodSchema4(
|
|
@@ -1616,7 +1628,10 @@ import {
|
|
|
1616
1628
|
} from "@ai-sdk/provider-utils";
|
|
1617
1629
|
|
|
1618
1630
|
// src/embedding/openai-embedding-options.ts
|
|
1619
|
-
import {
|
|
1631
|
+
import {
|
|
1632
|
+
lazySchema as lazySchema5,
|
|
1633
|
+
zodSchema as zodSchema5
|
|
1634
|
+
} from "@ai-sdk/provider-utils";
|
|
1620
1635
|
import { z as z6 } from "zod/v4";
|
|
1621
1636
|
var openaiEmbeddingModelOptions = lazySchema5(
|
|
1622
1637
|
() => zodSchema5(
|
|
@@ -1719,6 +1734,7 @@ import {
|
|
|
1719
1734
|
convertToFormData,
|
|
1720
1735
|
createJsonResponseHandler as createJsonResponseHandler4,
|
|
1721
1736
|
downloadBlob,
|
|
1737
|
+
parseProviderOptions as parseProviderOptions4,
|
|
1722
1738
|
postFormDataToApi,
|
|
1723
1739
|
postJsonToApi as postJsonToApi4
|
|
1724
1740
|
} from "@ai-sdk/provider-utils";
|
|
@@ -1753,7 +1769,12 @@ var openaiImageResponseSchema = lazySchema7(
|
|
|
1753
1769
|
)
|
|
1754
1770
|
);
|
|
1755
1771
|
|
|
1756
|
-
// 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";
|
|
1757
1778
|
var modelMaxImagesPerCall = {
|
|
1758
1779
|
"dall-e-3": 1,
|
|
1759
1780
|
"dall-e-2": 10,
|
|
@@ -1775,6 +1796,65 @@ function hasDefaultResponseFormat(modelId) {
|
|
|
1775
1796
|
(prefix) => modelId.startsWith(prefix)
|
|
1776
1797
|
);
|
|
1777
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
|
+
);
|
|
1778
1858
|
|
|
1779
1859
|
// src/image/openai-image-model.ts
|
|
1780
1860
|
var OpenAIImageModel = class {
|
|
@@ -1816,6 +1896,11 @@ var OpenAIImageModel = class {
|
|
|
1816
1896
|
}
|
|
1817
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();
|
|
1818
1898
|
if (files != null) {
|
|
1899
|
+
const openaiOptions2 = (_d = await parseProviderOptions4({
|
|
1900
|
+
provider: "openai",
|
|
1901
|
+
providerOptions,
|
|
1902
|
+
schema: openaiImageModelEditOptions
|
|
1903
|
+
})) != null ? _d : {};
|
|
1819
1904
|
const { value: response2, responseHeaders: responseHeaders2 } = await postFormDataToApi({
|
|
1820
1905
|
url: this.config.url({
|
|
1821
1906
|
path: "/images/edits",
|
|
@@ -1842,7 +1927,12 @@ var OpenAIImageModel = class {
|
|
|
1842
1927
|
mask: mask != null ? await fileToBlob(mask) : void 0,
|
|
1843
1928
|
n,
|
|
1844
1929
|
size,
|
|
1845
|
-
|
|
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
|
|
1846
1936
|
}),
|
|
1847
1937
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
1848
1938
|
successfulResponseHandler: createJsonResponseHandler4(
|
|
@@ -1886,6 +1976,11 @@ var OpenAIImageModel = class {
|
|
|
1886
1976
|
}
|
|
1887
1977
|
};
|
|
1888
1978
|
}
|
|
1979
|
+
const openaiOptions = (_h = await parseProviderOptions4({
|
|
1980
|
+
provider: "openai",
|
|
1981
|
+
providerOptions,
|
|
1982
|
+
schema: openaiImageModelGenerationOptions
|
|
1983
|
+
})) != null ? _h : {};
|
|
1889
1984
|
const { value: response, responseHeaders } = await postJsonToApi4({
|
|
1890
1985
|
url: this.config.url({
|
|
1891
1986
|
path: "/images/generations",
|
|
@@ -1897,7 +1992,13 @@ var OpenAIImageModel = class {
|
|
|
1897
1992
|
prompt,
|
|
1898
1993
|
n,
|
|
1899
1994
|
size,
|
|
1900
|
-
|
|
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,
|
|
1901
2002
|
...!hasDefaultResponseFormat(this.modelId) ? { response_format: "b64_json" } : {}
|
|
1902
2003
|
},
|
|
1903
2004
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
@@ -1975,38 +2076,38 @@ import {
|
|
|
1975
2076
|
convertBase64ToUint8Array as convertBase64ToUint8Array2,
|
|
1976
2077
|
createJsonResponseHandler as createJsonResponseHandler5,
|
|
1977
2078
|
mediaTypeToExtension,
|
|
1978
|
-
parseProviderOptions as
|
|
2079
|
+
parseProviderOptions as parseProviderOptions5,
|
|
1979
2080
|
postFormDataToApi as postFormDataToApi2
|
|
1980
2081
|
} from "@ai-sdk/provider-utils";
|
|
1981
2082
|
|
|
1982
2083
|
// src/transcription/openai-transcription-api.ts
|
|
1983
|
-
import { lazySchema as
|
|
1984
|
-
import { z as
|
|
1985
|
-
var openaiTranscriptionResponseSchema =
|
|
1986
|
-
() =>
|
|
1987
|
-
|
|
1988
|
-
text:
|
|
1989
|
-
language:
|
|
1990
|
-
duration:
|
|
1991
|
-
words:
|
|
1992
|
-
|
|
1993
|
-
word:
|
|
1994
|
-
start:
|
|
1995
|
-
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()
|
|
1996
2097
|
})
|
|
1997
2098
|
).nullish(),
|
|
1998
|
-
segments:
|
|
1999
|
-
|
|
2000
|
-
id:
|
|
2001
|
-
seek:
|
|
2002
|
-
start:
|
|
2003
|
-
end:
|
|
2004
|
-
text:
|
|
2005
|
-
tokens:
|
|
2006
|
-
temperature:
|
|
2007
|
-
avg_logprob:
|
|
2008
|
-
compression_ratio:
|
|
2009
|
-
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()
|
|
2010
2111
|
})
|
|
2011
2112
|
).nullish()
|
|
2012
2113
|
})
|
|
@@ -2014,33 +2115,36 @@ var openaiTranscriptionResponseSchema = lazySchema8(
|
|
|
2014
2115
|
);
|
|
2015
2116
|
|
|
2016
2117
|
// src/transcription/openai-transcription-options.ts
|
|
2017
|
-
import {
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2118
|
+
import {
|
|
2119
|
+
lazySchema as lazySchema10,
|
|
2120
|
+
zodSchema as zodSchema10
|
|
2121
|
+
} from "@ai-sdk/provider-utils";
|
|
2122
|
+
import { z as z11 } from "zod/v4";
|
|
2123
|
+
var openAITranscriptionModelOptions = lazySchema10(
|
|
2124
|
+
() => zodSchema10(
|
|
2125
|
+
z11.object({
|
|
2022
2126
|
/**
|
|
2023
2127
|
* Additional information to include in the transcription response.
|
|
2024
2128
|
*/
|
|
2025
|
-
include:
|
|
2129
|
+
include: z11.array(z11.string()).optional(),
|
|
2026
2130
|
/**
|
|
2027
2131
|
* The language of the input audio in ISO-639-1 format.
|
|
2028
2132
|
*/
|
|
2029
|
-
language:
|
|
2133
|
+
language: z11.string().optional(),
|
|
2030
2134
|
/**
|
|
2031
2135
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
2032
2136
|
*/
|
|
2033
|
-
prompt:
|
|
2137
|
+
prompt: z11.string().optional(),
|
|
2034
2138
|
/**
|
|
2035
2139
|
* The sampling temperature, between 0 and 1.
|
|
2036
2140
|
* @default 0
|
|
2037
2141
|
*/
|
|
2038
|
-
temperature:
|
|
2142
|
+
temperature: z11.number().min(0).max(1).default(0).optional(),
|
|
2039
2143
|
/**
|
|
2040
2144
|
* The timestamp granularities to populate for this transcription.
|
|
2041
2145
|
* @default ['segment']
|
|
2042
2146
|
*/
|
|
2043
|
-
timestampGranularities:
|
|
2147
|
+
timestampGranularities: z11.array(z11.enum(["word", "segment"])).default(["segment"]).optional()
|
|
2044
2148
|
})
|
|
2045
2149
|
)
|
|
2046
2150
|
);
|
|
@@ -2120,7 +2224,7 @@ var OpenAITranscriptionModel = class {
|
|
|
2120
2224
|
providerOptions
|
|
2121
2225
|
}) {
|
|
2122
2226
|
const warnings = [];
|
|
2123
|
-
const openAIOptions = await
|
|
2227
|
+
const openAIOptions = await parseProviderOptions5({
|
|
2124
2228
|
provider: "openai",
|
|
2125
2229
|
providerOptions,
|
|
2126
2230
|
schema: openAITranscriptionModelOptions
|
|
@@ -2216,18 +2320,21 @@ var OpenAITranscriptionModel = class {
|
|
|
2216
2320
|
import {
|
|
2217
2321
|
combineHeaders as combineHeaders6,
|
|
2218
2322
|
createBinaryResponseHandler,
|
|
2219
|
-
parseProviderOptions as
|
|
2323
|
+
parseProviderOptions as parseProviderOptions6,
|
|
2220
2324
|
postJsonToApi as postJsonToApi5
|
|
2221
2325
|
} from "@ai-sdk/provider-utils";
|
|
2222
2326
|
|
|
2223
2327
|
// src/speech/openai-speech-options.ts
|
|
2224
|
-
import {
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2328
|
+
import {
|
|
2329
|
+
lazySchema as lazySchema11,
|
|
2330
|
+
zodSchema as zodSchema11
|
|
2331
|
+
} from "@ai-sdk/provider-utils";
|
|
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()
|
|
2231
2338
|
})
|
|
2232
2339
|
)
|
|
2233
2340
|
);
|
|
@@ -2252,7 +2359,7 @@ var OpenAISpeechModel = class {
|
|
|
2252
2359
|
providerOptions
|
|
2253
2360
|
}) {
|
|
2254
2361
|
const warnings = [];
|
|
2255
|
-
const openAIOptions = await
|
|
2362
|
+
const openAIOptions = await parseProviderOptions6({
|
|
2256
2363
|
provider: "openai",
|
|
2257
2364
|
providerOptions,
|
|
2258
2365
|
schema: openaiSpeechModelOptionsSchema
|
|
@@ -2343,7 +2450,7 @@ import {
|
|
|
2343
2450
|
createJsonResponseHandler as createJsonResponseHandler6,
|
|
2344
2451
|
createToolNameMapping,
|
|
2345
2452
|
generateId as generateId2,
|
|
2346
|
-
parseProviderOptions as
|
|
2453
|
+
parseProviderOptions as parseProviderOptions8,
|
|
2347
2454
|
postJsonToApi as postJsonToApi6
|
|
2348
2455
|
} from "@ai-sdk/provider-utils";
|
|
2349
2456
|
|
|
@@ -2394,50 +2501,50 @@ import {
|
|
|
2394
2501
|
convertToBase64 as convertToBase642,
|
|
2395
2502
|
isNonNullable,
|
|
2396
2503
|
parseJSON,
|
|
2397
|
-
parseProviderOptions as
|
|
2504
|
+
parseProviderOptions as parseProviderOptions7,
|
|
2398
2505
|
validateTypes
|
|
2399
2506
|
} from "@ai-sdk/provider-utils";
|
|
2400
|
-
import { z as
|
|
2507
|
+
import { z as z17 } from "zod/v4";
|
|
2401
2508
|
|
|
2402
2509
|
// src/tool/apply-patch.ts
|
|
2403
2510
|
import {
|
|
2404
2511
|
createProviderToolFactoryWithOutputSchema,
|
|
2405
|
-
lazySchema as
|
|
2406
|
-
zodSchema as
|
|
2512
|
+
lazySchema as lazySchema12,
|
|
2513
|
+
zodSchema as zodSchema12
|
|
2407
2514
|
} from "@ai-sdk/provider-utils";
|
|
2408
|
-
import { z as
|
|
2409
|
-
var applyPatchInputSchema =
|
|
2410
|
-
() =>
|
|
2411
|
-
|
|
2412
|
-
callId:
|
|
2413
|
-
operation:
|
|
2414
|
-
|
|
2415
|
-
type:
|
|
2416
|
-
path:
|
|
2417
|
-
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()
|
|
2418
2525
|
}),
|
|
2419
|
-
|
|
2420
|
-
type:
|
|
2421
|
-
path:
|
|
2526
|
+
z13.object({
|
|
2527
|
+
type: z13.literal("delete_file"),
|
|
2528
|
+
path: z13.string()
|
|
2422
2529
|
}),
|
|
2423
|
-
|
|
2424
|
-
type:
|
|
2425
|
-
path:
|
|
2426
|
-
diff:
|
|
2530
|
+
z13.object({
|
|
2531
|
+
type: z13.literal("update_file"),
|
|
2532
|
+
path: z13.string(),
|
|
2533
|
+
diff: z13.string()
|
|
2427
2534
|
})
|
|
2428
2535
|
])
|
|
2429
2536
|
})
|
|
2430
2537
|
)
|
|
2431
2538
|
);
|
|
2432
|
-
var applyPatchOutputSchema =
|
|
2433
|
-
() =>
|
|
2434
|
-
|
|
2435
|
-
status:
|
|
2436
|
-
output:
|
|
2539
|
+
var applyPatchOutputSchema = lazySchema12(
|
|
2540
|
+
() => zodSchema12(
|
|
2541
|
+
z13.object({
|
|
2542
|
+
status: z13.enum(["completed", "failed"]),
|
|
2543
|
+
output: z13.string().optional()
|
|
2437
2544
|
})
|
|
2438
2545
|
)
|
|
2439
2546
|
);
|
|
2440
|
-
var applyPatchArgsSchema =
|
|
2547
|
+
var applyPatchArgsSchema = lazySchema12(() => zodSchema12(z13.object({})));
|
|
2441
2548
|
var applyPatchToolFactory = createProviderToolFactoryWithOutputSchema({
|
|
2442
2549
|
id: "openai.apply_patch",
|
|
2443
2550
|
inputSchema: applyPatchInputSchema,
|
|
@@ -2448,26 +2555,26 @@ var applyPatch = applyPatchToolFactory;
|
|
|
2448
2555
|
// src/tool/local-shell.ts
|
|
2449
2556
|
import {
|
|
2450
2557
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
|
|
2451
|
-
lazySchema as
|
|
2452
|
-
zodSchema as
|
|
2558
|
+
lazySchema as lazySchema13,
|
|
2559
|
+
zodSchema as zodSchema13
|
|
2453
2560
|
} from "@ai-sdk/provider-utils";
|
|
2454
|
-
import { z as
|
|
2455
|
-
var localShellInputSchema =
|
|
2456
|
-
() =>
|
|
2457
|
-
|
|
2458
|
-
action:
|
|
2459
|
-
type:
|
|
2460
|
-
command:
|
|
2461
|
-
timeoutMs:
|
|
2462
|
-
user:
|
|
2463
|
-
workingDirectory:
|
|
2464
|
-
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()
|
|
2465
2572
|
})
|
|
2466
2573
|
})
|
|
2467
2574
|
)
|
|
2468
2575
|
);
|
|
2469
|
-
var localShellOutputSchema =
|
|
2470
|
-
() =>
|
|
2576
|
+
var localShellOutputSchema = lazySchema13(
|
|
2577
|
+
() => zodSchema13(z14.object({ output: z14.string() }))
|
|
2471
2578
|
);
|
|
2472
2579
|
var localShell = createProviderToolFactoryWithOutputSchema2({
|
|
2473
2580
|
id: "openai.local_shell",
|
|
@@ -2478,91 +2585,91 @@ var localShell = createProviderToolFactoryWithOutputSchema2({
|
|
|
2478
2585
|
// src/tool/shell.ts
|
|
2479
2586
|
import {
|
|
2480
2587
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
|
|
2481
|
-
lazySchema as
|
|
2482
|
-
zodSchema as
|
|
2588
|
+
lazySchema as lazySchema14,
|
|
2589
|
+
zodSchema as zodSchema14
|
|
2483
2590
|
} from "@ai-sdk/provider-utils";
|
|
2484
|
-
import { z as
|
|
2485
|
-
var shellInputSchema =
|
|
2486
|
-
() =>
|
|
2487
|
-
|
|
2488
|
-
action:
|
|
2489
|
-
commands:
|
|
2490
|
-
timeoutMs:
|
|
2491
|
-
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()
|
|
2492
2599
|
})
|
|
2493
2600
|
})
|
|
2494
2601
|
)
|
|
2495
2602
|
);
|
|
2496
|
-
var shellOutputSchema =
|
|
2497
|
-
() =>
|
|
2498
|
-
|
|
2499
|
-
output:
|
|
2500
|
-
|
|
2501
|
-
stdout:
|
|
2502
|
-
stderr:
|
|
2503
|
-
outcome:
|
|
2504
|
-
|
|
2505
|
-
|
|
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() })
|
|
2506
2613
|
])
|
|
2507
2614
|
})
|
|
2508
2615
|
)
|
|
2509
2616
|
})
|
|
2510
2617
|
)
|
|
2511
2618
|
);
|
|
2512
|
-
var shellSkillsSchema =
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
type:
|
|
2516
|
-
skillId:
|
|
2517
|
-
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()
|
|
2518
2625
|
}),
|
|
2519
|
-
|
|
2520
|
-
type:
|
|
2521
|
-
name:
|
|
2522
|
-
description:
|
|
2523
|
-
source:
|
|
2524
|
-
type:
|
|
2525
|
-
mediaType:
|
|
2526
|
-
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()
|
|
2527
2634
|
})
|
|
2528
2635
|
})
|
|
2529
2636
|
])
|
|
2530
2637
|
).optional();
|
|
2531
|
-
var shellArgsSchema =
|
|
2532
|
-
() =>
|
|
2533
|
-
|
|
2534
|
-
environment:
|
|
2535
|
-
|
|
2536
|
-
type:
|
|
2537
|
-
fileIds:
|
|
2538
|
-
memoryLimit:
|
|
2539
|
-
networkPolicy:
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
type:
|
|
2543
|
-
allowedDomains:
|
|
2544
|
-
domainSecrets:
|
|
2545
|
-
|
|
2546
|
-
domain:
|
|
2547
|
-
name:
|
|
2548
|
-
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()
|
|
2549
2656
|
})
|
|
2550
2657
|
).optional()
|
|
2551
2658
|
})
|
|
2552
2659
|
]).optional(),
|
|
2553
2660
|
skills: shellSkillsSchema
|
|
2554
2661
|
}),
|
|
2555
|
-
|
|
2556
|
-
type:
|
|
2557
|
-
containerId:
|
|
2662
|
+
z15.object({
|
|
2663
|
+
type: z15.literal("containerReference"),
|
|
2664
|
+
containerId: z15.string()
|
|
2558
2665
|
}),
|
|
2559
|
-
|
|
2560
|
-
type:
|
|
2561
|
-
skills:
|
|
2562
|
-
|
|
2563
|
-
name:
|
|
2564
|
-
description:
|
|
2565
|
-
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()
|
|
2566
2673
|
})
|
|
2567
2674
|
).optional()
|
|
2568
2675
|
})
|
|
@@ -2579,31 +2686,31 @@ var shell = createProviderToolFactoryWithOutputSchema3({
|
|
|
2579
2686
|
// src/tool/tool-search.ts
|
|
2580
2687
|
import {
|
|
2581
2688
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
|
|
2582
|
-
lazySchema as
|
|
2583
|
-
zodSchema as
|
|
2689
|
+
lazySchema as lazySchema15,
|
|
2690
|
+
zodSchema as zodSchema15
|
|
2584
2691
|
} from "@ai-sdk/provider-utils";
|
|
2585
|
-
import { z as
|
|
2586
|
-
var toolSearchArgsSchema =
|
|
2587
|
-
() =>
|
|
2588
|
-
|
|
2589
|
-
execution:
|
|
2590
|
-
description:
|
|
2591
|
-
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()
|
|
2592
2699
|
})
|
|
2593
2700
|
)
|
|
2594
2701
|
);
|
|
2595
|
-
var toolSearchInputSchema =
|
|
2596
|
-
() =>
|
|
2597
|
-
|
|
2598
|
-
arguments:
|
|
2599
|
-
call_id:
|
|
2702
|
+
var toolSearchInputSchema = lazySchema15(
|
|
2703
|
+
() => zodSchema15(
|
|
2704
|
+
z16.object({
|
|
2705
|
+
arguments: z16.unknown().optional(),
|
|
2706
|
+
call_id: z16.string().nullish()
|
|
2600
2707
|
})
|
|
2601
2708
|
)
|
|
2602
2709
|
);
|
|
2603
|
-
var toolSearchOutputSchema =
|
|
2604
|
-
() =>
|
|
2605
|
-
|
|
2606
|
-
tools:
|
|
2710
|
+
var toolSearchOutputSchema = lazySchema15(
|
|
2711
|
+
() => zodSchema15(
|
|
2712
|
+
z16.object({
|
|
2713
|
+
tools: z16.array(z16.record(z16.string(), z16.unknown()))
|
|
2607
2714
|
})
|
|
2608
2715
|
)
|
|
2609
2716
|
);
|
|
@@ -2909,7 +3016,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2909
3016
|
break;
|
|
2910
3017
|
}
|
|
2911
3018
|
case "reasoning": {
|
|
2912
|
-
const providerOptions = await
|
|
3019
|
+
const providerOptions = await parseProviderOptions7({
|
|
2913
3020
|
provider: providerOptionsName,
|
|
2914
3021
|
providerOptions: part.providerOptions,
|
|
2915
3022
|
schema: openaiResponsesReasoningProviderOptionsSchema
|
|
@@ -3217,9 +3324,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
3217
3324
|
}
|
|
3218
3325
|
return { input, warnings };
|
|
3219
3326
|
}
|
|
3220
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
3221
|
-
itemId:
|
|
3222
|
-
reasoningEncryptedContent:
|
|
3327
|
+
var openaiResponsesReasoningProviderOptionsSchema = z17.object({
|
|
3328
|
+
itemId: z17.string().nullish(),
|
|
3329
|
+
reasoningEncryptedContent: z17.string().nullish()
|
|
3223
3330
|
});
|
|
3224
3331
|
|
|
3225
3332
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -3241,542 +3348,545 @@ function mapOpenAIResponseFinishReason({
|
|
|
3241
3348
|
}
|
|
3242
3349
|
|
|
3243
3350
|
// src/responses/openai-responses-api.ts
|
|
3244
|
-
import {
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3351
|
+
import {
|
|
3352
|
+
lazySchema as lazySchema16,
|
|
3353
|
+
zodSchema as zodSchema16
|
|
3354
|
+
} from "@ai-sdk/provider-utils";
|
|
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())
|
|
3254
3364
|
])
|
|
3255
3365
|
);
|
|
3256
|
-
var openaiResponsesChunkSchema =
|
|
3257
|
-
() =>
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
type:
|
|
3261
|
-
item_id:
|
|
3262
|
-
delta:
|
|
3263
|
-
logprobs:
|
|
3264
|
-
|
|
3265
|
-
token:
|
|
3266
|
-
logprob:
|
|
3267
|
-
top_logprobs:
|
|
3268
|
-
|
|
3269
|
-
token:
|
|
3270
|
-
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()
|
|
3271
3381
|
})
|
|
3272
3382
|
)
|
|
3273
3383
|
})
|
|
3274
3384
|
).nullish()
|
|
3275
3385
|
}),
|
|
3276
|
-
|
|
3277
|
-
type:
|
|
3278
|
-
response:
|
|
3279
|
-
incomplete_details:
|
|
3280
|
-
usage:
|
|
3281
|
-
input_tokens:
|
|
3282
|
-
input_tokens_details:
|
|
3283
|
-
output_tokens:
|
|
3284
|
-
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()
|
|
3285
3395
|
}),
|
|
3286
|
-
service_tier:
|
|
3396
|
+
service_tier: z18.string().nullish()
|
|
3287
3397
|
})
|
|
3288
3398
|
}),
|
|
3289
|
-
|
|
3290
|
-
type:
|
|
3291
|
-
response:
|
|
3292
|
-
error:
|
|
3293
|
-
code:
|
|
3294
|
-
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()
|
|
3295
3405
|
}).nullish(),
|
|
3296
|
-
incomplete_details:
|
|
3297
|
-
usage:
|
|
3298
|
-
input_tokens:
|
|
3299
|
-
input_tokens_details:
|
|
3300
|
-
output_tokens:
|
|
3301
|
-
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()
|
|
3302
3412
|
}).nullish(),
|
|
3303
|
-
service_tier:
|
|
3413
|
+
service_tier: z18.string().nullish()
|
|
3304
3414
|
})
|
|
3305
3415
|
}),
|
|
3306
|
-
|
|
3307
|
-
type:
|
|
3308
|
-
response:
|
|
3309
|
-
id:
|
|
3310
|
-
created_at:
|
|
3311
|
-
model:
|
|
3312
|
-
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()
|
|
3313
3423
|
})
|
|
3314
3424
|
}),
|
|
3315
|
-
|
|
3316
|
-
type:
|
|
3317
|
-
output_index:
|
|
3318
|
-
item:
|
|
3319
|
-
|
|
3320
|
-
type:
|
|
3321
|
-
id:
|
|
3322
|
-
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()
|
|
3323
3433
|
}),
|
|
3324
|
-
|
|
3325
|
-
type:
|
|
3326
|
-
id:
|
|
3327
|
-
encrypted_content:
|
|
3434
|
+
z18.object({
|
|
3435
|
+
type: z18.literal("reasoning"),
|
|
3436
|
+
id: z18.string(),
|
|
3437
|
+
encrypted_content: z18.string().nullish()
|
|
3328
3438
|
}),
|
|
3329
|
-
|
|
3330
|
-
type:
|
|
3331
|
-
id:
|
|
3332
|
-
call_id:
|
|
3333
|
-
name:
|
|
3334
|
-
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()
|
|
3335
3445
|
}),
|
|
3336
|
-
|
|
3337
|
-
type:
|
|
3338
|
-
id:
|
|
3339
|
-
status:
|
|
3446
|
+
z18.object({
|
|
3447
|
+
type: z18.literal("web_search_call"),
|
|
3448
|
+
id: z18.string(),
|
|
3449
|
+
status: z18.string()
|
|
3340
3450
|
}),
|
|
3341
|
-
|
|
3342
|
-
type:
|
|
3343
|
-
id:
|
|
3344
|
-
status:
|
|
3451
|
+
z18.object({
|
|
3452
|
+
type: z18.literal("computer_call"),
|
|
3453
|
+
id: z18.string(),
|
|
3454
|
+
status: z18.string()
|
|
3345
3455
|
}),
|
|
3346
|
-
|
|
3347
|
-
type:
|
|
3348
|
-
id:
|
|
3456
|
+
z18.object({
|
|
3457
|
+
type: z18.literal("file_search_call"),
|
|
3458
|
+
id: z18.string()
|
|
3349
3459
|
}),
|
|
3350
|
-
|
|
3351
|
-
type:
|
|
3352
|
-
id:
|
|
3460
|
+
z18.object({
|
|
3461
|
+
type: z18.literal("image_generation_call"),
|
|
3462
|
+
id: z18.string()
|
|
3353
3463
|
}),
|
|
3354
|
-
|
|
3355
|
-
type:
|
|
3356
|
-
id:
|
|
3357
|
-
container_id:
|
|
3358
|
-
code:
|
|
3359
|
-
outputs:
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3464
|
+
z18.object({
|
|
3465
|
+
type: z18.literal("code_interpreter_call"),
|
|
3466
|
+
id: z18.string(),
|
|
3467
|
+
container_id: z18.string(),
|
|
3468
|
+
code: z18.string().nullable(),
|
|
3469
|
+
outputs: z18.array(
|
|
3470
|
+
z18.discriminatedUnion("type", [
|
|
3471
|
+
z18.object({ type: z18.literal("logs"), logs: z18.string() }),
|
|
3472
|
+
z18.object({ type: z18.literal("image"), url: z18.string() })
|
|
3363
3473
|
])
|
|
3364
3474
|
).nullable(),
|
|
3365
|
-
status:
|
|
3475
|
+
status: z18.string()
|
|
3366
3476
|
}),
|
|
3367
|
-
|
|
3368
|
-
type:
|
|
3369
|
-
id:
|
|
3370
|
-
status:
|
|
3371
|
-
approval_request_id:
|
|
3477
|
+
z18.object({
|
|
3478
|
+
type: z18.literal("mcp_call"),
|
|
3479
|
+
id: z18.string(),
|
|
3480
|
+
status: z18.string(),
|
|
3481
|
+
approval_request_id: z18.string().nullish()
|
|
3372
3482
|
}),
|
|
3373
|
-
|
|
3374
|
-
type:
|
|
3375
|
-
id:
|
|
3483
|
+
z18.object({
|
|
3484
|
+
type: z18.literal("mcp_list_tools"),
|
|
3485
|
+
id: z18.string()
|
|
3376
3486
|
}),
|
|
3377
|
-
|
|
3378
|
-
type:
|
|
3379
|
-
id:
|
|
3487
|
+
z18.object({
|
|
3488
|
+
type: z18.literal("mcp_approval_request"),
|
|
3489
|
+
id: z18.string()
|
|
3380
3490
|
}),
|
|
3381
|
-
|
|
3382
|
-
type:
|
|
3383
|
-
id:
|
|
3384
|
-
call_id:
|
|
3385
|
-
status:
|
|
3386
|
-
operation:
|
|
3387
|
-
|
|
3388
|
-
type:
|
|
3389
|
-
path:
|
|
3390
|
-
diff:
|
|
3491
|
+
z18.object({
|
|
3492
|
+
type: z18.literal("apply_patch_call"),
|
|
3493
|
+
id: z18.string(),
|
|
3494
|
+
call_id: z18.string(),
|
|
3495
|
+
status: z18.enum(["in_progress", "completed"]),
|
|
3496
|
+
operation: z18.discriminatedUnion("type", [
|
|
3497
|
+
z18.object({
|
|
3498
|
+
type: z18.literal("create_file"),
|
|
3499
|
+
path: z18.string(),
|
|
3500
|
+
diff: z18.string()
|
|
3391
3501
|
}),
|
|
3392
|
-
|
|
3393
|
-
type:
|
|
3394
|
-
path:
|
|
3502
|
+
z18.object({
|
|
3503
|
+
type: z18.literal("delete_file"),
|
|
3504
|
+
path: z18.string()
|
|
3395
3505
|
}),
|
|
3396
|
-
|
|
3397
|
-
type:
|
|
3398
|
-
path:
|
|
3399
|
-
diff:
|
|
3506
|
+
z18.object({
|
|
3507
|
+
type: z18.literal("update_file"),
|
|
3508
|
+
path: z18.string(),
|
|
3509
|
+
diff: z18.string()
|
|
3400
3510
|
})
|
|
3401
3511
|
])
|
|
3402
3512
|
}),
|
|
3403
|
-
|
|
3404
|
-
type:
|
|
3405
|
-
id:
|
|
3406
|
-
call_id:
|
|
3407
|
-
name:
|
|
3408
|
-
input:
|
|
3513
|
+
z18.object({
|
|
3514
|
+
type: z18.literal("custom_tool_call"),
|
|
3515
|
+
id: z18.string(),
|
|
3516
|
+
call_id: z18.string(),
|
|
3517
|
+
name: z18.string(),
|
|
3518
|
+
input: z18.string()
|
|
3409
3519
|
}),
|
|
3410
|
-
|
|
3411
|
-
type:
|
|
3412
|
-
id:
|
|
3413
|
-
call_id:
|
|
3414
|
-
status:
|
|
3415
|
-
action:
|
|
3416
|
-
commands:
|
|
3520
|
+
z18.object({
|
|
3521
|
+
type: z18.literal("shell_call"),
|
|
3522
|
+
id: z18.string(),
|
|
3523
|
+
call_id: z18.string(),
|
|
3524
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
3525
|
+
action: z18.object({
|
|
3526
|
+
commands: z18.array(z18.string())
|
|
3417
3527
|
})
|
|
3418
3528
|
}),
|
|
3419
|
-
|
|
3420
|
-
type:
|
|
3421
|
-
id:
|
|
3422
|
-
call_id:
|
|
3423
|
-
status:
|
|
3424
|
-
output:
|
|
3425
|
-
|
|
3426
|
-
stdout:
|
|
3427
|
-
stderr:
|
|
3428
|
-
outcome:
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
type:
|
|
3432
|
-
exit_code:
|
|
3529
|
+
z18.object({
|
|
3530
|
+
type: z18.literal("shell_call_output"),
|
|
3531
|
+
id: z18.string(),
|
|
3532
|
+
call_id: z18.string(),
|
|
3533
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
3534
|
+
output: z18.array(
|
|
3535
|
+
z18.object({
|
|
3536
|
+
stdout: z18.string(),
|
|
3537
|
+
stderr: z18.string(),
|
|
3538
|
+
outcome: z18.discriminatedUnion("type", [
|
|
3539
|
+
z18.object({ type: z18.literal("timeout") }),
|
|
3540
|
+
z18.object({
|
|
3541
|
+
type: z18.literal("exit"),
|
|
3542
|
+
exit_code: z18.number()
|
|
3433
3543
|
})
|
|
3434
3544
|
])
|
|
3435
3545
|
})
|
|
3436
3546
|
)
|
|
3437
3547
|
}),
|
|
3438
|
-
|
|
3439
|
-
type:
|
|
3440
|
-
id:
|
|
3441
|
-
execution:
|
|
3442
|
-
call_id:
|
|
3443
|
-
status:
|
|
3444
|
-
arguments:
|
|
3548
|
+
z18.object({
|
|
3549
|
+
type: z18.literal("tool_search_call"),
|
|
3550
|
+
id: z18.string(),
|
|
3551
|
+
execution: z18.enum(["server", "client"]),
|
|
3552
|
+
call_id: z18.string().nullable(),
|
|
3553
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
3554
|
+
arguments: z18.unknown()
|
|
3445
3555
|
}),
|
|
3446
|
-
|
|
3447
|
-
type:
|
|
3448
|
-
id:
|
|
3449
|
-
execution:
|
|
3450
|
-
call_id:
|
|
3451
|
-
status:
|
|
3452
|
-
tools:
|
|
3556
|
+
z18.object({
|
|
3557
|
+
type: z18.literal("tool_search_output"),
|
|
3558
|
+
id: z18.string(),
|
|
3559
|
+
execution: z18.enum(["server", "client"]),
|
|
3560
|
+
call_id: z18.string().nullable(),
|
|
3561
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
3562
|
+
tools: z18.array(z18.record(z18.string(), jsonValueSchema.optional()))
|
|
3453
3563
|
})
|
|
3454
3564
|
])
|
|
3455
3565
|
}),
|
|
3456
|
-
|
|
3457
|
-
type:
|
|
3458
|
-
output_index:
|
|
3459
|
-
item:
|
|
3460
|
-
|
|
3461
|
-
type:
|
|
3462
|
-
id:
|
|
3463
|
-
phase:
|
|
3566
|
+
z18.object({
|
|
3567
|
+
type: z18.literal("response.output_item.done"),
|
|
3568
|
+
output_index: z18.number(),
|
|
3569
|
+
item: z18.discriminatedUnion("type", [
|
|
3570
|
+
z18.object({
|
|
3571
|
+
type: z18.literal("message"),
|
|
3572
|
+
id: z18.string(),
|
|
3573
|
+
phase: z18.enum(["commentary", "final_answer"]).nullish()
|
|
3464
3574
|
}),
|
|
3465
|
-
|
|
3466
|
-
type:
|
|
3467
|
-
id:
|
|
3468
|
-
encrypted_content:
|
|
3575
|
+
z18.object({
|
|
3576
|
+
type: z18.literal("reasoning"),
|
|
3577
|
+
id: z18.string(),
|
|
3578
|
+
encrypted_content: z18.string().nullish()
|
|
3469
3579
|
}),
|
|
3470
|
-
|
|
3471
|
-
type:
|
|
3472
|
-
id:
|
|
3473
|
-
call_id:
|
|
3474
|
-
name:
|
|
3475
|
-
arguments:
|
|
3476
|
-
status:
|
|
3580
|
+
z18.object({
|
|
3581
|
+
type: z18.literal("function_call"),
|
|
3582
|
+
id: z18.string(),
|
|
3583
|
+
call_id: z18.string(),
|
|
3584
|
+
name: z18.string(),
|
|
3585
|
+
arguments: z18.string(),
|
|
3586
|
+
status: z18.literal("completed")
|
|
3477
3587
|
}),
|
|
3478
|
-
|
|
3479
|
-
type:
|
|
3480
|
-
id:
|
|
3481
|
-
call_id:
|
|
3482
|
-
name:
|
|
3483
|
-
input:
|
|
3484
|
-
status:
|
|
3588
|
+
z18.object({
|
|
3589
|
+
type: z18.literal("custom_tool_call"),
|
|
3590
|
+
id: z18.string(),
|
|
3591
|
+
call_id: z18.string(),
|
|
3592
|
+
name: z18.string(),
|
|
3593
|
+
input: z18.string(),
|
|
3594
|
+
status: z18.literal("completed")
|
|
3485
3595
|
}),
|
|
3486
|
-
|
|
3487
|
-
type:
|
|
3488
|
-
id:
|
|
3489
|
-
code:
|
|
3490
|
-
container_id:
|
|
3491
|
-
outputs:
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3596
|
+
z18.object({
|
|
3597
|
+
type: z18.literal("code_interpreter_call"),
|
|
3598
|
+
id: z18.string(),
|
|
3599
|
+
code: z18.string().nullable(),
|
|
3600
|
+
container_id: z18.string(),
|
|
3601
|
+
outputs: z18.array(
|
|
3602
|
+
z18.discriminatedUnion("type", [
|
|
3603
|
+
z18.object({ type: z18.literal("logs"), logs: z18.string() }),
|
|
3604
|
+
z18.object({ type: z18.literal("image"), url: z18.string() })
|
|
3495
3605
|
])
|
|
3496
3606
|
).nullable()
|
|
3497
3607
|
}),
|
|
3498
|
-
|
|
3499
|
-
type:
|
|
3500
|
-
id:
|
|
3501
|
-
result:
|
|
3608
|
+
z18.object({
|
|
3609
|
+
type: z18.literal("image_generation_call"),
|
|
3610
|
+
id: z18.string(),
|
|
3611
|
+
result: z18.string()
|
|
3502
3612
|
}),
|
|
3503
|
-
|
|
3504
|
-
type:
|
|
3505
|
-
id:
|
|
3506
|
-
status:
|
|
3507
|
-
action:
|
|
3508
|
-
|
|
3509
|
-
type:
|
|
3510
|
-
query:
|
|
3511
|
-
sources:
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3613
|
+
z18.object({
|
|
3614
|
+
type: z18.literal("web_search_call"),
|
|
3615
|
+
id: z18.string(),
|
|
3616
|
+
status: z18.string(),
|
|
3617
|
+
action: z18.discriminatedUnion("type", [
|
|
3618
|
+
z18.object({
|
|
3619
|
+
type: z18.literal("search"),
|
|
3620
|
+
query: z18.string().nullish(),
|
|
3621
|
+
sources: z18.array(
|
|
3622
|
+
z18.discriminatedUnion("type", [
|
|
3623
|
+
z18.object({ type: z18.literal("url"), url: z18.string() }),
|
|
3624
|
+
z18.object({ type: z18.literal("api"), name: z18.string() })
|
|
3515
3625
|
])
|
|
3516
3626
|
).nullish()
|
|
3517
3627
|
}),
|
|
3518
|
-
|
|
3519
|
-
type:
|
|
3520
|
-
url:
|
|
3628
|
+
z18.object({
|
|
3629
|
+
type: z18.literal("open_page"),
|
|
3630
|
+
url: z18.string().nullish()
|
|
3521
3631
|
}),
|
|
3522
|
-
|
|
3523
|
-
type:
|
|
3524
|
-
url:
|
|
3525
|
-
pattern:
|
|
3632
|
+
z18.object({
|
|
3633
|
+
type: z18.literal("find_in_page"),
|
|
3634
|
+
url: z18.string().nullish(),
|
|
3635
|
+
pattern: z18.string().nullish()
|
|
3526
3636
|
})
|
|
3527
3637
|
]).nullish()
|
|
3528
3638
|
}),
|
|
3529
|
-
|
|
3530
|
-
type:
|
|
3531
|
-
id:
|
|
3532
|
-
queries:
|
|
3533
|
-
results:
|
|
3534
|
-
|
|
3535
|
-
attributes:
|
|
3536
|
-
|
|
3537
|
-
|
|
3639
|
+
z18.object({
|
|
3640
|
+
type: z18.literal("file_search_call"),
|
|
3641
|
+
id: z18.string(),
|
|
3642
|
+
queries: z18.array(z18.string()),
|
|
3643
|
+
results: z18.array(
|
|
3644
|
+
z18.object({
|
|
3645
|
+
attributes: z18.record(
|
|
3646
|
+
z18.string(),
|
|
3647
|
+
z18.union([z18.string(), z18.number(), z18.boolean()])
|
|
3538
3648
|
),
|
|
3539
|
-
file_id:
|
|
3540
|
-
filename:
|
|
3541
|
-
score:
|
|
3542
|
-
text:
|
|
3649
|
+
file_id: z18.string(),
|
|
3650
|
+
filename: z18.string(),
|
|
3651
|
+
score: z18.number(),
|
|
3652
|
+
text: z18.string()
|
|
3543
3653
|
})
|
|
3544
3654
|
).nullish()
|
|
3545
3655
|
}),
|
|
3546
|
-
|
|
3547
|
-
type:
|
|
3548
|
-
id:
|
|
3549
|
-
call_id:
|
|
3550
|
-
action:
|
|
3551
|
-
type:
|
|
3552
|
-
command:
|
|
3553
|
-
timeout_ms:
|
|
3554
|
-
user:
|
|
3555
|
-
working_directory:
|
|
3556
|
-
env:
|
|
3656
|
+
z18.object({
|
|
3657
|
+
type: z18.literal("local_shell_call"),
|
|
3658
|
+
id: z18.string(),
|
|
3659
|
+
call_id: z18.string(),
|
|
3660
|
+
action: z18.object({
|
|
3661
|
+
type: z18.literal("exec"),
|
|
3662
|
+
command: z18.array(z18.string()),
|
|
3663
|
+
timeout_ms: z18.number().optional(),
|
|
3664
|
+
user: z18.string().optional(),
|
|
3665
|
+
working_directory: z18.string().optional(),
|
|
3666
|
+
env: z18.record(z18.string(), z18.string()).optional()
|
|
3557
3667
|
})
|
|
3558
3668
|
}),
|
|
3559
|
-
|
|
3560
|
-
type:
|
|
3561
|
-
id:
|
|
3562
|
-
status:
|
|
3669
|
+
z18.object({
|
|
3670
|
+
type: z18.literal("computer_call"),
|
|
3671
|
+
id: z18.string(),
|
|
3672
|
+
status: z18.literal("completed")
|
|
3563
3673
|
}),
|
|
3564
|
-
|
|
3565
|
-
type:
|
|
3566
|
-
id:
|
|
3567
|
-
status:
|
|
3568
|
-
arguments:
|
|
3569
|
-
name:
|
|
3570
|
-
server_label:
|
|
3571
|
-
output:
|
|
3572
|
-
error:
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
type:
|
|
3576
|
-
code:
|
|
3577
|
-
message:
|
|
3674
|
+
z18.object({
|
|
3675
|
+
type: z18.literal("mcp_call"),
|
|
3676
|
+
id: z18.string(),
|
|
3677
|
+
status: z18.string(),
|
|
3678
|
+
arguments: z18.string(),
|
|
3679
|
+
name: z18.string(),
|
|
3680
|
+
server_label: z18.string(),
|
|
3681
|
+
output: z18.string().nullish(),
|
|
3682
|
+
error: z18.union([
|
|
3683
|
+
z18.string(),
|
|
3684
|
+
z18.object({
|
|
3685
|
+
type: z18.string().optional(),
|
|
3686
|
+
code: z18.union([z18.number(), z18.string()]).optional(),
|
|
3687
|
+
message: z18.string().optional()
|
|
3578
3688
|
}).loose()
|
|
3579
3689
|
]).nullish(),
|
|
3580
|
-
approval_request_id:
|
|
3690
|
+
approval_request_id: z18.string().nullish()
|
|
3581
3691
|
}),
|
|
3582
|
-
|
|
3583
|
-
type:
|
|
3584
|
-
id:
|
|
3585
|
-
server_label:
|
|
3586
|
-
tools:
|
|
3587
|
-
|
|
3588
|
-
name:
|
|
3589
|
-
description:
|
|
3590
|
-
input_schema:
|
|
3591
|
-
annotations:
|
|
3692
|
+
z18.object({
|
|
3693
|
+
type: z18.literal("mcp_list_tools"),
|
|
3694
|
+
id: z18.string(),
|
|
3695
|
+
server_label: z18.string(),
|
|
3696
|
+
tools: z18.array(
|
|
3697
|
+
z18.object({
|
|
3698
|
+
name: z18.string(),
|
|
3699
|
+
description: z18.string().optional(),
|
|
3700
|
+
input_schema: z18.any(),
|
|
3701
|
+
annotations: z18.record(z18.string(), z18.unknown()).optional()
|
|
3592
3702
|
})
|
|
3593
3703
|
),
|
|
3594
|
-
error:
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
type:
|
|
3598
|
-
code:
|
|
3599
|
-
message:
|
|
3704
|
+
error: z18.union([
|
|
3705
|
+
z18.string(),
|
|
3706
|
+
z18.object({
|
|
3707
|
+
type: z18.string().optional(),
|
|
3708
|
+
code: z18.union([z18.number(), z18.string()]).optional(),
|
|
3709
|
+
message: z18.string().optional()
|
|
3600
3710
|
}).loose()
|
|
3601
3711
|
]).optional()
|
|
3602
3712
|
}),
|
|
3603
|
-
|
|
3604
|
-
type:
|
|
3605
|
-
id:
|
|
3606
|
-
server_label:
|
|
3607
|
-
name:
|
|
3608
|
-
arguments:
|
|
3609
|
-
approval_request_id:
|
|
3713
|
+
z18.object({
|
|
3714
|
+
type: z18.literal("mcp_approval_request"),
|
|
3715
|
+
id: z18.string(),
|
|
3716
|
+
server_label: z18.string(),
|
|
3717
|
+
name: z18.string(),
|
|
3718
|
+
arguments: z18.string(),
|
|
3719
|
+
approval_request_id: z18.string().optional()
|
|
3610
3720
|
}),
|
|
3611
|
-
|
|
3612
|
-
type:
|
|
3613
|
-
id:
|
|
3614
|
-
call_id:
|
|
3615
|
-
status:
|
|
3616
|
-
operation:
|
|
3617
|
-
|
|
3618
|
-
type:
|
|
3619
|
-
path:
|
|
3620
|
-
diff:
|
|
3721
|
+
z18.object({
|
|
3722
|
+
type: z18.literal("apply_patch_call"),
|
|
3723
|
+
id: z18.string(),
|
|
3724
|
+
call_id: z18.string(),
|
|
3725
|
+
status: z18.enum(["in_progress", "completed"]),
|
|
3726
|
+
operation: z18.discriminatedUnion("type", [
|
|
3727
|
+
z18.object({
|
|
3728
|
+
type: z18.literal("create_file"),
|
|
3729
|
+
path: z18.string(),
|
|
3730
|
+
diff: z18.string()
|
|
3621
3731
|
}),
|
|
3622
|
-
|
|
3623
|
-
type:
|
|
3624
|
-
path:
|
|
3732
|
+
z18.object({
|
|
3733
|
+
type: z18.literal("delete_file"),
|
|
3734
|
+
path: z18.string()
|
|
3625
3735
|
}),
|
|
3626
|
-
|
|
3627
|
-
type:
|
|
3628
|
-
path:
|
|
3629
|
-
diff:
|
|
3736
|
+
z18.object({
|
|
3737
|
+
type: z18.literal("update_file"),
|
|
3738
|
+
path: z18.string(),
|
|
3739
|
+
diff: z18.string()
|
|
3630
3740
|
})
|
|
3631
3741
|
])
|
|
3632
3742
|
}),
|
|
3633
|
-
|
|
3634
|
-
type:
|
|
3635
|
-
id:
|
|
3636
|
-
call_id:
|
|
3637
|
-
status:
|
|
3638
|
-
action:
|
|
3639
|
-
commands:
|
|
3743
|
+
z18.object({
|
|
3744
|
+
type: z18.literal("shell_call"),
|
|
3745
|
+
id: z18.string(),
|
|
3746
|
+
call_id: z18.string(),
|
|
3747
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
3748
|
+
action: z18.object({
|
|
3749
|
+
commands: z18.array(z18.string())
|
|
3640
3750
|
})
|
|
3641
3751
|
}),
|
|
3642
|
-
|
|
3643
|
-
type:
|
|
3644
|
-
id:
|
|
3645
|
-
call_id:
|
|
3646
|
-
status:
|
|
3647
|
-
output:
|
|
3648
|
-
|
|
3649
|
-
stdout:
|
|
3650
|
-
stderr:
|
|
3651
|
-
outcome:
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
type:
|
|
3655
|
-
exit_code:
|
|
3752
|
+
z18.object({
|
|
3753
|
+
type: z18.literal("shell_call_output"),
|
|
3754
|
+
id: z18.string(),
|
|
3755
|
+
call_id: z18.string(),
|
|
3756
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
3757
|
+
output: z18.array(
|
|
3758
|
+
z18.object({
|
|
3759
|
+
stdout: z18.string(),
|
|
3760
|
+
stderr: z18.string(),
|
|
3761
|
+
outcome: z18.discriminatedUnion("type", [
|
|
3762
|
+
z18.object({ type: z18.literal("timeout") }),
|
|
3763
|
+
z18.object({
|
|
3764
|
+
type: z18.literal("exit"),
|
|
3765
|
+
exit_code: z18.number()
|
|
3656
3766
|
})
|
|
3657
3767
|
])
|
|
3658
3768
|
})
|
|
3659
3769
|
)
|
|
3660
3770
|
}),
|
|
3661
|
-
|
|
3662
|
-
type:
|
|
3663
|
-
id:
|
|
3664
|
-
execution:
|
|
3665
|
-
call_id:
|
|
3666
|
-
status:
|
|
3667
|
-
arguments:
|
|
3771
|
+
z18.object({
|
|
3772
|
+
type: z18.literal("tool_search_call"),
|
|
3773
|
+
id: z18.string(),
|
|
3774
|
+
execution: z18.enum(["server", "client"]),
|
|
3775
|
+
call_id: z18.string().nullable(),
|
|
3776
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
3777
|
+
arguments: z18.unknown()
|
|
3668
3778
|
}),
|
|
3669
|
-
|
|
3670
|
-
type:
|
|
3671
|
-
id:
|
|
3672
|
-
execution:
|
|
3673
|
-
call_id:
|
|
3674
|
-
status:
|
|
3675
|
-
tools:
|
|
3779
|
+
z18.object({
|
|
3780
|
+
type: z18.literal("tool_search_output"),
|
|
3781
|
+
id: z18.string(),
|
|
3782
|
+
execution: z18.enum(["server", "client"]),
|
|
3783
|
+
call_id: z18.string().nullable(),
|
|
3784
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
3785
|
+
tools: z18.array(z18.record(z18.string(), jsonValueSchema.optional()))
|
|
3676
3786
|
})
|
|
3677
3787
|
])
|
|
3678
3788
|
}),
|
|
3679
|
-
|
|
3680
|
-
type:
|
|
3681
|
-
item_id:
|
|
3682
|
-
output_index:
|
|
3683
|
-
delta:
|
|
3789
|
+
z18.object({
|
|
3790
|
+
type: z18.literal("response.function_call_arguments.delta"),
|
|
3791
|
+
item_id: z18.string(),
|
|
3792
|
+
output_index: z18.number(),
|
|
3793
|
+
delta: z18.string()
|
|
3684
3794
|
}),
|
|
3685
|
-
|
|
3686
|
-
type:
|
|
3687
|
-
item_id:
|
|
3688
|
-
output_index:
|
|
3689
|
-
delta:
|
|
3795
|
+
z18.object({
|
|
3796
|
+
type: z18.literal("response.custom_tool_call_input.delta"),
|
|
3797
|
+
item_id: z18.string(),
|
|
3798
|
+
output_index: z18.number(),
|
|
3799
|
+
delta: z18.string()
|
|
3690
3800
|
}),
|
|
3691
|
-
|
|
3692
|
-
type:
|
|
3693
|
-
item_id:
|
|
3694
|
-
output_index:
|
|
3695
|
-
partial_image_b64:
|
|
3801
|
+
z18.object({
|
|
3802
|
+
type: z18.literal("response.image_generation_call.partial_image"),
|
|
3803
|
+
item_id: z18.string(),
|
|
3804
|
+
output_index: z18.number(),
|
|
3805
|
+
partial_image_b64: z18.string()
|
|
3696
3806
|
}),
|
|
3697
|
-
|
|
3698
|
-
type:
|
|
3699
|
-
item_id:
|
|
3700
|
-
output_index:
|
|
3701
|
-
delta:
|
|
3807
|
+
z18.object({
|
|
3808
|
+
type: z18.literal("response.code_interpreter_call_code.delta"),
|
|
3809
|
+
item_id: z18.string(),
|
|
3810
|
+
output_index: z18.number(),
|
|
3811
|
+
delta: z18.string()
|
|
3702
3812
|
}),
|
|
3703
|
-
|
|
3704
|
-
type:
|
|
3705
|
-
item_id:
|
|
3706
|
-
output_index:
|
|
3707
|
-
code:
|
|
3813
|
+
z18.object({
|
|
3814
|
+
type: z18.literal("response.code_interpreter_call_code.done"),
|
|
3815
|
+
item_id: z18.string(),
|
|
3816
|
+
output_index: z18.number(),
|
|
3817
|
+
code: z18.string()
|
|
3708
3818
|
}),
|
|
3709
|
-
|
|
3710
|
-
type:
|
|
3711
|
-
annotation:
|
|
3712
|
-
|
|
3713
|
-
type:
|
|
3714
|
-
start_index:
|
|
3715
|
-
end_index:
|
|
3716
|
-
url:
|
|
3717
|
-
title:
|
|
3819
|
+
z18.object({
|
|
3820
|
+
type: z18.literal("response.output_text.annotation.added"),
|
|
3821
|
+
annotation: z18.discriminatedUnion("type", [
|
|
3822
|
+
z18.object({
|
|
3823
|
+
type: z18.literal("url_citation"),
|
|
3824
|
+
start_index: z18.number(),
|
|
3825
|
+
end_index: z18.number(),
|
|
3826
|
+
url: z18.string(),
|
|
3827
|
+
title: z18.string()
|
|
3718
3828
|
}),
|
|
3719
|
-
|
|
3720
|
-
type:
|
|
3721
|
-
file_id:
|
|
3722
|
-
filename:
|
|
3723
|
-
index:
|
|
3829
|
+
z18.object({
|
|
3830
|
+
type: z18.literal("file_citation"),
|
|
3831
|
+
file_id: z18.string(),
|
|
3832
|
+
filename: z18.string(),
|
|
3833
|
+
index: z18.number()
|
|
3724
3834
|
}),
|
|
3725
|
-
|
|
3726
|
-
type:
|
|
3727
|
-
container_id:
|
|
3728
|
-
file_id:
|
|
3729
|
-
filename:
|
|
3730
|
-
start_index:
|
|
3731
|
-
end_index:
|
|
3835
|
+
z18.object({
|
|
3836
|
+
type: z18.literal("container_file_citation"),
|
|
3837
|
+
container_id: z18.string(),
|
|
3838
|
+
file_id: z18.string(),
|
|
3839
|
+
filename: z18.string(),
|
|
3840
|
+
start_index: z18.number(),
|
|
3841
|
+
end_index: z18.number()
|
|
3732
3842
|
}),
|
|
3733
|
-
|
|
3734
|
-
type:
|
|
3735
|
-
file_id:
|
|
3736
|
-
index:
|
|
3843
|
+
z18.object({
|
|
3844
|
+
type: z18.literal("file_path"),
|
|
3845
|
+
file_id: z18.string(),
|
|
3846
|
+
index: z18.number()
|
|
3737
3847
|
})
|
|
3738
3848
|
])
|
|
3739
3849
|
}),
|
|
3740
|
-
|
|
3741
|
-
type:
|
|
3742
|
-
item_id:
|
|
3743
|
-
summary_index:
|
|
3850
|
+
z18.object({
|
|
3851
|
+
type: z18.literal("response.reasoning_summary_part.added"),
|
|
3852
|
+
item_id: z18.string(),
|
|
3853
|
+
summary_index: z18.number()
|
|
3744
3854
|
}),
|
|
3745
|
-
|
|
3746
|
-
type:
|
|
3747
|
-
item_id:
|
|
3748
|
-
summary_index:
|
|
3749
|
-
delta:
|
|
3855
|
+
z18.object({
|
|
3856
|
+
type: z18.literal("response.reasoning_summary_text.delta"),
|
|
3857
|
+
item_id: z18.string(),
|
|
3858
|
+
summary_index: z18.number(),
|
|
3859
|
+
delta: z18.string()
|
|
3750
3860
|
}),
|
|
3751
|
-
|
|
3752
|
-
type:
|
|
3753
|
-
item_id:
|
|
3754
|
-
summary_index:
|
|
3861
|
+
z18.object({
|
|
3862
|
+
type: z18.literal("response.reasoning_summary_part.done"),
|
|
3863
|
+
item_id: z18.string(),
|
|
3864
|
+
summary_index: z18.number()
|
|
3755
3865
|
}),
|
|
3756
|
-
|
|
3757
|
-
type:
|
|
3758
|
-
item_id:
|
|
3759
|
-
output_index:
|
|
3760
|
-
delta:
|
|
3761
|
-
obfuscation:
|
|
3866
|
+
z18.object({
|
|
3867
|
+
type: z18.literal("response.apply_patch_call_operation_diff.delta"),
|
|
3868
|
+
item_id: z18.string(),
|
|
3869
|
+
output_index: z18.number(),
|
|
3870
|
+
delta: z18.string(),
|
|
3871
|
+
obfuscation: z18.string().nullish()
|
|
3762
3872
|
}),
|
|
3763
|
-
|
|
3764
|
-
type:
|
|
3765
|
-
item_id:
|
|
3766
|
-
output_index:
|
|
3767
|
-
diff:
|
|
3873
|
+
z18.object({
|
|
3874
|
+
type: z18.literal("response.apply_patch_call_operation_diff.done"),
|
|
3875
|
+
item_id: z18.string(),
|
|
3876
|
+
output_index: z18.number(),
|
|
3877
|
+
diff: z18.string()
|
|
3768
3878
|
}),
|
|
3769
|
-
|
|
3770
|
-
type:
|
|
3771
|
-
sequence_number:
|
|
3772
|
-
error:
|
|
3773
|
-
type:
|
|
3774
|
-
code:
|
|
3775
|
-
message:
|
|
3776
|
-
param:
|
|
3879
|
+
z18.object({
|
|
3880
|
+
type: z18.literal("error"),
|
|
3881
|
+
sequence_number: z18.number(),
|
|
3882
|
+
error: z18.object({
|
|
3883
|
+
type: z18.string(),
|
|
3884
|
+
code: z18.string(),
|
|
3885
|
+
message: z18.string(),
|
|
3886
|
+
param: z18.string().nullish()
|
|
3777
3887
|
})
|
|
3778
3888
|
}),
|
|
3779
|
-
|
|
3889
|
+
z18.object({ type: z18.string() }).loose().transform((value) => ({
|
|
3780
3890
|
type: "unknown_chunk",
|
|
3781
3891
|
message: value.type
|
|
3782
3892
|
}))
|
|
@@ -3784,310 +3894,313 @@ var openaiResponsesChunkSchema = lazySchema15(
|
|
|
3784
3894
|
])
|
|
3785
3895
|
)
|
|
3786
3896
|
);
|
|
3787
|
-
var openaiResponsesResponseSchema =
|
|
3788
|
-
() =>
|
|
3789
|
-
|
|
3790
|
-
id:
|
|
3791
|
-
created_at:
|
|
3792
|
-
error:
|
|
3793
|
-
message:
|
|
3794
|
-
type:
|
|
3795
|
-
param:
|
|
3796
|
-
code:
|
|
3897
|
+
var openaiResponsesResponseSchema = lazySchema16(
|
|
3898
|
+
() => zodSchema16(
|
|
3899
|
+
z18.object({
|
|
3900
|
+
id: z18.string().optional(),
|
|
3901
|
+
created_at: z18.number().optional(),
|
|
3902
|
+
error: z18.object({
|
|
3903
|
+
message: z18.string(),
|
|
3904
|
+
type: z18.string(),
|
|
3905
|
+
param: z18.string().nullish(),
|
|
3906
|
+
code: z18.string()
|
|
3797
3907
|
}).nullish(),
|
|
3798
|
-
model:
|
|
3799
|
-
output:
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
type:
|
|
3803
|
-
role:
|
|
3804
|
-
id:
|
|
3805
|
-
phase:
|
|
3806
|
-
content:
|
|
3807
|
-
|
|
3808
|
-
type:
|
|
3809
|
-
text:
|
|
3810
|
-
logprobs:
|
|
3811
|
-
|
|
3812
|
-
token:
|
|
3813
|
-
logprob:
|
|
3814
|
-
top_logprobs:
|
|
3815
|
-
|
|
3816
|
-
token:
|
|
3817
|
-
logprob:
|
|
3908
|
+
model: z18.string().optional(),
|
|
3909
|
+
output: z18.array(
|
|
3910
|
+
z18.discriminatedUnion("type", [
|
|
3911
|
+
z18.object({
|
|
3912
|
+
type: z18.literal("message"),
|
|
3913
|
+
role: z18.literal("assistant"),
|
|
3914
|
+
id: z18.string(),
|
|
3915
|
+
phase: z18.enum(["commentary", "final_answer"]).nullish(),
|
|
3916
|
+
content: z18.array(
|
|
3917
|
+
z18.object({
|
|
3918
|
+
type: z18.literal("output_text"),
|
|
3919
|
+
text: z18.string(),
|
|
3920
|
+
logprobs: z18.array(
|
|
3921
|
+
z18.object({
|
|
3922
|
+
token: z18.string(),
|
|
3923
|
+
logprob: z18.number(),
|
|
3924
|
+
top_logprobs: z18.array(
|
|
3925
|
+
z18.object({
|
|
3926
|
+
token: z18.string(),
|
|
3927
|
+
logprob: z18.number()
|
|
3818
3928
|
})
|
|
3819
3929
|
)
|
|
3820
3930
|
})
|
|
3821
3931
|
).nullish(),
|
|
3822
|
-
annotations:
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
type:
|
|
3826
|
-
start_index:
|
|
3827
|
-
end_index:
|
|
3828
|
-
url:
|
|
3829
|
-
title:
|
|
3932
|
+
annotations: z18.array(
|
|
3933
|
+
z18.discriminatedUnion("type", [
|
|
3934
|
+
z18.object({
|
|
3935
|
+
type: z18.literal("url_citation"),
|
|
3936
|
+
start_index: z18.number(),
|
|
3937
|
+
end_index: z18.number(),
|
|
3938
|
+
url: z18.string(),
|
|
3939
|
+
title: z18.string()
|
|
3830
3940
|
}),
|
|
3831
|
-
|
|
3832
|
-
type:
|
|
3833
|
-
file_id:
|
|
3834
|
-
filename:
|
|
3835
|
-
index:
|
|
3941
|
+
z18.object({
|
|
3942
|
+
type: z18.literal("file_citation"),
|
|
3943
|
+
file_id: z18.string(),
|
|
3944
|
+
filename: z18.string(),
|
|
3945
|
+
index: z18.number()
|
|
3836
3946
|
}),
|
|
3837
|
-
|
|
3838
|
-
type:
|
|
3839
|
-
container_id:
|
|
3840
|
-
file_id:
|
|
3841
|
-
filename:
|
|
3842
|
-
start_index:
|
|
3843
|
-
end_index:
|
|
3947
|
+
z18.object({
|
|
3948
|
+
type: z18.literal("container_file_citation"),
|
|
3949
|
+
container_id: z18.string(),
|
|
3950
|
+
file_id: z18.string(),
|
|
3951
|
+
filename: z18.string(),
|
|
3952
|
+
start_index: z18.number(),
|
|
3953
|
+
end_index: z18.number()
|
|
3844
3954
|
}),
|
|
3845
|
-
|
|
3846
|
-
type:
|
|
3847
|
-
file_id:
|
|
3848
|
-
index:
|
|
3955
|
+
z18.object({
|
|
3956
|
+
type: z18.literal("file_path"),
|
|
3957
|
+
file_id: z18.string(),
|
|
3958
|
+
index: z18.number()
|
|
3849
3959
|
})
|
|
3850
3960
|
])
|
|
3851
3961
|
)
|
|
3852
3962
|
})
|
|
3853
3963
|
)
|
|
3854
3964
|
}),
|
|
3855
|
-
|
|
3856
|
-
type:
|
|
3857
|
-
id:
|
|
3858
|
-
status:
|
|
3859
|
-
action:
|
|
3860
|
-
|
|
3861
|
-
type:
|
|
3862
|
-
query:
|
|
3863
|
-
sources:
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
type:
|
|
3868
|
-
name:
|
|
3965
|
+
z18.object({
|
|
3966
|
+
type: z18.literal("web_search_call"),
|
|
3967
|
+
id: z18.string(),
|
|
3968
|
+
status: z18.string(),
|
|
3969
|
+
action: z18.discriminatedUnion("type", [
|
|
3970
|
+
z18.object({
|
|
3971
|
+
type: z18.literal("search"),
|
|
3972
|
+
query: z18.string().nullish(),
|
|
3973
|
+
sources: z18.array(
|
|
3974
|
+
z18.discriminatedUnion("type", [
|
|
3975
|
+
z18.object({ type: z18.literal("url"), url: z18.string() }),
|
|
3976
|
+
z18.object({
|
|
3977
|
+
type: z18.literal("api"),
|
|
3978
|
+
name: z18.string()
|
|
3869
3979
|
})
|
|
3870
3980
|
])
|
|
3871
3981
|
).nullish()
|
|
3872
3982
|
}),
|
|
3873
|
-
|
|
3874
|
-
type:
|
|
3875
|
-
url:
|
|
3983
|
+
z18.object({
|
|
3984
|
+
type: z18.literal("open_page"),
|
|
3985
|
+
url: z18.string().nullish()
|
|
3876
3986
|
}),
|
|
3877
|
-
|
|
3878
|
-
type:
|
|
3879
|
-
url:
|
|
3880
|
-
pattern:
|
|
3987
|
+
z18.object({
|
|
3988
|
+
type: z18.literal("find_in_page"),
|
|
3989
|
+
url: z18.string().nullish(),
|
|
3990
|
+
pattern: z18.string().nullish()
|
|
3881
3991
|
})
|
|
3882
3992
|
]).nullish()
|
|
3883
3993
|
}),
|
|
3884
|
-
|
|
3885
|
-
type:
|
|
3886
|
-
id:
|
|
3887
|
-
queries:
|
|
3888
|
-
results:
|
|
3889
|
-
|
|
3890
|
-
attributes:
|
|
3891
|
-
|
|
3892
|
-
|
|
3994
|
+
z18.object({
|
|
3995
|
+
type: z18.literal("file_search_call"),
|
|
3996
|
+
id: z18.string(),
|
|
3997
|
+
queries: z18.array(z18.string()),
|
|
3998
|
+
results: z18.array(
|
|
3999
|
+
z18.object({
|
|
4000
|
+
attributes: z18.record(
|
|
4001
|
+
z18.string(),
|
|
4002
|
+
z18.union([z18.string(), z18.number(), z18.boolean()])
|
|
3893
4003
|
),
|
|
3894
|
-
file_id:
|
|
3895
|
-
filename:
|
|
3896
|
-
score:
|
|
3897
|
-
text:
|
|
4004
|
+
file_id: z18.string(),
|
|
4005
|
+
filename: z18.string(),
|
|
4006
|
+
score: z18.number(),
|
|
4007
|
+
text: z18.string()
|
|
3898
4008
|
})
|
|
3899
4009
|
).nullish()
|
|
3900
4010
|
}),
|
|
3901
|
-
|
|
3902
|
-
type:
|
|
3903
|
-
id:
|
|
3904
|
-
code:
|
|
3905
|
-
container_id:
|
|
3906
|
-
outputs:
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
4011
|
+
z18.object({
|
|
4012
|
+
type: z18.literal("code_interpreter_call"),
|
|
4013
|
+
id: z18.string(),
|
|
4014
|
+
code: z18.string().nullable(),
|
|
4015
|
+
container_id: z18.string(),
|
|
4016
|
+
outputs: z18.array(
|
|
4017
|
+
z18.discriminatedUnion("type", [
|
|
4018
|
+
z18.object({ type: z18.literal("logs"), logs: z18.string() }),
|
|
4019
|
+
z18.object({ type: z18.literal("image"), url: z18.string() })
|
|
3910
4020
|
])
|
|
3911
4021
|
).nullable()
|
|
3912
4022
|
}),
|
|
3913
|
-
|
|
3914
|
-
type:
|
|
3915
|
-
id:
|
|
3916
|
-
result:
|
|
4023
|
+
z18.object({
|
|
4024
|
+
type: z18.literal("image_generation_call"),
|
|
4025
|
+
id: z18.string(),
|
|
4026
|
+
result: z18.string()
|
|
3917
4027
|
}),
|
|
3918
|
-
|
|
3919
|
-
type:
|
|
3920
|
-
id:
|
|
3921
|
-
call_id:
|
|
3922
|
-
action:
|
|
3923
|
-
type:
|
|
3924
|
-
command:
|
|
3925
|
-
timeout_ms:
|
|
3926
|
-
user:
|
|
3927
|
-
working_directory:
|
|
3928
|
-
env:
|
|
4028
|
+
z18.object({
|
|
4029
|
+
type: z18.literal("local_shell_call"),
|
|
4030
|
+
id: z18.string(),
|
|
4031
|
+
call_id: z18.string(),
|
|
4032
|
+
action: z18.object({
|
|
4033
|
+
type: z18.literal("exec"),
|
|
4034
|
+
command: z18.array(z18.string()),
|
|
4035
|
+
timeout_ms: z18.number().optional(),
|
|
4036
|
+
user: z18.string().optional(),
|
|
4037
|
+
working_directory: z18.string().optional(),
|
|
4038
|
+
env: z18.record(z18.string(), z18.string()).optional()
|
|
3929
4039
|
})
|
|
3930
4040
|
}),
|
|
3931
|
-
|
|
3932
|
-
type:
|
|
3933
|
-
call_id:
|
|
3934
|
-
name:
|
|
3935
|
-
arguments:
|
|
3936
|
-
id:
|
|
4041
|
+
z18.object({
|
|
4042
|
+
type: z18.literal("function_call"),
|
|
4043
|
+
call_id: z18.string(),
|
|
4044
|
+
name: z18.string(),
|
|
4045
|
+
arguments: z18.string(),
|
|
4046
|
+
id: z18.string()
|
|
3937
4047
|
}),
|
|
3938
|
-
|
|
3939
|
-
type:
|
|
3940
|
-
call_id:
|
|
3941
|
-
name:
|
|
3942
|
-
input:
|
|
3943
|
-
id:
|
|
4048
|
+
z18.object({
|
|
4049
|
+
type: z18.literal("custom_tool_call"),
|
|
4050
|
+
call_id: z18.string(),
|
|
4051
|
+
name: z18.string(),
|
|
4052
|
+
input: z18.string(),
|
|
4053
|
+
id: z18.string()
|
|
3944
4054
|
}),
|
|
3945
|
-
|
|
3946
|
-
type:
|
|
3947
|
-
id:
|
|
3948
|
-
status:
|
|
4055
|
+
z18.object({
|
|
4056
|
+
type: z18.literal("computer_call"),
|
|
4057
|
+
id: z18.string(),
|
|
4058
|
+
status: z18.string().optional()
|
|
3949
4059
|
}),
|
|
3950
|
-
|
|
3951
|
-
type:
|
|
3952
|
-
id:
|
|
3953
|
-
encrypted_content:
|
|
3954
|
-
summary:
|
|
3955
|
-
|
|
3956
|
-
type:
|
|
3957
|
-
text:
|
|
4060
|
+
z18.object({
|
|
4061
|
+
type: z18.literal("reasoning"),
|
|
4062
|
+
id: z18.string(),
|
|
4063
|
+
encrypted_content: z18.string().nullish(),
|
|
4064
|
+
summary: z18.array(
|
|
4065
|
+
z18.object({
|
|
4066
|
+
type: z18.literal("summary_text"),
|
|
4067
|
+
text: z18.string()
|
|
3958
4068
|
})
|
|
3959
4069
|
)
|
|
3960
4070
|
}),
|
|
3961
|
-
|
|
3962
|
-
type:
|
|
3963
|
-
id:
|
|
3964
|
-
status:
|
|
3965
|
-
arguments:
|
|
3966
|
-
name:
|
|
3967
|
-
server_label:
|
|
3968
|
-
output:
|
|
3969
|
-
error:
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
type:
|
|
3973
|
-
code:
|
|
3974
|
-
message:
|
|
4071
|
+
z18.object({
|
|
4072
|
+
type: z18.literal("mcp_call"),
|
|
4073
|
+
id: z18.string(),
|
|
4074
|
+
status: z18.string(),
|
|
4075
|
+
arguments: z18.string(),
|
|
4076
|
+
name: z18.string(),
|
|
4077
|
+
server_label: z18.string(),
|
|
4078
|
+
output: z18.string().nullish(),
|
|
4079
|
+
error: z18.union([
|
|
4080
|
+
z18.string(),
|
|
4081
|
+
z18.object({
|
|
4082
|
+
type: z18.string().optional(),
|
|
4083
|
+
code: z18.union([z18.number(), z18.string()]).optional(),
|
|
4084
|
+
message: z18.string().optional()
|
|
3975
4085
|
}).loose()
|
|
3976
4086
|
]).nullish(),
|
|
3977
|
-
approval_request_id:
|
|
4087
|
+
approval_request_id: z18.string().nullish()
|
|
3978
4088
|
}),
|
|
3979
|
-
|
|
3980
|
-
type:
|
|
3981
|
-
id:
|
|
3982
|
-
server_label:
|
|
3983
|
-
tools:
|
|
3984
|
-
|
|
3985
|
-
name:
|
|
3986
|
-
description:
|
|
3987
|
-
input_schema:
|
|
3988
|
-
annotations:
|
|
4089
|
+
z18.object({
|
|
4090
|
+
type: z18.literal("mcp_list_tools"),
|
|
4091
|
+
id: z18.string(),
|
|
4092
|
+
server_label: z18.string(),
|
|
4093
|
+
tools: z18.array(
|
|
4094
|
+
z18.object({
|
|
4095
|
+
name: z18.string(),
|
|
4096
|
+
description: z18.string().optional(),
|
|
4097
|
+
input_schema: z18.any(),
|
|
4098
|
+
annotations: z18.record(z18.string(), z18.unknown()).optional()
|
|
3989
4099
|
})
|
|
3990
4100
|
),
|
|
3991
|
-
error:
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
type:
|
|
3995
|
-
code:
|
|
3996
|
-
message:
|
|
4101
|
+
error: z18.union([
|
|
4102
|
+
z18.string(),
|
|
4103
|
+
z18.object({
|
|
4104
|
+
type: z18.string().optional(),
|
|
4105
|
+
code: z18.union([z18.number(), z18.string()]).optional(),
|
|
4106
|
+
message: z18.string().optional()
|
|
3997
4107
|
}).loose()
|
|
3998
4108
|
]).optional()
|
|
3999
4109
|
}),
|
|
4000
|
-
|
|
4001
|
-
type:
|
|
4002
|
-
id:
|
|
4003
|
-
server_label:
|
|
4004
|
-
name:
|
|
4005
|
-
arguments:
|
|
4006
|
-
approval_request_id:
|
|
4110
|
+
z18.object({
|
|
4111
|
+
type: z18.literal("mcp_approval_request"),
|
|
4112
|
+
id: z18.string(),
|
|
4113
|
+
server_label: z18.string(),
|
|
4114
|
+
name: z18.string(),
|
|
4115
|
+
arguments: z18.string(),
|
|
4116
|
+
approval_request_id: z18.string().optional()
|
|
4007
4117
|
}),
|
|
4008
|
-
|
|
4009
|
-
type:
|
|
4010
|
-
id:
|
|
4011
|
-
call_id:
|
|
4012
|
-
status:
|
|
4013
|
-
operation:
|
|
4014
|
-
|
|
4015
|
-
type:
|
|
4016
|
-
path:
|
|
4017
|
-
diff:
|
|
4118
|
+
z18.object({
|
|
4119
|
+
type: z18.literal("apply_patch_call"),
|
|
4120
|
+
id: z18.string(),
|
|
4121
|
+
call_id: z18.string(),
|
|
4122
|
+
status: z18.enum(["in_progress", "completed"]),
|
|
4123
|
+
operation: z18.discriminatedUnion("type", [
|
|
4124
|
+
z18.object({
|
|
4125
|
+
type: z18.literal("create_file"),
|
|
4126
|
+
path: z18.string(),
|
|
4127
|
+
diff: z18.string()
|
|
4018
4128
|
}),
|
|
4019
|
-
|
|
4020
|
-
type:
|
|
4021
|
-
path:
|
|
4129
|
+
z18.object({
|
|
4130
|
+
type: z18.literal("delete_file"),
|
|
4131
|
+
path: z18.string()
|
|
4022
4132
|
}),
|
|
4023
|
-
|
|
4024
|
-
type:
|
|
4025
|
-
path:
|
|
4026
|
-
diff:
|
|
4133
|
+
z18.object({
|
|
4134
|
+
type: z18.literal("update_file"),
|
|
4135
|
+
path: z18.string(),
|
|
4136
|
+
diff: z18.string()
|
|
4027
4137
|
})
|
|
4028
4138
|
])
|
|
4029
4139
|
}),
|
|
4030
|
-
|
|
4031
|
-
type:
|
|
4032
|
-
id:
|
|
4033
|
-
call_id:
|
|
4034
|
-
status:
|
|
4035
|
-
action:
|
|
4036
|
-
commands:
|
|
4140
|
+
z18.object({
|
|
4141
|
+
type: z18.literal("shell_call"),
|
|
4142
|
+
id: z18.string(),
|
|
4143
|
+
call_id: z18.string(),
|
|
4144
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
4145
|
+
action: z18.object({
|
|
4146
|
+
commands: z18.array(z18.string())
|
|
4037
4147
|
})
|
|
4038
4148
|
}),
|
|
4039
|
-
|
|
4040
|
-
type:
|
|
4041
|
-
id:
|
|
4042
|
-
call_id:
|
|
4043
|
-
status:
|
|
4044
|
-
output:
|
|
4045
|
-
|
|
4046
|
-
stdout:
|
|
4047
|
-
stderr:
|
|
4048
|
-
outcome:
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
type:
|
|
4052
|
-
exit_code:
|
|
4149
|
+
z18.object({
|
|
4150
|
+
type: z18.literal("shell_call_output"),
|
|
4151
|
+
id: z18.string(),
|
|
4152
|
+
call_id: z18.string(),
|
|
4153
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
4154
|
+
output: z18.array(
|
|
4155
|
+
z18.object({
|
|
4156
|
+
stdout: z18.string(),
|
|
4157
|
+
stderr: z18.string(),
|
|
4158
|
+
outcome: z18.discriminatedUnion("type", [
|
|
4159
|
+
z18.object({ type: z18.literal("timeout") }),
|
|
4160
|
+
z18.object({
|
|
4161
|
+
type: z18.literal("exit"),
|
|
4162
|
+
exit_code: z18.number()
|
|
4053
4163
|
})
|
|
4054
4164
|
])
|
|
4055
4165
|
})
|
|
4056
4166
|
)
|
|
4057
4167
|
}),
|
|
4058
|
-
|
|
4059
|
-
type:
|
|
4060
|
-
id:
|
|
4061
|
-
execution:
|
|
4062
|
-
call_id:
|
|
4063
|
-
status:
|
|
4064
|
-
arguments:
|
|
4168
|
+
z18.object({
|
|
4169
|
+
type: z18.literal("tool_search_call"),
|
|
4170
|
+
id: z18.string(),
|
|
4171
|
+
execution: z18.enum(["server", "client"]),
|
|
4172
|
+
call_id: z18.string().nullable(),
|
|
4173
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
4174
|
+
arguments: z18.unknown()
|
|
4065
4175
|
}),
|
|
4066
|
-
|
|
4067
|
-
type:
|
|
4068
|
-
id:
|
|
4069
|
-
execution:
|
|
4070
|
-
call_id:
|
|
4071
|
-
status:
|
|
4072
|
-
tools:
|
|
4176
|
+
z18.object({
|
|
4177
|
+
type: z18.literal("tool_search_output"),
|
|
4178
|
+
id: z18.string(),
|
|
4179
|
+
execution: z18.enum(["server", "client"]),
|
|
4180
|
+
call_id: z18.string().nullable(),
|
|
4181
|
+
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
4182
|
+
tools: z18.array(z18.record(z18.string(), jsonValueSchema.optional()))
|
|
4073
4183
|
})
|
|
4074
4184
|
])
|
|
4075
4185
|
).optional(),
|
|
4076
|
-
service_tier:
|
|
4077
|
-
incomplete_details:
|
|
4078
|
-
usage:
|
|
4079
|
-
input_tokens:
|
|
4080
|
-
input_tokens_details:
|
|
4081
|
-
output_tokens:
|
|
4082
|
-
output_tokens_details:
|
|
4186
|
+
service_tier: z18.string().nullish(),
|
|
4187
|
+
incomplete_details: z18.object({ reason: z18.string() }).nullish(),
|
|
4188
|
+
usage: z18.object({
|
|
4189
|
+
input_tokens: z18.number(),
|
|
4190
|
+
input_tokens_details: z18.object({ cached_tokens: z18.number().nullish() }).nullish(),
|
|
4191
|
+
output_tokens: z18.number(),
|
|
4192
|
+
output_tokens_details: z18.object({ reasoning_tokens: z18.number().nullish() }).nullish()
|
|
4083
4193
|
}).optional()
|
|
4084
4194
|
})
|
|
4085
4195
|
)
|
|
4086
4196
|
);
|
|
4087
4197
|
|
|
4088
4198
|
// src/responses/openai-responses-options.ts
|
|
4089
|
-
import {
|
|
4090
|
-
|
|
4199
|
+
import {
|
|
4200
|
+
lazySchema as lazySchema17,
|
|
4201
|
+
zodSchema as zodSchema17
|
|
4202
|
+
} from "@ai-sdk/provider-utils";
|
|
4203
|
+
import { z as z19 } from "zod/v4";
|
|
4091
4204
|
var TOP_LOGPROBS_MAX = 20;
|
|
4092
4205
|
var openaiResponsesReasoningModelIds = [
|
|
4093
4206
|
"o1",
|
|
@@ -4152,9 +4265,9 @@ var openaiResponsesModelIds = [
|
|
|
4152
4265
|
"gpt-5-chat-latest",
|
|
4153
4266
|
...openaiResponsesReasoningModelIds
|
|
4154
4267
|
];
|
|
4155
|
-
var openaiLanguageModelResponsesOptionsSchema =
|
|
4156
|
-
() =>
|
|
4157
|
-
|
|
4268
|
+
var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
|
|
4269
|
+
() => zodSchema17(
|
|
4270
|
+
z19.object({
|
|
4158
4271
|
/**
|
|
4159
4272
|
* The ID of the OpenAI Conversation to continue.
|
|
4160
4273
|
* You must create a conversation first via the OpenAI API.
|
|
@@ -4162,13 +4275,13 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
|
4162
4275
|
* Defaults to `undefined`.
|
|
4163
4276
|
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
4164
4277
|
*/
|
|
4165
|
-
conversation:
|
|
4278
|
+
conversation: z19.string().nullish(),
|
|
4166
4279
|
/**
|
|
4167
4280
|
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
4168
4281
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
|
|
4169
4282
|
*/
|
|
4170
|
-
include:
|
|
4171
|
-
|
|
4283
|
+
include: z19.array(
|
|
4284
|
+
z19.enum([
|
|
4172
4285
|
"reasoning.encrypted_content",
|
|
4173
4286
|
// handled internally by default, only needed for unknown reasoning models
|
|
4174
4287
|
"file_search_call.results",
|
|
@@ -4180,7 +4293,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
|
4180
4293
|
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
4181
4294
|
* Defaults to `undefined`.
|
|
4182
4295
|
*/
|
|
4183
|
-
instructions:
|
|
4296
|
+
instructions: z19.string().nullish(),
|
|
4184
4297
|
/**
|
|
4185
4298
|
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
4186
4299
|
* the response size and can slow down response times. However, it can
|
|
@@ -4195,30 +4308,30 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
|
4195
4308
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
4196
4309
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
4197
4310
|
*/
|
|
4198
|
-
logprobs:
|
|
4311
|
+
logprobs: z19.union([z19.boolean(), z19.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
4199
4312
|
/**
|
|
4200
4313
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
4201
4314
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
4202
4315
|
* Any further attempts to call a tool by the model will be ignored.
|
|
4203
4316
|
*/
|
|
4204
|
-
maxToolCalls:
|
|
4317
|
+
maxToolCalls: z19.number().nullish(),
|
|
4205
4318
|
/**
|
|
4206
4319
|
* Additional metadata to store with the generation.
|
|
4207
4320
|
*/
|
|
4208
|
-
metadata:
|
|
4321
|
+
metadata: z19.any().nullish(),
|
|
4209
4322
|
/**
|
|
4210
4323
|
* Whether to use parallel tool calls. Defaults to `true`.
|
|
4211
4324
|
*/
|
|
4212
|
-
parallelToolCalls:
|
|
4325
|
+
parallelToolCalls: z19.boolean().nullish(),
|
|
4213
4326
|
/**
|
|
4214
4327
|
* The ID of the previous response. You can use it to continue a conversation.
|
|
4215
4328
|
* Defaults to `undefined`.
|
|
4216
4329
|
*/
|
|
4217
|
-
previousResponseId:
|
|
4330
|
+
previousResponseId: z19.string().nullish(),
|
|
4218
4331
|
/**
|
|
4219
4332
|
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
4220
4333
|
*/
|
|
4221
|
-
promptCacheKey:
|
|
4334
|
+
promptCacheKey: z19.string().nullish(),
|
|
4222
4335
|
/**
|
|
4223
4336
|
* The retention policy for the prompt cache.
|
|
4224
4337
|
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
@@ -4227,7 +4340,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
|
4227
4340
|
*
|
|
4228
4341
|
* @default 'in_memory'
|
|
4229
4342
|
*/
|
|
4230
|
-
promptCacheRetention:
|
|
4343
|
+
promptCacheRetention: z19.enum(["in_memory", "24h"]).nullish(),
|
|
4231
4344
|
/**
|
|
4232
4345
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
4233
4346
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
@@ -4238,17 +4351,17 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
|
4238
4351
|
* OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
|
|
4239
4352
|
* an error.
|
|
4240
4353
|
*/
|
|
4241
|
-
reasoningEffort:
|
|
4354
|
+
reasoningEffort: z19.string().nullish(),
|
|
4242
4355
|
/**
|
|
4243
4356
|
* Controls reasoning summary output from the model.
|
|
4244
4357
|
* Set to "auto" to automatically receive the richest level available,
|
|
4245
4358
|
* or "detailed" for comprehensive summaries.
|
|
4246
4359
|
*/
|
|
4247
|
-
reasoningSummary:
|
|
4360
|
+
reasoningSummary: z19.string().nullish(),
|
|
4248
4361
|
/**
|
|
4249
4362
|
* The identifier for safety monitoring and tracking.
|
|
4250
4363
|
*/
|
|
4251
|
-
safetyIdentifier:
|
|
4364
|
+
safetyIdentifier: z19.string().nullish(),
|
|
4252
4365
|
/**
|
|
4253
4366
|
* Service tier for the request.
|
|
4254
4367
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
@@ -4256,34 +4369,34 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
|
4256
4369
|
*
|
|
4257
4370
|
* Defaults to 'auto'.
|
|
4258
4371
|
*/
|
|
4259
|
-
serviceTier:
|
|
4372
|
+
serviceTier: z19.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
4260
4373
|
/**
|
|
4261
4374
|
* Whether to store the generation. Defaults to `true`.
|
|
4262
4375
|
*/
|
|
4263
|
-
store:
|
|
4376
|
+
store: z19.boolean().nullish(),
|
|
4264
4377
|
/**
|
|
4265
4378
|
* Whether to use strict JSON schema validation.
|
|
4266
4379
|
* Defaults to `true`.
|
|
4267
4380
|
*/
|
|
4268
|
-
strictJsonSchema:
|
|
4381
|
+
strictJsonSchema: z19.boolean().nullish(),
|
|
4269
4382
|
/**
|
|
4270
4383
|
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
4271
4384
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
4272
4385
|
* Valid values: 'low', 'medium', 'high'.
|
|
4273
4386
|
*/
|
|
4274
|
-
textVerbosity:
|
|
4387
|
+
textVerbosity: z19.enum(["low", "medium", "high"]).nullish(),
|
|
4275
4388
|
/**
|
|
4276
4389
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
4277
4390
|
* 'disabled' turns truncation off.
|
|
4278
4391
|
*/
|
|
4279
|
-
truncation:
|
|
4392
|
+
truncation: z19.enum(["auto", "disabled"]).nullish(),
|
|
4280
4393
|
/**
|
|
4281
4394
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
4282
4395
|
* monitor and detect abuse.
|
|
4283
4396
|
* Defaults to `undefined`.
|
|
4284
4397
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
4285
4398
|
*/
|
|
4286
|
-
user:
|
|
4399
|
+
user: z19.string().nullish(),
|
|
4287
4400
|
/**
|
|
4288
4401
|
* Override the system message mode for this model.
|
|
4289
4402
|
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
@@ -4292,7 +4405,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
|
4292
4405
|
*
|
|
4293
4406
|
* If not specified, the mode is automatically determined based on the model.
|
|
4294
4407
|
*/
|
|
4295
|
-
systemMessageMode:
|
|
4408
|
+
systemMessageMode: z19.enum(["system", "developer", "remove"]).optional(),
|
|
4296
4409
|
/**
|
|
4297
4410
|
* Force treating this model as a reasoning model.
|
|
4298
4411
|
*
|
|
@@ -4302,7 +4415,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
|
|
|
4302
4415
|
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
4303
4416
|
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
4304
4417
|
*/
|
|
4305
|
-
forceReasoning:
|
|
4418
|
+
forceReasoning: z19.boolean().optional()
|
|
4306
4419
|
})
|
|
4307
4420
|
)
|
|
4308
4421
|
);
|
|
@@ -4316,37 +4429,37 @@ import { validateTypes as validateTypes2 } from "@ai-sdk/provider-utils";
|
|
|
4316
4429
|
// src/tool/code-interpreter.ts
|
|
4317
4430
|
import {
|
|
4318
4431
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
|
|
4319
|
-
lazySchema as
|
|
4320
|
-
zodSchema as
|
|
4432
|
+
lazySchema as lazySchema18,
|
|
4433
|
+
zodSchema as zodSchema18
|
|
4321
4434
|
} from "@ai-sdk/provider-utils";
|
|
4322
|
-
import { z as
|
|
4323
|
-
var codeInterpreterInputSchema =
|
|
4324
|
-
() =>
|
|
4325
|
-
|
|
4326
|
-
code:
|
|
4327
|
-
containerId:
|
|
4435
|
+
import { z as z20 } from "zod/v4";
|
|
4436
|
+
var codeInterpreterInputSchema = lazySchema18(
|
|
4437
|
+
() => zodSchema18(
|
|
4438
|
+
z20.object({
|
|
4439
|
+
code: z20.string().nullish(),
|
|
4440
|
+
containerId: z20.string()
|
|
4328
4441
|
})
|
|
4329
4442
|
)
|
|
4330
4443
|
);
|
|
4331
|
-
var codeInterpreterOutputSchema =
|
|
4332
|
-
() =>
|
|
4333
|
-
|
|
4334
|
-
outputs:
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4444
|
+
var codeInterpreterOutputSchema = lazySchema18(
|
|
4445
|
+
() => zodSchema18(
|
|
4446
|
+
z20.object({
|
|
4447
|
+
outputs: z20.array(
|
|
4448
|
+
z20.discriminatedUnion("type", [
|
|
4449
|
+
z20.object({ type: z20.literal("logs"), logs: z20.string() }),
|
|
4450
|
+
z20.object({ type: z20.literal("image"), url: z20.string() })
|
|
4338
4451
|
])
|
|
4339
4452
|
).nullish()
|
|
4340
4453
|
})
|
|
4341
4454
|
)
|
|
4342
4455
|
);
|
|
4343
|
-
var codeInterpreterArgsSchema =
|
|
4344
|
-
() =>
|
|
4345
|
-
|
|
4346
|
-
container:
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
fileIds:
|
|
4456
|
+
var codeInterpreterArgsSchema = lazySchema18(
|
|
4457
|
+
() => zodSchema18(
|
|
4458
|
+
z20.object({
|
|
4459
|
+
container: z20.union([
|
|
4460
|
+
z20.string(),
|
|
4461
|
+
z20.object({
|
|
4462
|
+
fileIds: z20.array(z20.string()).optional()
|
|
4350
4463
|
})
|
|
4351
4464
|
]).optional()
|
|
4352
4465
|
})
|
|
@@ -4364,45 +4477,45 @@ var codeInterpreter = (args = {}) => {
|
|
|
4364
4477
|
// src/tool/file-search.ts
|
|
4365
4478
|
import {
|
|
4366
4479
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
|
|
4367
|
-
lazySchema as
|
|
4368
|
-
zodSchema as
|
|
4480
|
+
lazySchema as lazySchema19,
|
|
4481
|
+
zodSchema as zodSchema19
|
|
4369
4482
|
} from "@ai-sdk/provider-utils";
|
|
4370
|
-
import { z as
|
|
4371
|
-
var comparisonFilterSchema =
|
|
4372
|
-
key:
|
|
4373
|
-
type:
|
|
4374
|
-
value:
|
|
4483
|
+
import { z as z21 } from "zod/v4";
|
|
4484
|
+
var comparisonFilterSchema = z21.object({
|
|
4485
|
+
key: z21.string(),
|
|
4486
|
+
type: z21.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
4487
|
+
value: z21.union([z21.string(), z21.number(), z21.boolean(), z21.array(z21.string())])
|
|
4375
4488
|
});
|
|
4376
|
-
var compoundFilterSchema =
|
|
4377
|
-
type:
|
|
4378
|
-
filters:
|
|
4379
|
-
|
|
4489
|
+
var compoundFilterSchema = z21.object({
|
|
4490
|
+
type: z21.enum(["and", "or"]),
|
|
4491
|
+
filters: z21.array(
|
|
4492
|
+
z21.union([comparisonFilterSchema, z21.lazy(() => compoundFilterSchema)])
|
|
4380
4493
|
)
|
|
4381
4494
|
});
|
|
4382
|
-
var fileSearchArgsSchema =
|
|
4383
|
-
() =>
|
|
4384
|
-
|
|
4385
|
-
vectorStoreIds:
|
|
4386
|
-
maxNumResults:
|
|
4387
|
-
ranking:
|
|
4388
|
-
ranker:
|
|
4389
|
-
scoreThreshold:
|
|
4495
|
+
var fileSearchArgsSchema = lazySchema19(
|
|
4496
|
+
() => zodSchema19(
|
|
4497
|
+
z21.object({
|
|
4498
|
+
vectorStoreIds: z21.array(z21.string()),
|
|
4499
|
+
maxNumResults: z21.number().optional(),
|
|
4500
|
+
ranking: z21.object({
|
|
4501
|
+
ranker: z21.string().optional(),
|
|
4502
|
+
scoreThreshold: z21.number().optional()
|
|
4390
4503
|
}).optional(),
|
|
4391
|
-
filters:
|
|
4504
|
+
filters: z21.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
4392
4505
|
})
|
|
4393
4506
|
)
|
|
4394
4507
|
);
|
|
4395
|
-
var fileSearchOutputSchema =
|
|
4396
|
-
() =>
|
|
4397
|
-
|
|
4398
|
-
queries:
|
|
4399
|
-
results:
|
|
4400
|
-
|
|
4401
|
-
attributes:
|
|
4402
|
-
fileId:
|
|
4403
|
-
filename:
|
|
4404
|
-
score:
|
|
4405
|
-
text:
|
|
4508
|
+
var fileSearchOutputSchema = lazySchema19(
|
|
4509
|
+
() => zodSchema19(
|
|
4510
|
+
z21.object({
|
|
4511
|
+
queries: z21.array(z21.string()),
|
|
4512
|
+
results: z21.array(
|
|
4513
|
+
z21.object({
|
|
4514
|
+
attributes: z21.record(z21.string(), z21.unknown()),
|
|
4515
|
+
fileId: z21.string(),
|
|
4516
|
+
filename: z21.string(),
|
|
4517
|
+
score: z21.number(),
|
|
4518
|
+
text: z21.string()
|
|
4406
4519
|
})
|
|
4407
4520
|
).nullable()
|
|
4408
4521
|
})
|
|
@@ -4410,39 +4523,39 @@ var fileSearchOutputSchema = lazySchema18(
|
|
|
4410
4523
|
);
|
|
4411
4524
|
var fileSearch = createProviderToolFactoryWithOutputSchema6({
|
|
4412
4525
|
id: "openai.file_search",
|
|
4413
|
-
inputSchema:
|
|
4526
|
+
inputSchema: z21.object({}),
|
|
4414
4527
|
outputSchema: fileSearchOutputSchema
|
|
4415
4528
|
});
|
|
4416
4529
|
|
|
4417
4530
|
// src/tool/image-generation.ts
|
|
4418
4531
|
import {
|
|
4419
4532
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
|
|
4420
|
-
lazySchema as
|
|
4421
|
-
zodSchema as
|
|
4533
|
+
lazySchema as lazySchema20,
|
|
4534
|
+
zodSchema as zodSchema20
|
|
4422
4535
|
} from "@ai-sdk/provider-utils";
|
|
4423
|
-
import { z as
|
|
4424
|
-
var imageGenerationArgsSchema =
|
|
4425
|
-
() =>
|
|
4426
|
-
|
|
4427
|
-
background:
|
|
4428
|
-
inputFidelity:
|
|
4429
|
-
inputImageMask:
|
|
4430
|
-
fileId:
|
|
4431
|
-
imageUrl:
|
|
4536
|
+
import { z as z22 } from "zod/v4";
|
|
4537
|
+
var imageGenerationArgsSchema = lazySchema20(
|
|
4538
|
+
() => zodSchema20(
|
|
4539
|
+
z22.object({
|
|
4540
|
+
background: z22.enum(["auto", "opaque", "transparent"]).optional(),
|
|
4541
|
+
inputFidelity: z22.enum(["low", "high"]).optional(),
|
|
4542
|
+
inputImageMask: z22.object({
|
|
4543
|
+
fileId: z22.string().optional(),
|
|
4544
|
+
imageUrl: z22.string().optional()
|
|
4432
4545
|
}).optional(),
|
|
4433
|
-
model:
|
|
4434
|
-
moderation:
|
|
4435
|
-
outputCompression:
|
|
4436
|
-
outputFormat:
|
|
4437
|
-
partialImages:
|
|
4438
|
-
quality:
|
|
4439
|
-
size:
|
|
4546
|
+
model: z22.string().optional(),
|
|
4547
|
+
moderation: z22.enum(["auto"]).optional(),
|
|
4548
|
+
outputCompression: z22.number().int().min(0).max(100).optional(),
|
|
4549
|
+
outputFormat: z22.enum(["png", "jpeg", "webp"]).optional(),
|
|
4550
|
+
partialImages: z22.number().int().min(0).max(3).optional(),
|
|
4551
|
+
quality: z22.enum(["auto", "low", "medium", "high"]).optional(),
|
|
4552
|
+
size: z22.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
4440
4553
|
}).strict()
|
|
4441
4554
|
)
|
|
4442
4555
|
);
|
|
4443
|
-
var imageGenerationInputSchema =
|
|
4444
|
-
var imageGenerationOutputSchema =
|
|
4445
|
-
() =>
|
|
4556
|
+
var imageGenerationInputSchema = lazySchema20(() => zodSchema20(z22.object({})));
|
|
4557
|
+
var imageGenerationOutputSchema = lazySchema20(
|
|
4558
|
+
() => zodSchema20(z22.object({ result: z22.string() }))
|
|
4446
4559
|
);
|
|
4447
4560
|
var imageGenerationToolFactory = createProviderToolFactoryWithOutputSchema7({
|
|
4448
4561
|
id: "openai.image_generation",
|
|
@@ -4456,29 +4569,29 @@ var imageGeneration = (args = {}) => {
|
|
|
4456
4569
|
// src/tool/custom.ts
|
|
4457
4570
|
import {
|
|
4458
4571
|
createProviderToolFactory,
|
|
4459
|
-
lazySchema as
|
|
4460
|
-
zodSchema as
|
|
4572
|
+
lazySchema as lazySchema21,
|
|
4573
|
+
zodSchema as zodSchema21
|
|
4461
4574
|
} from "@ai-sdk/provider-utils";
|
|
4462
|
-
import { z as
|
|
4463
|
-
var customArgsSchema =
|
|
4464
|
-
() =>
|
|
4465
|
-
|
|
4466
|
-
name:
|
|
4467
|
-
description:
|
|
4468
|
-
format:
|
|
4469
|
-
|
|
4470
|
-
type:
|
|
4471
|
-
syntax:
|
|
4472
|
-
definition:
|
|
4575
|
+
import { z as z23 } from "zod/v4";
|
|
4576
|
+
var customArgsSchema = lazySchema21(
|
|
4577
|
+
() => zodSchema21(
|
|
4578
|
+
z23.object({
|
|
4579
|
+
name: z23.string(),
|
|
4580
|
+
description: z23.string().optional(),
|
|
4581
|
+
format: z23.union([
|
|
4582
|
+
z23.object({
|
|
4583
|
+
type: z23.literal("grammar"),
|
|
4584
|
+
syntax: z23.enum(["regex", "lark"]),
|
|
4585
|
+
definition: z23.string()
|
|
4473
4586
|
}),
|
|
4474
|
-
|
|
4475
|
-
type:
|
|
4587
|
+
z23.object({
|
|
4588
|
+
type: z23.literal("text")
|
|
4476
4589
|
})
|
|
4477
4590
|
]).optional()
|
|
4478
4591
|
})
|
|
4479
4592
|
)
|
|
4480
4593
|
);
|
|
4481
|
-
var customInputSchema =
|
|
4594
|
+
var customInputSchema = lazySchema21(() => zodSchema21(z23.string()));
|
|
4482
4595
|
var customToolFactory = createProviderToolFactory({
|
|
4483
4596
|
id: "openai.custom",
|
|
4484
4597
|
inputSchema: customInputSchema
|
|
@@ -4487,60 +4600,60 @@ var customToolFactory = createProviderToolFactory({
|
|
|
4487
4600
|
// src/tool/mcp.ts
|
|
4488
4601
|
import {
|
|
4489
4602
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
|
|
4490
|
-
lazySchema as
|
|
4491
|
-
zodSchema as
|
|
4603
|
+
lazySchema as lazySchema22,
|
|
4604
|
+
zodSchema as zodSchema22
|
|
4492
4605
|
} from "@ai-sdk/provider-utils";
|
|
4493
|
-
import { z as
|
|
4494
|
-
var jsonValueSchema2 =
|
|
4495
|
-
() =>
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4606
|
+
import { z as z24 } from "zod/v4";
|
|
4607
|
+
var jsonValueSchema2 = z24.lazy(
|
|
4608
|
+
() => z24.union([
|
|
4609
|
+
z24.string(),
|
|
4610
|
+
z24.number(),
|
|
4611
|
+
z24.boolean(),
|
|
4612
|
+
z24.null(),
|
|
4613
|
+
z24.array(jsonValueSchema2),
|
|
4614
|
+
z24.record(z24.string(), jsonValueSchema2)
|
|
4502
4615
|
])
|
|
4503
4616
|
);
|
|
4504
|
-
var mcpArgsSchema =
|
|
4505
|
-
() =>
|
|
4506
|
-
|
|
4507
|
-
serverLabel:
|
|
4508
|
-
allowedTools:
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
readOnly:
|
|
4512
|
-
toolNames:
|
|
4617
|
+
var mcpArgsSchema = lazySchema22(
|
|
4618
|
+
() => zodSchema22(
|
|
4619
|
+
z24.object({
|
|
4620
|
+
serverLabel: z24.string(),
|
|
4621
|
+
allowedTools: z24.union([
|
|
4622
|
+
z24.array(z24.string()),
|
|
4623
|
+
z24.object({
|
|
4624
|
+
readOnly: z24.boolean().optional(),
|
|
4625
|
+
toolNames: z24.array(z24.string()).optional()
|
|
4513
4626
|
})
|
|
4514
4627
|
]).optional(),
|
|
4515
|
-
authorization:
|
|
4516
|
-
connectorId:
|
|
4517
|
-
headers:
|
|
4518
|
-
requireApproval:
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
never:
|
|
4522
|
-
toolNames:
|
|
4628
|
+
authorization: z24.string().optional(),
|
|
4629
|
+
connectorId: z24.string().optional(),
|
|
4630
|
+
headers: z24.record(z24.string(), z24.string()).optional(),
|
|
4631
|
+
requireApproval: z24.union([
|
|
4632
|
+
z24.enum(["always", "never"]),
|
|
4633
|
+
z24.object({
|
|
4634
|
+
never: z24.object({
|
|
4635
|
+
toolNames: z24.array(z24.string()).optional()
|
|
4523
4636
|
}).optional()
|
|
4524
4637
|
})
|
|
4525
4638
|
]).optional(),
|
|
4526
|
-
serverDescription:
|
|
4527
|
-
serverUrl:
|
|
4639
|
+
serverDescription: z24.string().optional(),
|
|
4640
|
+
serverUrl: z24.string().optional()
|
|
4528
4641
|
}).refine(
|
|
4529
4642
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
4530
4643
|
"One of serverUrl or connectorId must be provided."
|
|
4531
4644
|
)
|
|
4532
4645
|
)
|
|
4533
4646
|
);
|
|
4534
|
-
var mcpInputSchema =
|
|
4535
|
-
var mcpOutputSchema =
|
|
4536
|
-
() =>
|
|
4537
|
-
|
|
4538
|
-
type:
|
|
4539
|
-
serverLabel:
|
|
4540
|
-
name:
|
|
4541
|
-
arguments:
|
|
4542
|
-
output:
|
|
4543
|
-
error:
|
|
4647
|
+
var mcpInputSchema = lazySchema22(() => zodSchema22(z24.object({})));
|
|
4648
|
+
var mcpOutputSchema = lazySchema22(
|
|
4649
|
+
() => zodSchema22(
|
|
4650
|
+
z24.object({
|
|
4651
|
+
type: z24.literal("call"),
|
|
4652
|
+
serverLabel: z24.string(),
|
|
4653
|
+
name: z24.string(),
|
|
4654
|
+
arguments: z24.string(),
|
|
4655
|
+
output: z24.string().nullish(),
|
|
4656
|
+
error: z24.union([z24.string(), jsonValueSchema2]).optional()
|
|
4544
4657
|
})
|
|
4545
4658
|
)
|
|
4546
4659
|
);
|
|
@@ -4553,70 +4666,15 @@ var mcpToolFactory = createProviderToolFactoryWithOutputSchema8({
|
|
|
4553
4666
|
// src/tool/web-search.ts
|
|
4554
4667
|
import {
|
|
4555
4668
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
|
|
4556
|
-
lazySchema as lazySchema22,
|
|
4557
|
-
zodSchema as zodSchema22
|
|
4558
|
-
} from "@ai-sdk/provider-utils";
|
|
4559
|
-
import { z as z24 } from "zod/v4";
|
|
4560
|
-
var webSearchArgsSchema = lazySchema22(
|
|
4561
|
-
() => zodSchema22(
|
|
4562
|
-
z24.object({
|
|
4563
|
-
externalWebAccess: z24.boolean().optional(),
|
|
4564
|
-
filters: z24.object({ allowedDomains: z24.array(z24.string()).optional() }).optional(),
|
|
4565
|
-
searchContextSize: z24.enum(["low", "medium", "high"]).optional(),
|
|
4566
|
-
userLocation: z24.object({
|
|
4567
|
-
type: z24.literal("approximate"),
|
|
4568
|
-
country: z24.string().optional(),
|
|
4569
|
-
city: z24.string().optional(),
|
|
4570
|
-
region: z24.string().optional(),
|
|
4571
|
-
timezone: z24.string().optional()
|
|
4572
|
-
}).optional()
|
|
4573
|
-
})
|
|
4574
|
-
)
|
|
4575
|
-
);
|
|
4576
|
-
var webSearchInputSchema = lazySchema22(() => zodSchema22(z24.object({})));
|
|
4577
|
-
var webSearchOutputSchema = lazySchema22(
|
|
4578
|
-
() => zodSchema22(
|
|
4579
|
-
z24.object({
|
|
4580
|
-
action: z24.discriminatedUnion("type", [
|
|
4581
|
-
z24.object({
|
|
4582
|
-
type: z24.literal("search"),
|
|
4583
|
-
query: z24.string().optional()
|
|
4584
|
-
}),
|
|
4585
|
-
z24.object({
|
|
4586
|
-
type: z24.literal("openPage"),
|
|
4587
|
-
url: z24.string().nullish()
|
|
4588
|
-
}),
|
|
4589
|
-
z24.object({
|
|
4590
|
-
type: z24.literal("findInPage"),
|
|
4591
|
-
url: z24.string().nullish(),
|
|
4592
|
-
pattern: z24.string().nullish()
|
|
4593
|
-
})
|
|
4594
|
-
]).optional(),
|
|
4595
|
-
sources: z24.array(
|
|
4596
|
-
z24.discriminatedUnion("type", [
|
|
4597
|
-
z24.object({ type: z24.literal("url"), url: z24.string() }),
|
|
4598
|
-
z24.object({ type: z24.literal("api"), name: z24.string() })
|
|
4599
|
-
])
|
|
4600
|
-
).optional()
|
|
4601
|
-
})
|
|
4602
|
-
)
|
|
4603
|
-
);
|
|
4604
|
-
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema9({
|
|
4605
|
-
id: "openai.web_search",
|
|
4606
|
-
inputSchema: webSearchInputSchema,
|
|
4607
|
-
outputSchema: webSearchOutputSchema
|
|
4608
|
-
});
|
|
4609
|
-
|
|
4610
|
-
// src/tool/web-search-preview.ts
|
|
4611
|
-
import {
|
|
4612
|
-
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema10,
|
|
4613
4669
|
lazySchema as lazySchema23,
|
|
4614
4670
|
zodSchema as zodSchema23
|
|
4615
4671
|
} from "@ai-sdk/provider-utils";
|
|
4616
4672
|
import { z as z25 } from "zod/v4";
|
|
4617
|
-
var
|
|
4673
|
+
var webSearchArgsSchema = lazySchema23(
|
|
4618
4674
|
() => zodSchema23(
|
|
4619
4675
|
z25.object({
|
|
4676
|
+
externalWebAccess: z25.boolean().optional(),
|
|
4677
|
+
filters: z25.object({ allowedDomains: z25.array(z25.string()).optional() }).optional(),
|
|
4620
4678
|
searchContextSize: z25.enum(["low", "medium", "high"]).optional(),
|
|
4621
4679
|
userLocation: z25.object({
|
|
4622
4680
|
type: z25.literal("approximate"),
|
|
@@ -4628,10 +4686,8 @@ var webSearchPreviewArgsSchema = lazySchema23(
|
|
|
4628
4686
|
})
|
|
4629
4687
|
)
|
|
4630
4688
|
);
|
|
4631
|
-
var
|
|
4632
|
-
|
|
4633
|
-
);
|
|
4634
|
-
var webSearchPreviewOutputSchema = lazySchema23(
|
|
4689
|
+
var webSearchInputSchema = lazySchema23(() => zodSchema23(z25.object({})));
|
|
4690
|
+
var webSearchOutputSchema = lazySchema23(
|
|
4635
4691
|
() => zodSchema23(
|
|
4636
4692
|
z25.object({
|
|
4637
4693
|
action: z25.discriminatedUnion("type", [
|
|
@@ -4648,6 +4704,63 @@ var webSearchPreviewOutputSchema = lazySchema23(
|
|
|
4648
4704
|
url: z25.string().nullish(),
|
|
4649
4705
|
pattern: z25.string().nullish()
|
|
4650
4706
|
})
|
|
4707
|
+
]).optional(),
|
|
4708
|
+
sources: z25.array(
|
|
4709
|
+
z25.discriminatedUnion("type", [
|
|
4710
|
+
z25.object({ type: z25.literal("url"), url: z25.string() }),
|
|
4711
|
+
z25.object({ type: z25.literal("api"), name: z25.string() })
|
|
4712
|
+
])
|
|
4713
|
+
).optional()
|
|
4714
|
+
})
|
|
4715
|
+
)
|
|
4716
|
+
);
|
|
4717
|
+
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema9({
|
|
4718
|
+
id: "openai.web_search",
|
|
4719
|
+
inputSchema: webSearchInputSchema,
|
|
4720
|
+
outputSchema: webSearchOutputSchema
|
|
4721
|
+
});
|
|
4722
|
+
|
|
4723
|
+
// src/tool/web-search-preview.ts
|
|
4724
|
+
import {
|
|
4725
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema10,
|
|
4726
|
+
lazySchema as lazySchema24,
|
|
4727
|
+
zodSchema as zodSchema24
|
|
4728
|
+
} from "@ai-sdk/provider-utils";
|
|
4729
|
+
import { z as z26 } from "zod/v4";
|
|
4730
|
+
var webSearchPreviewArgsSchema = lazySchema24(
|
|
4731
|
+
() => zodSchema24(
|
|
4732
|
+
z26.object({
|
|
4733
|
+
searchContextSize: z26.enum(["low", "medium", "high"]).optional(),
|
|
4734
|
+
userLocation: z26.object({
|
|
4735
|
+
type: z26.literal("approximate"),
|
|
4736
|
+
country: z26.string().optional(),
|
|
4737
|
+
city: z26.string().optional(),
|
|
4738
|
+
region: z26.string().optional(),
|
|
4739
|
+
timezone: z26.string().optional()
|
|
4740
|
+
}).optional()
|
|
4741
|
+
})
|
|
4742
|
+
)
|
|
4743
|
+
);
|
|
4744
|
+
var webSearchPreviewInputSchema = lazySchema24(
|
|
4745
|
+
() => zodSchema24(z26.object({}))
|
|
4746
|
+
);
|
|
4747
|
+
var webSearchPreviewOutputSchema = lazySchema24(
|
|
4748
|
+
() => zodSchema24(
|
|
4749
|
+
z26.object({
|
|
4750
|
+
action: z26.discriminatedUnion("type", [
|
|
4751
|
+
z26.object({
|
|
4752
|
+
type: z26.literal("search"),
|
|
4753
|
+
query: z26.string().optional()
|
|
4754
|
+
}),
|
|
4755
|
+
z26.object({
|
|
4756
|
+
type: z26.literal("openPage"),
|
|
4757
|
+
url: z26.string().nullish()
|
|
4758
|
+
}),
|
|
4759
|
+
z26.object({
|
|
4760
|
+
type: z26.literal("findInPage"),
|
|
4761
|
+
url: z26.string().nullish(),
|
|
4762
|
+
pattern: z26.string().nullish()
|
|
4763
|
+
})
|
|
4651
4764
|
]).optional()
|
|
4652
4765
|
})
|
|
4653
4766
|
)
|
|
@@ -4991,13 +5104,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4991
5104
|
warnings.push({ type: "unsupported", feature: "stopSequences" });
|
|
4992
5105
|
}
|
|
4993
5106
|
const providerOptionsName = this.config.provider.includes("azure") ? "azure" : "openai";
|
|
4994
|
-
let openaiOptions = await
|
|
5107
|
+
let openaiOptions = await parseProviderOptions8({
|
|
4995
5108
|
provider: providerOptionsName,
|
|
4996
5109
|
providerOptions,
|
|
4997
5110
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
4998
5111
|
});
|
|
4999
5112
|
if (openaiOptions == null && providerOptionsName !== "openai") {
|
|
5000
|
-
openaiOptions = await
|
|
5113
|
+
openaiOptions = await parseProviderOptions8({
|
|
5001
5114
|
provider: "openai",
|
|
5002
5115
|
providerOptions,
|
|
5003
5116
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
@@ -6646,6 +6759,9 @@ export {
|
|
|
6646
6759
|
modelMaxImagesPerCall,
|
|
6647
6760
|
openAITranscriptionModelOptions,
|
|
6648
6761
|
openaiEmbeddingModelOptions,
|
|
6762
|
+
openaiImageModelEditOptions,
|
|
6763
|
+
openaiImageModelGenerationOptions,
|
|
6764
|
+
openaiImageModelOptions,
|
|
6649
6765
|
openaiLanguageModelChatOptions,
|
|
6650
6766
|
openaiLanguageModelCompletionOptions,
|
|
6651
6767
|
openaiSpeechModelOptionsSchema,
|