@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/index.mjs
CHANGED
|
@@ -315,7 +315,10 @@ function mapOpenAIFinishReason(finishReason) {
|
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
// src/chat/openai-chat-api.ts
|
|
318
|
-
import {
|
|
318
|
+
import {
|
|
319
|
+
lazySchema,
|
|
320
|
+
zodSchema
|
|
321
|
+
} from "@ai-sdk/provider-utils";
|
|
319
322
|
import { z as z2 } from "zod/v4";
|
|
320
323
|
var openaiChatResponseSchema = lazySchema(
|
|
321
324
|
() => zodSchema(
|
|
@@ -457,7 +460,10 @@ var openaiChatChunkSchema = lazySchema(
|
|
|
457
460
|
);
|
|
458
461
|
|
|
459
462
|
// src/chat/openai-chat-options.ts
|
|
460
|
-
import {
|
|
463
|
+
import {
|
|
464
|
+
lazySchema as lazySchema2,
|
|
465
|
+
zodSchema as zodSchema2
|
|
466
|
+
} from "@ai-sdk/provider-utils";
|
|
461
467
|
import { z as z3 } from "zod/v4";
|
|
462
468
|
var openaiLanguageModelChatOptions = lazySchema2(
|
|
463
469
|
() => zodSchema2(
|
|
@@ -1279,7 +1285,10 @@ function mapOpenAIFinishReason2(finishReason) {
|
|
|
1279
1285
|
|
|
1280
1286
|
// src/completion/openai-completion-api.ts
|
|
1281
1287
|
import { z as z4 } from "zod/v4";
|
|
1282
|
-
import {
|
|
1288
|
+
import {
|
|
1289
|
+
lazySchema as lazySchema3,
|
|
1290
|
+
zodSchema as zodSchema3
|
|
1291
|
+
} from "@ai-sdk/provider-utils";
|
|
1283
1292
|
var openaiCompletionResponseSchema = lazySchema3(
|
|
1284
1293
|
() => zodSchema3(
|
|
1285
1294
|
z4.object({
|
|
@@ -1336,7 +1345,10 @@ var openaiCompletionChunkSchema = lazySchema3(
|
|
|
1336
1345
|
);
|
|
1337
1346
|
|
|
1338
1347
|
// src/completion/openai-completion-options.ts
|
|
1339
|
-
import {
|
|
1348
|
+
import {
|
|
1349
|
+
lazySchema as lazySchema4,
|
|
1350
|
+
zodSchema as zodSchema4
|
|
1351
|
+
} from "@ai-sdk/provider-utils";
|
|
1340
1352
|
import { z as z5 } from "zod/v4";
|
|
1341
1353
|
var openaiLanguageModelCompletionOptions = lazySchema4(
|
|
1342
1354
|
() => zodSchema4(
|
|
@@ -1624,7 +1636,10 @@ import {
|
|
|
1624
1636
|
} from "@ai-sdk/provider-utils";
|
|
1625
1637
|
|
|
1626
1638
|
// src/embedding/openai-embedding-options.ts
|
|
1627
|
-
import {
|
|
1639
|
+
import {
|
|
1640
|
+
lazySchema as lazySchema5,
|
|
1641
|
+
zodSchema as zodSchema5
|
|
1642
|
+
} from "@ai-sdk/provider-utils";
|
|
1628
1643
|
import { z as z6 } from "zod/v4";
|
|
1629
1644
|
var openaiEmbeddingModelOptions = lazySchema5(
|
|
1630
1645
|
() => zodSchema5(
|
|
@@ -1727,6 +1742,7 @@ import {
|
|
|
1727
1742
|
convertToFormData,
|
|
1728
1743
|
createJsonResponseHandler as createJsonResponseHandler4,
|
|
1729
1744
|
downloadBlob,
|
|
1745
|
+
parseProviderOptions as parseProviderOptions4,
|
|
1730
1746
|
postFormDataToApi,
|
|
1731
1747
|
postJsonToApi as postJsonToApi4
|
|
1732
1748
|
} from "@ai-sdk/provider-utils";
|
|
@@ -1761,7 +1777,12 @@ var openaiImageResponseSchema = lazySchema7(
|
|
|
1761
1777
|
)
|
|
1762
1778
|
);
|
|
1763
1779
|
|
|
1764
|
-
// src/image/openai-image-options.ts
|
|
1780
|
+
// src/image/openai-image-model-options.ts
|
|
1781
|
+
import {
|
|
1782
|
+
lazySchema as lazySchema8,
|
|
1783
|
+
zodSchema as zodSchema8
|
|
1784
|
+
} from "@ai-sdk/provider-utils";
|
|
1785
|
+
import { z as z9 } from "zod/v4";
|
|
1765
1786
|
var modelMaxImagesPerCall = {
|
|
1766
1787
|
"dall-e-3": 1,
|
|
1767
1788
|
"dall-e-2": 10,
|
|
@@ -1783,6 +1804,65 @@ function hasDefaultResponseFormat(modelId) {
|
|
|
1783
1804
|
(prefix) => modelId.startsWith(prefix)
|
|
1784
1805
|
);
|
|
1785
1806
|
}
|
|
1807
|
+
var baseImageModelOptionsObject = z9.object({
|
|
1808
|
+
/**
|
|
1809
|
+
* Quality of the generated image(s).
|
|
1810
|
+
*
|
|
1811
|
+
* Valid values: `standard`, `hd`, `low`, `medium`, `high`, `auto`.
|
|
1812
|
+
*/
|
|
1813
|
+
quality: z9.enum(["standard", "hd", "low", "medium", "high", "auto"]).optional(),
|
|
1814
|
+
/**
|
|
1815
|
+
* Background behavior for the generated image(s).
|
|
1816
|
+
*
|
|
1817
|
+
* If `transparent`, the output format must support transparency
|
|
1818
|
+
* (i.e. `png` or `webp`).
|
|
1819
|
+
*/
|
|
1820
|
+
background: z9.enum(["transparent", "opaque", "auto"]).optional(),
|
|
1821
|
+
/**
|
|
1822
|
+
* Format in which the generated image(s) are returned.
|
|
1823
|
+
*/
|
|
1824
|
+
outputFormat: z9.enum(["png", "jpeg", "webp"]).optional(),
|
|
1825
|
+
/**
|
|
1826
|
+
* Compression level (0-100) for the generated image(s). Applies to the
|
|
1827
|
+
* `jpeg` and `webp` output formats.
|
|
1828
|
+
*/
|
|
1829
|
+
outputCompression: z9.number().int().min(0).max(100).optional(),
|
|
1830
|
+
/**
|
|
1831
|
+
* A unique identifier representing your end-user, which can help OpenAI
|
|
1832
|
+
* to monitor and detect abuse.
|
|
1833
|
+
*/
|
|
1834
|
+
user: z9.string().optional()
|
|
1835
|
+
});
|
|
1836
|
+
var openaiImageModelOptions = lazySchema8(
|
|
1837
|
+
() => zodSchema8(baseImageModelOptionsObject)
|
|
1838
|
+
);
|
|
1839
|
+
var openaiImageModelGenerationOptions = lazySchema8(
|
|
1840
|
+
() => zodSchema8(
|
|
1841
|
+
baseImageModelOptionsObject.extend({
|
|
1842
|
+
/**
|
|
1843
|
+
* Style of the generated image. `vivid` produces hyper-real and
|
|
1844
|
+
* dramatic images; `natural` produces more subdued, less hyper-real
|
|
1845
|
+
* looking images.
|
|
1846
|
+
*/
|
|
1847
|
+
style: z9.enum(["vivid", "natural"]).optional(),
|
|
1848
|
+
/**
|
|
1849
|
+
* Content moderation level for the generated image(s). `low` applies
|
|
1850
|
+
* less restrictive filtering.
|
|
1851
|
+
*/
|
|
1852
|
+
moderation: z9.enum(["auto", "low"]).optional()
|
|
1853
|
+
})
|
|
1854
|
+
)
|
|
1855
|
+
);
|
|
1856
|
+
var openaiImageModelEditOptions = lazySchema8(
|
|
1857
|
+
() => zodSchema8(
|
|
1858
|
+
baseImageModelOptionsObject.extend({
|
|
1859
|
+
/**
|
|
1860
|
+
* Fidelity of the output image(s) to the input image(s).
|
|
1861
|
+
*/
|
|
1862
|
+
inputFidelity: z9.enum(["high", "low"]).optional()
|
|
1863
|
+
})
|
|
1864
|
+
)
|
|
1865
|
+
);
|
|
1786
1866
|
|
|
1787
1867
|
// src/image/openai-image-model.ts
|
|
1788
1868
|
var OpenAIImageModel = class {
|
|
@@ -1824,6 +1904,11 @@ var OpenAIImageModel = class {
|
|
|
1824
1904
|
}
|
|
1825
1905
|
const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
|
|
1826
1906
|
if (files != null) {
|
|
1907
|
+
const openaiOptions2 = (_d = await parseProviderOptions4({
|
|
1908
|
+
provider: "openai",
|
|
1909
|
+
providerOptions,
|
|
1910
|
+
schema: openaiImageModelEditOptions
|
|
1911
|
+
})) != null ? _d : {};
|
|
1827
1912
|
const { value: response2, responseHeaders: responseHeaders2 } = await postFormDataToApi({
|
|
1828
1913
|
url: this.config.url({
|
|
1829
1914
|
path: "/images/edits",
|
|
@@ -1850,7 +1935,12 @@ var OpenAIImageModel = class {
|
|
|
1850
1935
|
mask: mask != null ? await fileToBlob(mask) : void 0,
|
|
1851
1936
|
n,
|
|
1852
1937
|
size,
|
|
1853
|
-
|
|
1938
|
+
quality: openaiOptions2.quality,
|
|
1939
|
+
background: openaiOptions2.background,
|
|
1940
|
+
output_format: openaiOptions2.outputFormat,
|
|
1941
|
+
output_compression: openaiOptions2.outputCompression,
|
|
1942
|
+
input_fidelity: openaiOptions2.inputFidelity,
|
|
1943
|
+
user: openaiOptions2.user
|
|
1854
1944
|
}),
|
|
1855
1945
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
1856
1946
|
successfulResponseHandler: createJsonResponseHandler4(
|
|
@@ -1894,6 +1984,11 @@ var OpenAIImageModel = class {
|
|
|
1894
1984
|
}
|
|
1895
1985
|
};
|
|
1896
1986
|
}
|
|
1987
|
+
const openaiOptions = (_h = await parseProviderOptions4({
|
|
1988
|
+
provider: "openai",
|
|
1989
|
+
providerOptions,
|
|
1990
|
+
schema: openaiImageModelGenerationOptions
|
|
1991
|
+
})) != null ? _h : {};
|
|
1897
1992
|
const { value: response, responseHeaders } = await postJsonToApi4({
|
|
1898
1993
|
url: this.config.url({
|
|
1899
1994
|
path: "/images/generations",
|
|
@@ -1905,7 +2000,13 @@ var OpenAIImageModel = class {
|
|
|
1905
2000
|
prompt,
|
|
1906
2001
|
n,
|
|
1907
2002
|
size,
|
|
1908
|
-
|
|
2003
|
+
quality: openaiOptions.quality,
|
|
2004
|
+
style: openaiOptions.style,
|
|
2005
|
+
background: openaiOptions.background,
|
|
2006
|
+
moderation: openaiOptions.moderation,
|
|
2007
|
+
output_format: openaiOptions.outputFormat,
|
|
2008
|
+
output_compression: openaiOptions.outputCompression,
|
|
2009
|
+
user: openaiOptions.user,
|
|
1909
2010
|
...!hasDefaultResponseFormat(this.modelId) ? { response_format: "b64_json" } : {}
|
|
1910
2011
|
},
|
|
1911
2012
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
@@ -1980,42 +2081,42 @@ async function fileToBlob(file) {
|
|
|
1980
2081
|
// src/tool/apply-patch.ts
|
|
1981
2082
|
import {
|
|
1982
2083
|
createProviderToolFactoryWithOutputSchema,
|
|
1983
|
-
lazySchema as
|
|
1984
|
-
zodSchema as
|
|
2084
|
+
lazySchema as lazySchema9,
|
|
2085
|
+
zodSchema as zodSchema9
|
|
1985
2086
|
} from "@ai-sdk/provider-utils";
|
|
1986
|
-
import { z as
|
|
1987
|
-
var applyPatchInputSchema =
|
|
1988
|
-
() =>
|
|
1989
|
-
|
|
1990
|
-
callId:
|
|
1991
|
-
operation:
|
|
1992
|
-
|
|
1993
|
-
type:
|
|
1994
|
-
path:
|
|
1995
|
-
diff:
|
|
2087
|
+
import { z as z10 } from "zod/v4";
|
|
2088
|
+
var applyPatchInputSchema = lazySchema9(
|
|
2089
|
+
() => zodSchema9(
|
|
2090
|
+
z10.object({
|
|
2091
|
+
callId: z10.string(),
|
|
2092
|
+
operation: z10.discriminatedUnion("type", [
|
|
2093
|
+
z10.object({
|
|
2094
|
+
type: z10.literal("create_file"),
|
|
2095
|
+
path: z10.string(),
|
|
2096
|
+
diff: z10.string()
|
|
1996
2097
|
}),
|
|
1997
|
-
|
|
1998
|
-
type:
|
|
1999
|
-
path:
|
|
2098
|
+
z10.object({
|
|
2099
|
+
type: z10.literal("delete_file"),
|
|
2100
|
+
path: z10.string()
|
|
2000
2101
|
}),
|
|
2001
|
-
|
|
2002
|
-
type:
|
|
2003
|
-
path:
|
|
2004
|
-
diff:
|
|
2102
|
+
z10.object({
|
|
2103
|
+
type: z10.literal("update_file"),
|
|
2104
|
+
path: z10.string(),
|
|
2105
|
+
diff: z10.string()
|
|
2005
2106
|
})
|
|
2006
2107
|
])
|
|
2007
2108
|
})
|
|
2008
2109
|
)
|
|
2009
2110
|
);
|
|
2010
|
-
var applyPatchOutputSchema =
|
|
2011
|
-
() =>
|
|
2012
|
-
|
|
2013
|
-
status:
|
|
2014
|
-
output:
|
|
2111
|
+
var applyPatchOutputSchema = lazySchema9(
|
|
2112
|
+
() => zodSchema9(
|
|
2113
|
+
z10.object({
|
|
2114
|
+
status: z10.enum(["completed", "failed"]),
|
|
2115
|
+
output: z10.string().optional()
|
|
2015
2116
|
})
|
|
2016
2117
|
)
|
|
2017
2118
|
);
|
|
2018
|
-
var applyPatchArgsSchema =
|
|
2119
|
+
var applyPatchArgsSchema = lazySchema9(() => zodSchema9(z10.object({})));
|
|
2019
2120
|
var applyPatchToolFactory = createProviderToolFactoryWithOutputSchema({
|
|
2020
2121
|
id: "openai.apply_patch",
|
|
2021
2122
|
inputSchema: applyPatchInputSchema,
|
|
@@ -2026,37 +2127,37 @@ var applyPatch = applyPatchToolFactory;
|
|
|
2026
2127
|
// src/tool/code-interpreter.ts
|
|
2027
2128
|
import {
|
|
2028
2129
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
|
|
2029
|
-
lazySchema as
|
|
2030
|
-
zodSchema as
|
|
2130
|
+
lazySchema as lazySchema10,
|
|
2131
|
+
zodSchema as zodSchema10
|
|
2031
2132
|
} from "@ai-sdk/provider-utils";
|
|
2032
|
-
import { z as
|
|
2033
|
-
var codeInterpreterInputSchema =
|
|
2034
|
-
() =>
|
|
2035
|
-
|
|
2036
|
-
code:
|
|
2037
|
-
containerId:
|
|
2133
|
+
import { z as z11 } from "zod/v4";
|
|
2134
|
+
var codeInterpreterInputSchema = lazySchema10(
|
|
2135
|
+
() => zodSchema10(
|
|
2136
|
+
z11.object({
|
|
2137
|
+
code: z11.string().nullish(),
|
|
2138
|
+
containerId: z11.string()
|
|
2038
2139
|
})
|
|
2039
2140
|
)
|
|
2040
2141
|
);
|
|
2041
|
-
var codeInterpreterOutputSchema =
|
|
2042
|
-
() =>
|
|
2043
|
-
|
|
2044
|
-
outputs:
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2142
|
+
var codeInterpreterOutputSchema = lazySchema10(
|
|
2143
|
+
() => zodSchema10(
|
|
2144
|
+
z11.object({
|
|
2145
|
+
outputs: z11.array(
|
|
2146
|
+
z11.discriminatedUnion("type", [
|
|
2147
|
+
z11.object({ type: z11.literal("logs"), logs: z11.string() }),
|
|
2148
|
+
z11.object({ type: z11.literal("image"), url: z11.string() })
|
|
2048
2149
|
])
|
|
2049
2150
|
).nullish()
|
|
2050
2151
|
})
|
|
2051
2152
|
)
|
|
2052
2153
|
);
|
|
2053
|
-
var codeInterpreterArgsSchema =
|
|
2054
|
-
() =>
|
|
2055
|
-
|
|
2056
|
-
container:
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
fileIds:
|
|
2154
|
+
var codeInterpreterArgsSchema = lazySchema10(
|
|
2155
|
+
() => zodSchema10(
|
|
2156
|
+
z11.object({
|
|
2157
|
+
container: z11.union([
|
|
2158
|
+
z11.string(),
|
|
2159
|
+
z11.object({
|
|
2160
|
+
fileIds: z11.array(z11.string()).optional()
|
|
2060
2161
|
})
|
|
2061
2162
|
]).optional()
|
|
2062
2163
|
})
|
|
@@ -2074,29 +2175,29 @@ var codeInterpreter = (args = {}) => {
|
|
|
2074
2175
|
// src/tool/custom.ts
|
|
2075
2176
|
import {
|
|
2076
2177
|
createProviderToolFactory,
|
|
2077
|
-
lazySchema as
|
|
2078
|
-
zodSchema as
|
|
2178
|
+
lazySchema as lazySchema11,
|
|
2179
|
+
zodSchema as zodSchema11
|
|
2079
2180
|
} from "@ai-sdk/provider-utils";
|
|
2080
|
-
import { z as
|
|
2081
|
-
var customArgsSchema =
|
|
2082
|
-
() =>
|
|
2083
|
-
|
|
2084
|
-
name:
|
|
2085
|
-
description:
|
|
2086
|
-
format:
|
|
2087
|
-
|
|
2088
|
-
type:
|
|
2089
|
-
syntax:
|
|
2090
|
-
definition:
|
|
2181
|
+
import { z as z12 } from "zod/v4";
|
|
2182
|
+
var customArgsSchema = lazySchema11(
|
|
2183
|
+
() => zodSchema11(
|
|
2184
|
+
z12.object({
|
|
2185
|
+
name: z12.string(),
|
|
2186
|
+
description: z12.string().optional(),
|
|
2187
|
+
format: z12.union([
|
|
2188
|
+
z12.object({
|
|
2189
|
+
type: z12.literal("grammar"),
|
|
2190
|
+
syntax: z12.enum(["regex", "lark"]),
|
|
2191
|
+
definition: z12.string()
|
|
2091
2192
|
}),
|
|
2092
|
-
|
|
2093
|
-
type:
|
|
2193
|
+
z12.object({
|
|
2194
|
+
type: z12.literal("text")
|
|
2094
2195
|
})
|
|
2095
2196
|
]).optional()
|
|
2096
2197
|
})
|
|
2097
2198
|
)
|
|
2098
2199
|
);
|
|
2099
|
-
var customInputSchema =
|
|
2200
|
+
var customInputSchema = lazySchema11(() => zodSchema11(z12.string()));
|
|
2100
2201
|
var customToolFactory = createProviderToolFactory({
|
|
2101
2202
|
id: "openai.custom",
|
|
2102
2203
|
inputSchema: customInputSchema
|
|
@@ -2106,45 +2207,45 @@ var customTool = (args) => customToolFactory(args);
|
|
|
2106
2207
|
// src/tool/file-search.ts
|
|
2107
2208
|
import {
|
|
2108
2209
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
|
|
2109
|
-
lazySchema as
|
|
2110
|
-
zodSchema as
|
|
2210
|
+
lazySchema as lazySchema12,
|
|
2211
|
+
zodSchema as zodSchema12
|
|
2111
2212
|
} from "@ai-sdk/provider-utils";
|
|
2112
|
-
import { z as
|
|
2113
|
-
var comparisonFilterSchema =
|
|
2114
|
-
key:
|
|
2115
|
-
type:
|
|
2116
|
-
value:
|
|
2213
|
+
import { z as z13 } from "zod/v4";
|
|
2214
|
+
var comparisonFilterSchema = z13.object({
|
|
2215
|
+
key: z13.string(),
|
|
2216
|
+
type: z13.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
2217
|
+
value: z13.union([z13.string(), z13.number(), z13.boolean(), z13.array(z13.string())])
|
|
2117
2218
|
});
|
|
2118
|
-
var compoundFilterSchema =
|
|
2119
|
-
type:
|
|
2120
|
-
filters:
|
|
2121
|
-
|
|
2219
|
+
var compoundFilterSchema = z13.object({
|
|
2220
|
+
type: z13.enum(["and", "or"]),
|
|
2221
|
+
filters: z13.array(
|
|
2222
|
+
z13.union([comparisonFilterSchema, z13.lazy(() => compoundFilterSchema)])
|
|
2122
2223
|
)
|
|
2123
2224
|
});
|
|
2124
|
-
var fileSearchArgsSchema =
|
|
2125
|
-
() =>
|
|
2126
|
-
|
|
2127
|
-
vectorStoreIds:
|
|
2128
|
-
maxNumResults:
|
|
2129
|
-
ranking:
|
|
2130
|
-
ranker:
|
|
2131
|
-
scoreThreshold:
|
|
2225
|
+
var fileSearchArgsSchema = lazySchema12(
|
|
2226
|
+
() => zodSchema12(
|
|
2227
|
+
z13.object({
|
|
2228
|
+
vectorStoreIds: z13.array(z13.string()),
|
|
2229
|
+
maxNumResults: z13.number().optional(),
|
|
2230
|
+
ranking: z13.object({
|
|
2231
|
+
ranker: z13.string().optional(),
|
|
2232
|
+
scoreThreshold: z13.number().optional()
|
|
2132
2233
|
}).optional(),
|
|
2133
|
-
filters:
|
|
2234
|
+
filters: z13.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
2134
2235
|
})
|
|
2135
2236
|
)
|
|
2136
2237
|
);
|
|
2137
|
-
var fileSearchOutputSchema =
|
|
2138
|
-
() =>
|
|
2139
|
-
|
|
2140
|
-
queries:
|
|
2141
|
-
results:
|
|
2142
|
-
|
|
2143
|
-
attributes:
|
|
2144
|
-
fileId:
|
|
2145
|
-
filename:
|
|
2146
|
-
score:
|
|
2147
|
-
text:
|
|
2238
|
+
var fileSearchOutputSchema = lazySchema12(
|
|
2239
|
+
() => zodSchema12(
|
|
2240
|
+
z13.object({
|
|
2241
|
+
queries: z13.array(z13.string()),
|
|
2242
|
+
results: z13.array(
|
|
2243
|
+
z13.object({
|
|
2244
|
+
attributes: z13.record(z13.string(), z13.unknown()),
|
|
2245
|
+
fileId: z13.string(),
|
|
2246
|
+
filename: z13.string(),
|
|
2247
|
+
score: z13.number(),
|
|
2248
|
+
text: z13.string()
|
|
2148
2249
|
})
|
|
2149
2250
|
).nullable()
|
|
2150
2251
|
})
|
|
@@ -2152,39 +2253,39 @@ var fileSearchOutputSchema = lazySchema11(
|
|
|
2152
2253
|
);
|
|
2153
2254
|
var fileSearch = createProviderToolFactoryWithOutputSchema3({
|
|
2154
2255
|
id: "openai.file_search",
|
|
2155
|
-
inputSchema:
|
|
2256
|
+
inputSchema: z13.object({}),
|
|
2156
2257
|
outputSchema: fileSearchOutputSchema
|
|
2157
2258
|
});
|
|
2158
2259
|
|
|
2159
2260
|
// src/tool/image-generation.ts
|
|
2160
2261
|
import {
|
|
2161
2262
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
|
|
2162
|
-
lazySchema as
|
|
2163
|
-
zodSchema as
|
|
2263
|
+
lazySchema as lazySchema13,
|
|
2264
|
+
zodSchema as zodSchema13
|
|
2164
2265
|
} from "@ai-sdk/provider-utils";
|
|
2165
|
-
import { z as
|
|
2166
|
-
var imageGenerationArgsSchema =
|
|
2167
|
-
() =>
|
|
2168
|
-
|
|
2169
|
-
background:
|
|
2170
|
-
inputFidelity:
|
|
2171
|
-
inputImageMask:
|
|
2172
|
-
fileId:
|
|
2173
|
-
imageUrl:
|
|
2266
|
+
import { z as z14 } from "zod/v4";
|
|
2267
|
+
var imageGenerationArgsSchema = lazySchema13(
|
|
2268
|
+
() => zodSchema13(
|
|
2269
|
+
z14.object({
|
|
2270
|
+
background: z14.enum(["auto", "opaque", "transparent"]).optional(),
|
|
2271
|
+
inputFidelity: z14.enum(["low", "high"]).optional(),
|
|
2272
|
+
inputImageMask: z14.object({
|
|
2273
|
+
fileId: z14.string().optional(),
|
|
2274
|
+
imageUrl: z14.string().optional()
|
|
2174
2275
|
}).optional(),
|
|
2175
|
-
model:
|
|
2176
|
-
moderation:
|
|
2177
|
-
outputCompression:
|
|
2178
|
-
outputFormat:
|
|
2179
|
-
partialImages:
|
|
2180
|
-
quality:
|
|
2181
|
-
size:
|
|
2276
|
+
model: z14.string().optional(),
|
|
2277
|
+
moderation: z14.enum(["auto"]).optional(),
|
|
2278
|
+
outputCompression: z14.number().int().min(0).max(100).optional(),
|
|
2279
|
+
outputFormat: z14.enum(["png", "jpeg", "webp"]).optional(),
|
|
2280
|
+
partialImages: z14.number().int().min(0).max(3).optional(),
|
|
2281
|
+
quality: z14.enum(["auto", "low", "medium", "high"]).optional(),
|
|
2282
|
+
size: z14.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
2182
2283
|
}).strict()
|
|
2183
2284
|
)
|
|
2184
2285
|
);
|
|
2185
|
-
var imageGenerationInputSchema =
|
|
2186
|
-
var imageGenerationOutputSchema =
|
|
2187
|
-
() =>
|
|
2286
|
+
var imageGenerationInputSchema = lazySchema13(() => zodSchema13(z14.object({})));
|
|
2287
|
+
var imageGenerationOutputSchema = lazySchema13(
|
|
2288
|
+
() => zodSchema13(z14.object({ result: z14.string() }))
|
|
2188
2289
|
);
|
|
2189
2290
|
var imageGenerationToolFactory = createProviderToolFactoryWithOutputSchema4({
|
|
2190
2291
|
id: "openai.image_generation",
|
|
@@ -2198,26 +2299,26 @@ var imageGeneration = (args = {}) => {
|
|
|
2198
2299
|
// src/tool/local-shell.ts
|
|
2199
2300
|
import {
|
|
2200
2301
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
|
|
2201
|
-
lazySchema as
|
|
2202
|
-
zodSchema as
|
|
2302
|
+
lazySchema as lazySchema14,
|
|
2303
|
+
zodSchema as zodSchema14
|
|
2203
2304
|
} from "@ai-sdk/provider-utils";
|
|
2204
|
-
import { z as
|
|
2205
|
-
var localShellInputSchema =
|
|
2206
|
-
() =>
|
|
2207
|
-
|
|
2208
|
-
action:
|
|
2209
|
-
type:
|
|
2210
|
-
command:
|
|
2211
|
-
timeoutMs:
|
|
2212
|
-
user:
|
|
2213
|
-
workingDirectory:
|
|
2214
|
-
env:
|
|
2305
|
+
import { z as z15 } from "zod/v4";
|
|
2306
|
+
var localShellInputSchema = lazySchema14(
|
|
2307
|
+
() => zodSchema14(
|
|
2308
|
+
z15.object({
|
|
2309
|
+
action: z15.object({
|
|
2310
|
+
type: z15.literal("exec"),
|
|
2311
|
+
command: z15.array(z15.string()),
|
|
2312
|
+
timeoutMs: z15.number().optional(),
|
|
2313
|
+
user: z15.string().optional(),
|
|
2314
|
+
workingDirectory: z15.string().optional(),
|
|
2315
|
+
env: z15.record(z15.string(), z15.string()).optional()
|
|
2215
2316
|
})
|
|
2216
2317
|
})
|
|
2217
2318
|
)
|
|
2218
2319
|
);
|
|
2219
|
-
var localShellOutputSchema =
|
|
2220
|
-
() =>
|
|
2320
|
+
var localShellOutputSchema = lazySchema14(
|
|
2321
|
+
() => zodSchema14(z15.object({ output: z15.string() }))
|
|
2221
2322
|
);
|
|
2222
2323
|
var localShell = createProviderToolFactoryWithOutputSchema5({
|
|
2223
2324
|
id: "openai.local_shell",
|
|
@@ -2228,91 +2329,91 @@ var localShell = createProviderToolFactoryWithOutputSchema5({
|
|
|
2228
2329
|
// src/tool/shell.ts
|
|
2229
2330
|
import {
|
|
2230
2331
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
|
|
2231
|
-
lazySchema as
|
|
2232
|
-
zodSchema as
|
|
2332
|
+
lazySchema as lazySchema15,
|
|
2333
|
+
zodSchema as zodSchema15
|
|
2233
2334
|
} from "@ai-sdk/provider-utils";
|
|
2234
|
-
import { z as
|
|
2235
|
-
var shellInputSchema =
|
|
2236
|
-
() =>
|
|
2237
|
-
|
|
2238
|
-
action:
|
|
2239
|
-
commands:
|
|
2240
|
-
timeoutMs:
|
|
2241
|
-
maxOutputLength:
|
|
2335
|
+
import { z as z16 } from "zod/v4";
|
|
2336
|
+
var shellInputSchema = lazySchema15(
|
|
2337
|
+
() => zodSchema15(
|
|
2338
|
+
z16.object({
|
|
2339
|
+
action: z16.object({
|
|
2340
|
+
commands: z16.array(z16.string()),
|
|
2341
|
+
timeoutMs: z16.number().optional(),
|
|
2342
|
+
maxOutputLength: z16.number().optional()
|
|
2242
2343
|
})
|
|
2243
2344
|
})
|
|
2244
2345
|
)
|
|
2245
2346
|
);
|
|
2246
|
-
var shellOutputSchema =
|
|
2247
|
-
() =>
|
|
2248
|
-
|
|
2249
|
-
output:
|
|
2250
|
-
|
|
2251
|
-
stdout:
|
|
2252
|
-
stderr:
|
|
2253
|
-
outcome:
|
|
2254
|
-
|
|
2255
|
-
|
|
2347
|
+
var shellOutputSchema = lazySchema15(
|
|
2348
|
+
() => zodSchema15(
|
|
2349
|
+
z16.object({
|
|
2350
|
+
output: z16.array(
|
|
2351
|
+
z16.object({
|
|
2352
|
+
stdout: z16.string(),
|
|
2353
|
+
stderr: z16.string(),
|
|
2354
|
+
outcome: z16.discriminatedUnion("type", [
|
|
2355
|
+
z16.object({ type: z16.literal("timeout") }),
|
|
2356
|
+
z16.object({ type: z16.literal("exit"), exitCode: z16.number() })
|
|
2256
2357
|
])
|
|
2257
2358
|
})
|
|
2258
2359
|
)
|
|
2259
2360
|
})
|
|
2260
2361
|
)
|
|
2261
2362
|
);
|
|
2262
|
-
var shellSkillsSchema =
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
type:
|
|
2266
|
-
skillId:
|
|
2267
|
-
version:
|
|
2363
|
+
var shellSkillsSchema = z16.array(
|
|
2364
|
+
z16.discriminatedUnion("type", [
|
|
2365
|
+
z16.object({
|
|
2366
|
+
type: z16.literal("skillReference"),
|
|
2367
|
+
skillId: z16.string(),
|
|
2368
|
+
version: z16.string().optional()
|
|
2268
2369
|
}),
|
|
2269
|
-
|
|
2270
|
-
type:
|
|
2271
|
-
name:
|
|
2272
|
-
description:
|
|
2273
|
-
source:
|
|
2274
|
-
type:
|
|
2275
|
-
mediaType:
|
|
2276
|
-
data:
|
|
2370
|
+
z16.object({
|
|
2371
|
+
type: z16.literal("inline"),
|
|
2372
|
+
name: z16.string(),
|
|
2373
|
+
description: z16.string(),
|
|
2374
|
+
source: z16.object({
|
|
2375
|
+
type: z16.literal("base64"),
|
|
2376
|
+
mediaType: z16.literal("application/zip"),
|
|
2377
|
+
data: z16.string()
|
|
2277
2378
|
})
|
|
2278
2379
|
})
|
|
2279
2380
|
])
|
|
2280
2381
|
).optional();
|
|
2281
|
-
var shellArgsSchema =
|
|
2282
|
-
() =>
|
|
2283
|
-
|
|
2284
|
-
environment:
|
|
2285
|
-
|
|
2286
|
-
type:
|
|
2287
|
-
fileIds:
|
|
2288
|
-
memoryLimit:
|
|
2289
|
-
networkPolicy:
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
type:
|
|
2293
|
-
allowedDomains:
|
|
2294
|
-
domainSecrets:
|
|
2295
|
-
|
|
2296
|
-
domain:
|
|
2297
|
-
name:
|
|
2298
|
-
value:
|
|
2382
|
+
var shellArgsSchema = lazySchema15(
|
|
2383
|
+
() => zodSchema15(
|
|
2384
|
+
z16.object({
|
|
2385
|
+
environment: z16.union([
|
|
2386
|
+
z16.object({
|
|
2387
|
+
type: z16.literal("containerAuto"),
|
|
2388
|
+
fileIds: z16.array(z16.string()).optional(),
|
|
2389
|
+
memoryLimit: z16.enum(["1g", "4g", "16g", "64g"]).optional(),
|
|
2390
|
+
networkPolicy: z16.discriminatedUnion("type", [
|
|
2391
|
+
z16.object({ type: z16.literal("disabled") }),
|
|
2392
|
+
z16.object({
|
|
2393
|
+
type: z16.literal("allowlist"),
|
|
2394
|
+
allowedDomains: z16.array(z16.string()),
|
|
2395
|
+
domainSecrets: z16.array(
|
|
2396
|
+
z16.object({
|
|
2397
|
+
domain: z16.string(),
|
|
2398
|
+
name: z16.string(),
|
|
2399
|
+
value: z16.string()
|
|
2299
2400
|
})
|
|
2300
2401
|
).optional()
|
|
2301
2402
|
})
|
|
2302
2403
|
]).optional(),
|
|
2303
2404
|
skills: shellSkillsSchema
|
|
2304
2405
|
}),
|
|
2305
|
-
|
|
2306
|
-
type:
|
|
2307
|
-
containerId:
|
|
2406
|
+
z16.object({
|
|
2407
|
+
type: z16.literal("containerReference"),
|
|
2408
|
+
containerId: z16.string()
|
|
2308
2409
|
}),
|
|
2309
|
-
|
|
2310
|
-
type:
|
|
2311
|
-
skills:
|
|
2312
|
-
|
|
2313
|
-
name:
|
|
2314
|
-
description:
|
|
2315
|
-
path:
|
|
2410
|
+
z16.object({
|
|
2411
|
+
type: z16.literal("local").optional(),
|
|
2412
|
+
skills: z16.array(
|
|
2413
|
+
z16.object({
|
|
2414
|
+
name: z16.string(),
|
|
2415
|
+
description: z16.string(),
|
|
2416
|
+
path: z16.string()
|
|
2316
2417
|
})
|
|
2317
2418
|
).optional()
|
|
2318
2419
|
})
|
|
@@ -2329,31 +2430,31 @@ var shell = createProviderToolFactoryWithOutputSchema6({
|
|
|
2329
2430
|
// src/tool/tool-search.ts
|
|
2330
2431
|
import {
|
|
2331
2432
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
|
|
2332
|
-
lazySchema as
|
|
2333
|
-
zodSchema as
|
|
2433
|
+
lazySchema as lazySchema16,
|
|
2434
|
+
zodSchema as zodSchema16
|
|
2334
2435
|
} from "@ai-sdk/provider-utils";
|
|
2335
|
-
import { z as
|
|
2336
|
-
var toolSearchArgsSchema =
|
|
2337
|
-
() =>
|
|
2338
|
-
|
|
2339
|
-
execution:
|
|
2340
|
-
description:
|
|
2341
|
-
parameters:
|
|
2436
|
+
import { z as z17 } from "zod/v4";
|
|
2437
|
+
var toolSearchArgsSchema = lazySchema16(
|
|
2438
|
+
() => zodSchema16(
|
|
2439
|
+
z17.object({
|
|
2440
|
+
execution: z17.enum(["server", "client"]).optional(),
|
|
2441
|
+
description: z17.string().optional(),
|
|
2442
|
+
parameters: z17.record(z17.string(), z17.unknown()).optional()
|
|
2342
2443
|
})
|
|
2343
2444
|
)
|
|
2344
2445
|
);
|
|
2345
|
-
var toolSearchInputSchema =
|
|
2346
|
-
() =>
|
|
2347
|
-
|
|
2348
|
-
arguments:
|
|
2349
|
-
call_id:
|
|
2446
|
+
var toolSearchInputSchema = lazySchema16(
|
|
2447
|
+
() => zodSchema16(
|
|
2448
|
+
z17.object({
|
|
2449
|
+
arguments: z17.unknown().optional(),
|
|
2450
|
+
call_id: z17.string().nullish()
|
|
2350
2451
|
})
|
|
2351
2452
|
)
|
|
2352
2453
|
);
|
|
2353
|
-
var toolSearchOutputSchema =
|
|
2354
|
-
() =>
|
|
2355
|
-
|
|
2356
|
-
tools:
|
|
2454
|
+
var toolSearchOutputSchema = lazySchema16(
|
|
2455
|
+
() => zodSchema16(
|
|
2456
|
+
z17.object({
|
|
2457
|
+
tools: z17.array(z17.record(z17.string(), z17.unknown()))
|
|
2357
2458
|
})
|
|
2358
2459
|
)
|
|
2359
2460
|
);
|
|
@@ -2367,71 +2468,15 @@ var toolSearch = (args = {}) => toolSearchToolFactory(args);
|
|
|
2367
2468
|
// src/tool/web-search.ts
|
|
2368
2469
|
import {
|
|
2369
2470
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
|
|
2370
|
-
lazySchema as lazySchema16,
|
|
2371
|
-
zodSchema as zodSchema16
|
|
2372
|
-
} from "@ai-sdk/provider-utils";
|
|
2373
|
-
import { z as z17 } from "zod/v4";
|
|
2374
|
-
var webSearchArgsSchema = lazySchema16(
|
|
2375
|
-
() => zodSchema16(
|
|
2376
|
-
z17.object({
|
|
2377
|
-
externalWebAccess: z17.boolean().optional(),
|
|
2378
|
-
filters: z17.object({ allowedDomains: z17.array(z17.string()).optional() }).optional(),
|
|
2379
|
-
searchContextSize: z17.enum(["low", "medium", "high"]).optional(),
|
|
2380
|
-
userLocation: z17.object({
|
|
2381
|
-
type: z17.literal("approximate"),
|
|
2382
|
-
country: z17.string().optional(),
|
|
2383
|
-
city: z17.string().optional(),
|
|
2384
|
-
region: z17.string().optional(),
|
|
2385
|
-
timezone: z17.string().optional()
|
|
2386
|
-
}).optional()
|
|
2387
|
-
})
|
|
2388
|
-
)
|
|
2389
|
-
);
|
|
2390
|
-
var webSearchInputSchema = lazySchema16(() => zodSchema16(z17.object({})));
|
|
2391
|
-
var webSearchOutputSchema = lazySchema16(
|
|
2392
|
-
() => zodSchema16(
|
|
2393
|
-
z17.object({
|
|
2394
|
-
action: z17.discriminatedUnion("type", [
|
|
2395
|
-
z17.object({
|
|
2396
|
-
type: z17.literal("search"),
|
|
2397
|
-
query: z17.string().optional()
|
|
2398
|
-
}),
|
|
2399
|
-
z17.object({
|
|
2400
|
-
type: z17.literal("openPage"),
|
|
2401
|
-
url: z17.string().nullish()
|
|
2402
|
-
}),
|
|
2403
|
-
z17.object({
|
|
2404
|
-
type: z17.literal("findInPage"),
|
|
2405
|
-
url: z17.string().nullish(),
|
|
2406
|
-
pattern: z17.string().nullish()
|
|
2407
|
-
})
|
|
2408
|
-
]).optional(),
|
|
2409
|
-
sources: z17.array(
|
|
2410
|
-
z17.discriminatedUnion("type", [
|
|
2411
|
-
z17.object({ type: z17.literal("url"), url: z17.string() }),
|
|
2412
|
-
z17.object({ type: z17.literal("api"), name: z17.string() })
|
|
2413
|
-
])
|
|
2414
|
-
).optional()
|
|
2415
|
-
})
|
|
2416
|
-
)
|
|
2417
|
-
);
|
|
2418
|
-
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema8({
|
|
2419
|
-
id: "openai.web_search",
|
|
2420
|
-
inputSchema: webSearchInputSchema,
|
|
2421
|
-
outputSchema: webSearchOutputSchema
|
|
2422
|
-
});
|
|
2423
|
-
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
2424
|
-
|
|
2425
|
-
// src/tool/web-search-preview.ts
|
|
2426
|
-
import {
|
|
2427
|
-
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
|
|
2428
2471
|
lazySchema as lazySchema17,
|
|
2429
2472
|
zodSchema as zodSchema17
|
|
2430
2473
|
} from "@ai-sdk/provider-utils";
|
|
2431
2474
|
import { z as z18 } from "zod/v4";
|
|
2432
|
-
var
|
|
2475
|
+
var webSearchArgsSchema = lazySchema17(
|
|
2433
2476
|
() => zodSchema17(
|
|
2434
2477
|
z18.object({
|
|
2478
|
+
externalWebAccess: z18.boolean().optional(),
|
|
2479
|
+
filters: z18.object({ allowedDomains: z18.array(z18.string()).optional() }).optional(),
|
|
2435
2480
|
searchContextSize: z18.enum(["low", "medium", "high"]).optional(),
|
|
2436
2481
|
userLocation: z18.object({
|
|
2437
2482
|
type: z18.literal("approximate"),
|
|
@@ -2443,10 +2488,8 @@ var webSearchPreviewArgsSchema = lazySchema17(
|
|
|
2443
2488
|
})
|
|
2444
2489
|
)
|
|
2445
2490
|
);
|
|
2446
|
-
var
|
|
2447
|
-
|
|
2448
|
-
);
|
|
2449
|
-
var webSearchPreviewOutputSchema = lazySchema17(
|
|
2491
|
+
var webSearchInputSchema = lazySchema17(() => zodSchema17(z18.object({})));
|
|
2492
|
+
var webSearchOutputSchema = lazySchema17(
|
|
2450
2493
|
() => zodSchema17(
|
|
2451
2494
|
z18.object({
|
|
2452
2495
|
action: z18.discriminatedUnion("type", [
|
|
@@ -2463,6 +2506,64 @@ var webSearchPreviewOutputSchema = lazySchema17(
|
|
|
2463
2506
|
url: z18.string().nullish(),
|
|
2464
2507
|
pattern: z18.string().nullish()
|
|
2465
2508
|
})
|
|
2509
|
+
]).optional(),
|
|
2510
|
+
sources: z18.array(
|
|
2511
|
+
z18.discriminatedUnion("type", [
|
|
2512
|
+
z18.object({ type: z18.literal("url"), url: z18.string() }),
|
|
2513
|
+
z18.object({ type: z18.literal("api"), name: z18.string() })
|
|
2514
|
+
])
|
|
2515
|
+
).optional()
|
|
2516
|
+
})
|
|
2517
|
+
)
|
|
2518
|
+
);
|
|
2519
|
+
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema8({
|
|
2520
|
+
id: "openai.web_search",
|
|
2521
|
+
inputSchema: webSearchInputSchema,
|
|
2522
|
+
outputSchema: webSearchOutputSchema
|
|
2523
|
+
});
|
|
2524
|
+
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
2525
|
+
|
|
2526
|
+
// src/tool/web-search-preview.ts
|
|
2527
|
+
import {
|
|
2528
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
|
|
2529
|
+
lazySchema as lazySchema18,
|
|
2530
|
+
zodSchema as zodSchema18
|
|
2531
|
+
} from "@ai-sdk/provider-utils";
|
|
2532
|
+
import { z as z19 } from "zod/v4";
|
|
2533
|
+
var webSearchPreviewArgsSchema = lazySchema18(
|
|
2534
|
+
() => zodSchema18(
|
|
2535
|
+
z19.object({
|
|
2536
|
+
searchContextSize: z19.enum(["low", "medium", "high"]).optional(),
|
|
2537
|
+
userLocation: z19.object({
|
|
2538
|
+
type: z19.literal("approximate"),
|
|
2539
|
+
country: z19.string().optional(),
|
|
2540
|
+
city: z19.string().optional(),
|
|
2541
|
+
region: z19.string().optional(),
|
|
2542
|
+
timezone: z19.string().optional()
|
|
2543
|
+
}).optional()
|
|
2544
|
+
})
|
|
2545
|
+
)
|
|
2546
|
+
);
|
|
2547
|
+
var webSearchPreviewInputSchema = lazySchema18(
|
|
2548
|
+
() => zodSchema18(z19.object({}))
|
|
2549
|
+
);
|
|
2550
|
+
var webSearchPreviewOutputSchema = lazySchema18(
|
|
2551
|
+
() => zodSchema18(
|
|
2552
|
+
z19.object({
|
|
2553
|
+
action: z19.discriminatedUnion("type", [
|
|
2554
|
+
z19.object({
|
|
2555
|
+
type: z19.literal("search"),
|
|
2556
|
+
query: z19.string().optional()
|
|
2557
|
+
}),
|
|
2558
|
+
z19.object({
|
|
2559
|
+
type: z19.literal("openPage"),
|
|
2560
|
+
url: z19.string().nullish()
|
|
2561
|
+
}),
|
|
2562
|
+
z19.object({
|
|
2563
|
+
type: z19.literal("findInPage"),
|
|
2564
|
+
url: z19.string().nullish(),
|
|
2565
|
+
pattern: z19.string().nullish()
|
|
2566
|
+
})
|
|
2466
2567
|
]).optional()
|
|
2467
2568
|
})
|
|
2468
2569
|
)
|
|
@@ -2476,60 +2577,60 @@ var webSearchPreview = createProviderToolFactoryWithOutputSchema9({
|
|
|
2476
2577
|
// src/tool/mcp.ts
|
|
2477
2578
|
import {
|
|
2478
2579
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema10,
|
|
2479
|
-
lazySchema as
|
|
2480
|
-
zodSchema as
|
|
2580
|
+
lazySchema as lazySchema19,
|
|
2581
|
+
zodSchema as zodSchema19
|
|
2481
2582
|
} from "@ai-sdk/provider-utils";
|
|
2482
|
-
import { z as
|
|
2483
|
-
var jsonValueSchema =
|
|
2484
|
-
() =>
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2583
|
+
import { z as z20 } from "zod/v4";
|
|
2584
|
+
var jsonValueSchema = z20.lazy(
|
|
2585
|
+
() => z20.union([
|
|
2586
|
+
z20.string(),
|
|
2587
|
+
z20.number(),
|
|
2588
|
+
z20.boolean(),
|
|
2589
|
+
z20.null(),
|
|
2590
|
+
z20.array(jsonValueSchema),
|
|
2591
|
+
z20.record(z20.string(), jsonValueSchema)
|
|
2491
2592
|
])
|
|
2492
2593
|
);
|
|
2493
|
-
var mcpArgsSchema =
|
|
2494
|
-
() =>
|
|
2495
|
-
|
|
2496
|
-
serverLabel:
|
|
2497
|
-
allowedTools:
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
readOnly:
|
|
2501
|
-
toolNames:
|
|
2594
|
+
var mcpArgsSchema = lazySchema19(
|
|
2595
|
+
() => zodSchema19(
|
|
2596
|
+
z20.object({
|
|
2597
|
+
serverLabel: z20.string(),
|
|
2598
|
+
allowedTools: z20.union([
|
|
2599
|
+
z20.array(z20.string()),
|
|
2600
|
+
z20.object({
|
|
2601
|
+
readOnly: z20.boolean().optional(),
|
|
2602
|
+
toolNames: z20.array(z20.string()).optional()
|
|
2502
2603
|
})
|
|
2503
2604
|
]).optional(),
|
|
2504
|
-
authorization:
|
|
2505
|
-
connectorId:
|
|
2506
|
-
headers:
|
|
2507
|
-
requireApproval:
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
never:
|
|
2511
|
-
toolNames:
|
|
2605
|
+
authorization: z20.string().optional(),
|
|
2606
|
+
connectorId: z20.string().optional(),
|
|
2607
|
+
headers: z20.record(z20.string(), z20.string()).optional(),
|
|
2608
|
+
requireApproval: z20.union([
|
|
2609
|
+
z20.enum(["always", "never"]),
|
|
2610
|
+
z20.object({
|
|
2611
|
+
never: z20.object({
|
|
2612
|
+
toolNames: z20.array(z20.string()).optional()
|
|
2512
2613
|
}).optional()
|
|
2513
2614
|
})
|
|
2514
2615
|
]).optional(),
|
|
2515
|
-
serverDescription:
|
|
2516
|
-
serverUrl:
|
|
2616
|
+
serverDescription: z20.string().optional(),
|
|
2617
|
+
serverUrl: z20.string().optional()
|
|
2517
2618
|
}).refine(
|
|
2518
2619
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
2519
2620
|
"One of serverUrl or connectorId must be provided."
|
|
2520
2621
|
)
|
|
2521
2622
|
)
|
|
2522
2623
|
);
|
|
2523
|
-
var mcpInputSchema =
|
|
2524
|
-
var mcpOutputSchema =
|
|
2525
|
-
() =>
|
|
2526
|
-
|
|
2527
|
-
type:
|
|
2528
|
-
serverLabel:
|
|
2529
|
-
name:
|
|
2530
|
-
arguments:
|
|
2531
|
-
output:
|
|
2532
|
-
error:
|
|
2624
|
+
var mcpInputSchema = lazySchema19(() => zodSchema19(z20.object({})));
|
|
2625
|
+
var mcpOutputSchema = lazySchema19(
|
|
2626
|
+
() => zodSchema19(
|
|
2627
|
+
z20.object({
|
|
2628
|
+
type: z20.literal("call"),
|
|
2629
|
+
serverLabel: z20.string(),
|
|
2630
|
+
name: z20.string(),
|
|
2631
|
+
arguments: z20.string(),
|
|
2632
|
+
output: z20.string().nullish(),
|
|
2633
|
+
error: z20.union([z20.string(), jsonValueSchema]).optional()
|
|
2533
2634
|
})
|
|
2534
2635
|
)
|
|
2535
2636
|
);
|
|
@@ -2668,7 +2769,7 @@ import {
|
|
|
2668
2769
|
createJsonResponseHandler as createJsonResponseHandler5,
|
|
2669
2770
|
createToolNameMapping,
|
|
2670
2771
|
generateId as generateId2,
|
|
2671
|
-
parseProviderOptions as
|
|
2772
|
+
parseProviderOptions as parseProviderOptions6,
|
|
2672
2773
|
postJsonToApi as postJsonToApi5
|
|
2673
2774
|
} from "@ai-sdk/provider-utils";
|
|
2674
2775
|
|
|
@@ -2719,10 +2820,10 @@ import {
|
|
|
2719
2820
|
convertToBase64 as convertToBase642,
|
|
2720
2821
|
isNonNullable,
|
|
2721
2822
|
parseJSON,
|
|
2722
|
-
parseProviderOptions as
|
|
2823
|
+
parseProviderOptions as parseProviderOptions5,
|
|
2723
2824
|
validateTypes
|
|
2724
2825
|
} from "@ai-sdk/provider-utils";
|
|
2725
|
-
import { z as
|
|
2826
|
+
import { z as z21 } from "zod/v4";
|
|
2726
2827
|
function serializeToolCallArguments2(input) {
|
|
2727
2828
|
return JSON.stringify(input === void 0 ? {} : input);
|
|
2728
2829
|
}
|
|
@@ -3018,7 +3119,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3018
3119
|
break;
|
|
3019
3120
|
}
|
|
3020
3121
|
case "reasoning": {
|
|
3021
|
-
const providerOptions = await
|
|
3122
|
+
const providerOptions = await parseProviderOptions5({
|
|
3022
3123
|
provider: providerOptionsName,
|
|
3023
3124
|
providerOptions: part.providerOptions,
|
|
3024
3125
|
schema: openaiResponsesReasoningProviderOptionsSchema
|
|
@@ -3326,9 +3427,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
3326
3427
|
}
|
|
3327
3428
|
return { input, warnings };
|
|
3328
3429
|
}
|
|
3329
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
3330
|
-
itemId:
|
|
3331
|
-
reasoningEncryptedContent:
|
|
3430
|
+
var openaiResponsesReasoningProviderOptionsSchema = z21.object({
|
|
3431
|
+
itemId: z21.string().nullish(),
|
|
3432
|
+
reasoningEncryptedContent: z21.string().nullish()
|
|
3332
3433
|
});
|
|
3333
3434
|
|
|
3334
3435
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -3350,542 +3451,545 @@ function mapOpenAIResponseFinishReason({
|
|
|
3350
3451
|
}
|
|
3351
3452
|
|
|
3352
3453
|
// src/responses/openai-responses-api.ts
|
|
3353
|
-
import {
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3454
|
+
import {
|
|
3455
|
+
lazySchema as lazySchema20,
|
|
3456
|
+
zodSchema as zodSchema20
|
|
3457
|
+
} from "@ai-sdk/provider-utils";
|
|
3458
|
+
import { z as z22 } from "zod/v4";
|
|
3459
|
+
var jsonValueSchema2 = z22.lazy(
|
|
3460
|
+
() => z22.union([
|
|
3461
|
+
z22.string(),
|
|
3462
|
+
z22.number(),
|
|
3463
|
+
z22.boolean(),
|
|
3464
|
+
z22.null(),
|
|
3465
|
+
z22.array(jsonValueSchema2),
|
|
3466
|
+
z22.record(z22.string(), jsonValueSchema2.optional())
|
|
3363
3467
|
])
|
|
3364
3468
|
);
|
|
3365
|
-
var openaiResponsesChunkSchema =
|
|
3366
|
-
() =>
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
type:
|
|
3370
|
-
item_id:
|
|
3371
|
-
delta:
|
|
3372
|
-
logprobs:
|
|
3373
|
-
|
|
3374
|
-
token:
|
|
3375
|
-
logprob:
|
|
3376
|
-
top_logprobs:
|
|
3377
|
-
|
|
3378
|
-
token:
|
|
3379
|
-
logprob:
|
|
3469
|
+
var openaiResponsesChunkSchema = lazySchema20(
|
|
3470
|
+
() => zodSchema20(
|
|
3471
|
+
z22.union([
|
|
3472
|
+
z22.object({
|
|
3473
|
+
type: z22.literal("response.output_text.delta"),
|
|
3474
|
+
item_id: z22.string(),
|
|
3475
|
+
delta: z22.string(),
|
|
3476
|
+
logprobs: z22.array(
|
|
3477
|
+
z22.object({
|
|
3478
|
+
token: z22.string(),
|
|
3479
|
+
logprob: z22.number(),
|
|
3480
|
+
top_logprobs: z22.array(
|
|
3481
|
+
z22.object({
|
|
3482
|
+
token: z22.string(),
|
|
3483
|
+
logprob: z22.number()
|
|
3380
3484
|
})
|
|
3381
3485
|
)
|
|
3382
3486
|
})
|
|
3383
3487
|
).nullish()
|
|
3384
3488
|
}),
|
|
3385
|
-
|
|
3386
|
-
type:
|
|
3387
|
-
response:
|
|
3388
|
-
incomplete_details:
|
|
3389
|
-
usage:
|
|
3390
|
-
input_tokens:
|
|
3391
|
-
input_tokens_details:
|
|
3392
|
-
output_tokens:
|
|
3393
|
-
output_tokens_details:
|
|
3489
|
+
z22.object({
|
|
3490
|
+
type: z22.enum(["response.completed", "response.incomplete"]),
|
|
3491
|
+
response: z22.object({
|
|
3492
|
+
incomplete_details: z22.object({ reason: z22.string() }).nullish(),
|
|
3493
|
+
usage: z22.object({
|
|
3494
|
+
input_tokens: z22.number(),
|
|
3495
|
+
input_tokens_details: z22.object({ cached_tokens: z22.number().nullish() }).nullish(),
|
|
3496
|
+
output_tokens: z22.number(),
|
|
3497
|
+
output_tokens_details: z22.object({ reasoning_tokens: z22.number().nullish() }).nullish()
|
|
3394
3498
|
}),
|
|
3395
|
-
service_tier:
|
|
3499
|
+
service_tier: z22.string().nullish()
|
|
3396
3500
|
})
|
|
3397
3501
|
}),
|
|
3398
|
-
|
|
3399
|
-
type:
|
|
3400
|
-
response:
|
|
3401
|
-
error:
|
|
3402
|
-
code:
|
|
3403
|
-
message:
|
|
3502
|
+
z22.object({
|
|
3503
|
+
type: z22.literal("response.failed"),
|
|
3504
|
+
response: z22.object({
|
|
3505
|
+
error: z22.object({
|
|
3506
|
+
code: z22.string().nullish(),
|
|
3507
|
+
message: z22.string()
|
|
3404
3508
|
}).nullish(),
|
|
3405
|
-
incomplete_details:
|
|
3406
|
-
usage:
|
|
3407
|
-
input_tokens:
|
|
3408
|
-
input_tokens_details:
|
|
3409
|
-
output_tokens:
|
|
3410
|
-
output_tokens_details:
|
|
3509
|
+
incomplete_details: z22.object({ reason: z22.string() }).nullish(),
|
|
3510
|
+
usage: z22.object({
|
|
3511
|
+
input_tokens: z22.number(),
|
|
3512
|
+
input_tokens_details: z22.object({ cached_tokens: z22.number().nullish() }).nullish(),
|
|
3513
|
+
output_tokens: z22.number(),
|
|
3514
|
+
output_tokens_details: z22.object({ reasoning_tokens: z22.number().nullish() }).nullish()
|
|
3411
3515
|
}).nullish(),
|
|
3412
|
-
service_tier:
|
|
3516
|
+
service_tier: z22.string().nullish()
|
|
3413
3517
|
})
|
|
3414
3518
|
}),
|
|
3415
|
-
|
|
3416
|
-
type:
|
|
3417
|
-
response:
|
|
3418
|
-
id:
|
|
3419
|
-
created_at:
|
|
3420
|
-
model:
|
|
3421
|
-
service_tier:
|
|
3519
|
+
z22.object({
|
|
3520
|
+
type: z22.literal("response.created"),
|
|
3521
|
+
response: z22.object({
|
|
3522
|
+
id: z22.string(),
|
|
3523
|
+
created_at: z22.number(),
|
|
3524
|
+
model: z22.string(),
|
|
3525
|
+
service_tier: z22.string().nullish()
|
|
3422
3526
|
})
|
|
3423
3527
|
}),
|
|
3424
|
-
|
|
3425
|
-
type:
|
|
3426
|
-
output_index:
|
|
3427
|
-
item:
|
|
3428
|
-
|
|
3429
|
-
type:
|
|
3430
|
-
id:
|
|
3431
|
-
phase:
|
|
3528
|
+
z22.object({
|
|
3529
|
+
type: z22.literal("response.output_item.added"),
|
|
3530
|
+
output_index: z22.number(),
|
|
3531
|
+
item: z22.discriminatedUnion("type", [
|
|
3532
|
+
z22.object({
|
|
3533
|
+
type: z22.literal("message"),
|
|
3534
|
+
id: z22.string(),
|
|
3535
|
+
phase: z22.enum(["commentary", "final_answer"]).nullish()
|
|
3432
3536
|
}),
|
|
3433
|
-
|
|
3434
|
-
type:
|
|
3435
|
-
id:
|
|
3436
|
-
encrypted_content:
|
|
3537
|
+
z22.object({
|
|
3538
|
+
type: z22.literal("reasoning"),
|
|
3539
|
+
id: z22.string(),
|
|
3540
|
+
encrypted_content: z22.string().nullish()
|
|
3437
3541
|
}),
|
|
3438
|
-
|
|
3439
|
-
type:
|
|
3440
|
-
id:
|
|
3441
|
-
call_id:
|
|
3442
|
-
name:
|
|
3443
|
-
arguments:
|
|
3542
|
+
z22.object({
|
|
3543
|
+
type: z22.literal("function_call"),
|
|
3544
|
+
id: z22.string(),
|
|
3545
|
+
call_id: z22.string(),
|
|
3546
|
+
name: z22.string(),
|
|
3547
|
+
arguments: z22.string()
|
|
3444
3548
|
}),
|
|
3445
|
-
|
|
3446
|
-
type:
|
|
3447
|
-
id:
|
|
3448
|
-
status:
|
|
3549
|
+
z22.object({
|
|
3550
|
+
type: z22.literal("web_search_call"),
|
|
3551
|
+
id: z22.string(),
|
|
3552
|
+
status: z22.string()
|
|
3449
3553
|
}),
|
|
3450
|
-
|
|
3451
|
-
type:
|
|
3452
|
-
id:
|
|
3453
|
-
status:
|
|
3554
|
+
z22.object({
|
|
3555
|
+
type: z22.literal("computer_call"),
|
|
3556
|
+
id: z22.string(),
|
|
3557
|
+
status: z22.string()
|
|
3454
3558
|
}),
|
|
3455
|
-
|
|
3456
|
-
type:
|
|
3457
|
-
id:
|
|
3559
|
+
z22.object({
|
|
3560
|
+
type: z22.literal("file_search_call"),
|
|
3561
|
+
id: z22.string()
|
|
3458
3562
|
}),
|
|
3459
|
-
|
|
3460
|
-
type:
|
|
3461
|
-
id:
|
|
3563
|
+
z22.object({
|
|
3564
|
+
type: z22.literal("image_generation_call"),
|
|
3565
|
+
id: z22.string()
|
|
3462
3566
|
}),
|
|
3463
|
-
|
|
3464
|
-
type:
|
|
3465
|
-
id:
|
|
3466
|
-
container_id:
|
|
3467
|
-
code:
|
|
3468
|
-
outputs:
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3567
|
+
z22.object({
|
|
3568
|
+
type: z22.literal("code_interpreter_call"),
|
|
3569
|
+
id: z22.string(),
|
|
3570
|
+
container_id: z22.string(),
|
|
3571
|
+
code: z22.string().nullable(),
|
|
3572
|
+
outputs: z22.array(
|
|
3573
|
+
z22.discriminatedUnion("type", [
|
|
3574
|
+
z22.object({ type: z22.literal("logs"), logs: z22.string() }),
|
|
3575
|
+
z22.object({ type: z22.literal("image"), url: z22.string() })
|
|
3472
3576
|
])
|
|
3473
3577
|
).nullable(),
|
|
3474
|
-
status:
|
|
3578
|
+
status: z22.string()
|
|
3475
3579
|
}),
|
|
3476
|
-
|
|
3477
|
-
type:
|
|
3478
|
-
id:
|
|
3479
|
-
status:
|
|
3480
|
-
approval_request_id:
|
|
3580
|
+
z22.object({
|
|
3581
|
+
type: z22.literal("mcp_call"),
|
|
3582
|
+
id: z22.string(),
|
|
3583
|
+
status: z22.string(),
|
|
3584
|
+
approval_request_id: z22.string().nullish()
|
|
3481
3585
|
}),
|
|
3482
|
-
|
|
3483
|
-
type:
|
|
3484
|
-
id:
|
|
3586
|
+
z22.object({
|
|
3587
|
+
type: z22.literal("mcp_list_tools"),
|
|
3588
|
+
id: z22.string()
|
|
3485
3589
|
}),
|
|
3486
|
-
|
|
3487
|
-
type:
|
|
3488
|
-
id:
|
|
3590
|
+
z22.object({
|
|
3591
|
+
type: z22.literal("mcp_approval_request"),
|
|
3592
|
+
id: z22.string()
|
|
3489
3593
|
}),
|
|
3490
|
-
|
|
3491
|
-
type:
|
|
3492
|
-
id:
|
|
3493
|
-
call_id:
|
|
3494
|
-
status:
|
|
3495
|
-
operation:
|
|
3496
|
-
|
|
3497
|
-
type:
|
|
3498
|
-
path:
|
|
3499
|
-
diff:
|
|
3594
|
+
z22.object({
|
|
3595
|
+
type: z22.literal("apply_patch_call"),
|
|
3596
|
+
id: z22.string(),
|
|
3597
|
+
call_id: z22.string(),
|
|
3598
|
+
status: z22.enum(["in_progress", "completed"]),
|
|
3599
|
+
operation: z22.discriminatedUnion("type", [
|
|
3600
|
+
z22.object({
|
|
3601
|
+
type: z22.literal("create_file"),
|
|
3602
|
+
path: z22.string(),
|
|
3603
|
+
diff: z22.string()
|
|
3500
3604
|
}),
|
|
3501
|
-
|
|
3502
|
-
type:
|
|
3503
|
-
path:
|
|
3605
|
+
z22.object({
|
|
3606
|
+
type: z22.literal("delete_file"),
|
|
3607
|
+
path: z22.string()
|
|
3504
3608
|
}),
|
|
3505
|
-
|
|
3506
|
-
type:
|
|
3507
|
-
path:
|
|
3508
|
-
diff:
|
|
3609
|
+
z22.object({
|
|
3610
|
+
type: z22.literal("update_file"),
|
|
3611
|
+
path: z22.string(),
|
|
3612
|
+
diff: z22.string()
|
|
3509
3613
|
})
|
|
3510
3614
|
])
|
|
3511
3615
|
}),
|
|
3512
|
-
|
|
3513
|
-
type:
|
|
3514
|
-
id:
|
|
3515
|
-
call_id:
|
|
3516
|
-
name:
|
|
3517
|
-
input:
|
|
3616
|
+
z22.object({
|
|
3617
|
+
type: z22.literal("custom_tool_call"),
|
|
3618
|
+
id: z22.string(),
|
|
3619
|
+
call_id: z22.string(),
|
|
3620
|
+
name: z22.string(),
|
|
3621
|
+
input: z22.string()
|
|
3518
3622
|
}),
|
|
3519
|
-
|
|
3520
|
-
type:
|
|
3521
|
-
id:
|
|
3522
|
-
call_id:
|
|
3523
|
-
status:
|
|
3524
|
-
action:
|
|
3525
|
-
commands:
|
|
3623
|
+
z22.object({
|
|
3624
|
+
type: z22.literal("shell_call"),
|
|
3625
|
+
id: z22.string(),
|
|
3626
|
+
call_id: z22.string(),
|
|
3627
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3628
|
+
action: z22.object({
|
|
3629
|
+
commands: z22.array(z22.string())
|
|
3526
3630
|
})
|
|
3527
3631
|
}),
|
|
3528
|
-
|
|
3529
|
-
type:
|
|
3530
|
-
id:
|
|
3531
|
-
call_id:
|
|
3532
|
-
status:
|
|
3533
|
-
output:
|
|
3534
|
-
|
|
3535
|
-
stdout:
|
|
3536
|
-
stderr:
|
|
3537
|
-
outcome:
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
type:
|
|
3541
|
-
exit_code:
|
|
3632
|
+
z22.object({
|
|
3633
|
+
type: z22.literal("shell_call_output"),
|
|
3634
|
+
id: z22.string(),
|
|
3635
|
+
call_id: z22.string(),
|
|
3636
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3637
|
+
output: z22.array(
|
|
3638
|
+
z22.object({
|
|
3639
|
+
stdout: z22.string(),
|
|
3640
|
+
stderr: z22.string(),
|
|
3641
|
+
outcome: z22.discriminatedUnion("type", [
|
|
3642
|
+
z22.object({ type: z22.literal("timeout") }),
|
|
3643
|
+
z22.object({
|
|
3644
|
+
type: z22.literal("exit"),
|
|
3645
|
+
exit_code: z22.number()
|
|
3542
3646
|
})
|
|
3543
3647
|
])
|
|
3544
3648
|
})
|
|
3545
3649
|
)
|
|
3546
3650
|
}),
|
|
3547
|
-
|
|
3548
|
-
type:
|
|
3549
|
-
id:
|
|
3550
|
-
execution:
|
|
3551
|
-
call_id:
|
|
3552
|
-
status:
|
|
3553
|
-
arguments:
|
|
3651
|
+
z22.object({
|
|
3652
|
+
type: z22.literal("tool_search_call"),
|
|
3653
|
+
id: z22.string(),
|
|
3654
|
+
execution: z22.enum(["server", "client"]),
|
|
3655
|
+
call_id: z22.string().nullable(),
|
|
3656
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3657
|
+
arguments: z22.unknown()
|
|
3554
3658
|
}),
|
|
3555
|
-
|
|
3556
|
-
type:
|
|
3557
|
-
id:
|
|
3558
|
-
execution:
|
|
3559
|
-
call_id:
|
|
3560
|
-
status:
|
|
3561
|
-
tools:
|
|
3659
|
+
z22.object({
|
|
3660
|
+
type: z22.literal("tool_search_output"),
|
|
3661
|
+
id: z22.string(),
|
|
3662
|
+
execution: z22.enum(["server", "client"]),
|
|
3663
|
+
call_id: z22.string().nullable(),
|
|
3664
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3665
|
+
tools: z22.array(z22.record(z22.string(), jsonValueSchema2.optional()))
|
|
3562
3666
|
})
|
|
3563
3667
|
])
|
|
3564
3668
|
}),
|
|
3565
|
-
|
|
3566
|
-
type:
|
|
3567
|
-
output_index:
|
|
3568
|
-
item:
|
|
3569
|
-
|
|
3570
|
-
type:
|
|
3571
|
-
id:
|
|
3572
|
-
phase:
|
|
3669
|
+
z22.object({
|
|
3670
|
+
type: z22.literal("response.output_item.done"),
|
|
3671
|
+
output_index: z22.number(),
|
|
3672
|
+
item: z22.discriminatedUnion("type", [
|
|
3673
|
+
z22.object({
|
|
3674
|
+
type: z22.literal("message"),
|
|
3675
|
+
id: z22.string(),
|
|
3676
|
+
phase: z22.enum(["commentary", "final_answer"]).nullish()
|
|
3573
3677
|
}),
|
|
3574
|
-
|
|
3575
|
-
type:
|
|
3576
|
-
id:
|
|
3577
|
-
encrypted_content:
|
|
3678
|
+
z22.object({
|
|
3679
|
+
type: z22.literal("reasoning"),
|
|
3680
|
+
id: z22.string(),
|
|
3681
|
+
encrypted_content: z22.string().nullish()
|
|
3578
3682
|
}),
|
|
3579
|
-
|
|
3580
|
-
type:
|
|
3581
|
-
id:
|
|
3582
|
-
call_id:
|
|
3583
|
-
name:
|
|
3584
|
-
arguments:
|
|
3585
|
-
status:
|
|
3683
|
+
z22.object({
|
|
3684
|
+
type: z22.literal("function_call"),
|
|
3685
|
+
id: z22.string(),
|
|
3686
|
+
call_id: z22.string(),
|
|
3687
|
+
name: z22.string(),
|
|
3688
|
+
arguments: z22.string(),
|
|
3689
|
+
status: z22.literal("completed")
|
|
3586
3690
|
}),
|
|
3587
|
-
|
|
3588
|
-
type:
|
|
3589
|
-
id:
|
|
3590
|
-
call_id:
|
|
3591
|
-
name:
|
|
3592
|
-
input:
|
|
3593
|
-
status:
|
|
3691
|
+
z22.object({
|
|
3692
|
+
type: z22.literal("custom_tool_call"),
|
|
3693
|
+
id: z22.string(),
|
|
3694
|
+
call_id: z22.string(),
|
|
3695
|
+
name: z22.string(),
|
|
3696
|
+
input: z22.string(),
|
|
3697
|
+
status: z22.literal("completed")
|
|
3594
3698
|
}),
|
|
3595
|
-
|
|
3596
|
-
type:
|
|
3597
|
-
id:
|
|
3598
|
-
code:
|
|
3599
|
-
container_id:
|
|
3600
|
-
outputs:
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3699
|
+
z22.object({
|
|
3700
|
+
type: z22.literal("code_interpreter_call"),
|
|
3701
|
+
id: z22.string(),
|
|
3702
|
+
code: z22.string().nullable(),
|
|
3703
|
+
container_id: z22.string(),
|
|
3704
|
+
outputs: z22.array(
|
|
3705
|
+
z22.discriminatedUnion("type", [
|
|
3706
|
+
z22.object({ type: z22.literal("logs"), logs: z22.string() }),
|
|
3707
|
+
z22.object({ type: z22.literal("image"), url: z22.string() })
|
|
3604
3708
|
])
|
|
3605
3709
|
).nullable()
|
|
3606
3710
|
}),
|
|
3607
|
-
|
|
3608
|
-
type:
|
|
3609
|
-
id:
|
|
3610
|
-
result:
|
|
3711
|
+
z22.object({
|
|
3712
|
+
type: z22.literal("image_generation_call"),
|
|
3713
|
+
id: z22.string(),
|
|
3714
|
+
result: z22.string()
|
|
3611
3715
|
}),
|
|
3612
|
-
|
|
3613
|
-
type:
|
|
3614
|
-
id:
|
|
3615
|
-
status:
|
|
3616
|
-
action:
|
|
3617
|
-
|
|
3618
|
-
type:
|
|
3619
|
-
query:
|
|
3620
|
-
sources:
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3716
|
+
z22.object({
|
|
3717
|
+
type: z22.literal("web_search_call"),
|
|
3718
|
+
id: z22.string(),
|
|
3719
|
+
status: z22.string(),
|
|
3720
|
+
action: z22.discriminatedUnion("type", [
|
|
3721
|
+
z22.object({
|
|
3722
|
+
type: z22.literal("search"),
|
|
3723
|
+
query: z22.string().nullish(),
|
|
3724
|
+
sources: z22.array(
|
|
3725
|
+
z22.discriminatedUnion("type", [
|
|
3726
|
+
z22.object({ type: z22.literal("url"), url: z22.string() }),
|
|
3727
|
+
z22.object({ type: z22.literal("api"), name: z22.string() })
|
|
3624
3728
|
])
|
|
3625
3729
|
).nullish()
|
|
3626
3730
|
}),
|
|
3627
|
-
|
|
3628
|
-
type:
|
|
3629
|
-
url:
|
|
3731
|
+
z22.object({
|
|
3732
|
+
type: z22.literal("open_page"),
|
|
3733
|
+
url: z22.string().nullish()
|
|
3630
3734
|
}),
|
|
3631
|
-
|
|
3632
|
-
type:
|
|
3633
|
-
url:
|
|
3634
|
-
pattern:
|
|
3735
|
+
z22.object({
|
|
3736
|
+
type: z22.literal("find_in_page"),
|
|
3737
|
+
url: z22.string().nullish(),
|
|
3738
|
+
pattern: z22.string().nullish()
|
|
3635
3739
|
})
|
|
3636
3740
|
]).nullish()
|
|
3637
3741
|
}),
|
|
3638
|
-
|
|
3639
|
-
type:
|
|
3640
|
-
id:
|
|
3641
|
-
queries:
|
|
3642
|
-
results:
|
|
3643
|
-
|
|
3644
|
-
attributes:
|
|
3645
|
-
|
|
3646
|
-
|
|
3742
|
+
z22.object({
|
|
3743
|
+
type: z22.literal("file_search_call"),
|
|
3744
|
+
id: z22.string(),
|
|
3745
|
+
queries: z22.array(z22.string()),
|
|
3746
|
+
results: z22.array(
|
|
3747
|
+
z22.object({
|
|
3748
|
+
attributes: z22.record(
|
|
3749
|
+
z22.string(),
|
|
3750
|
+
z22.union([z22.string(), z22.number(), z22.boolean()])
|
|
3647
3751
|
),
|
|
3648
|
-
file_id:
|
|
3649
|
-
filename:
|
|
3650
|
-
score:
|
|
3651
|
-
text:
|
|
3752
|
+
file_id: z22.string(),
|
|
3753
|
+
filename: z22.string(),
|
|
3754
|
+
score: z22.number(),
|
|
3755
|
+
text: z22.string()
|
|
3652
3756
|
})
|
|
3653
3757
|
).nullish()
|
|
3654
3758
|
}),
|
|
3655
|
-
|
|
3656
|
-
type:
|
|
3657
|
-
id:
|
|
3658
|
-
call_id:
|
|
3659
|
-
action:
|
|
3660
|
-
type:
|
|
3661
|
-
command:
|
|
3662
|
-
timeout_ms:
|
|
3663
|
-
user:
|
|
3664
|
-
working_directory:
|
|
3665
|
-
env:
|
|
3759
|
+
z22.object({
|
|
3760
|
+
type: z22.literal("local_shell_call"),
|
|
3761
|
+
id: z22.string(),
|
|
3762
|
+
call_id: z22.string(),
|
|
3763
|
+
action: z22.object({
|
|
3764
|
+
type: z22.literal("exec"),
|
|
3765
|
+
command: z22.array(z22.string()),
|
|
3766
|
+
timeout_ms: z22.number().optional(),
|
|
3767
|
+
user: z22.string().optional(),
|
|
3768
|
+
working_directory: z22.string().optional(),
|
|
3769
|
+
env: z22.record(z22.string(), z22.string()).optional()
|
|
3666
3770
|
})
|
|
3667
3771
|
}),
|
|
3668
|
-
|
|
3669
|
-
type:
|
|
3670
|
-
id:
|
|
3671
|
-
status:
|
|
3772
|
+
z22.object({
|
|
3773
|
+
type: z22.literal("computer_call"),
|
|
3774
|
+
id: z22.string(),
|
|
3775
|
+
status: z22.literal("completed")
|
|
3672
3776
|
}),
|
|
3673
|
-
|
|
3674
|
-
type:
|
|
3675
|
-
id:
|
|
3676
|
-
status:
|
|
3677
|
-
arguments:
|
|
3678
|
-
name:
|
|
3679
|
-
server_label:
|
|
3680
|
-
output:
|
|
3681
|
-
error:
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
type:
|
|
3685
|
-
code:
|
|
3686
|
-
message:
|
|
3777
|
+
z22.object({
|
|
3778
|
+
type: z22.literal("mcp_call"),
|
|
3779
|
+
id: z22.string(),
|
|
3780
|
+
status: z22.string(),
|
|
3781
|
+
arguments: z22.string(),
|
|
3782
|
+
name: z22.string(),
|
|
3783
|
+
server_label: z22.string(),
|
|
3784
|
+
output: z22.string().nullish(),
|
|
3785
|
+
error: z22.union([
|
|
3786
|
+
z22.string(),
|
|
3787
|
+
z22.object({
|
|
3788
|
+
type: z22.string().optional(),
|
|
3789
|
+
code: z22.union([z22.number(), z22.string()]).optional(),
|
|
3790
|
+
message: z22.string().optional()
|
|
3687
3791
|
}).loose()
|
|
3688
3792
|
]).nullish(),
|
|
3689
|
-
approval_request_id:
|
|
3793
|
+
approval_request_id: z22.string().nullish()
|
|
3690
3794
|
}),
|
|
3691
|
-
|
|
3692
|
-
type:
|
|
3693
|
-
id:
|
|
3694
|
-
server_label:
|
|
3695
|
-
tools:
|
|
3696
|
-
|
|
3697
|
-
name:
|
|
3698
|
-
description:
|
|
3699
|
-
input_schema:
|
|
3700
|
-
annotations:
|
|
3795
|
+
z22.object({
|
|
3796
|
+
type: z22.literal("mcp_list_tools"),
|
|
3797
|
+
id: z22.string(),
|
|
3798
|
+
server_label: z22.string(),
|
|
3799
|
+
tools: z22.array(
|
|
3800
|
+
z22.object({
|
|
3801
|
+
name: z22.string(),
|
|
3802
|
+
description: z22.string().optional(),
|
|
3803
|
+
input_schema: z22.any(),
|
|
3804
|
+
annotations: z22.record(z22.string(), z22.unknown()).optional()
|
|
3701
3805
|
})
|
|
3702
3806
|
),
|
|
3703
|
-
error:
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
type:
|
|
3707
|
-
code:
|
|
3708
|
-
message:
|
|
3807
|
+
error: z22.union([
|
|
3808
|
+
z22.string(),
|
|
3809
|
+
z22.object({
|
|
3810
|
+
type: z22.string().optional(),
|
|
3811
|
+
code: z22.union([z22.number(), z22.string()]).optional(),
|
|
3812
|
+
message: z22.string().optional()
|
|
3709
3813
|
}).loose()
|
|
3710
3814
|
]).optional()
|
|
3711
3815
|
}),
|
|
3712
|
-
|
|
3713
|
-
type:
|
|
3714
|
-
id:
|
|
3715
|
-
server_label:
|
|
3716
|
-
name:
|
|
3717
|
-
arguments:
|
|
3718
|
-
approval_request_id:
|
|
3816
|
+
z22.object({
|
|
3817
|
+
type: z22.literal("mcp_approval_request"),
|
|
3818
|
+
id: z22.string(),
|
|
3819
|
+
server_label: z22.string(),
|
|
3820
|
+
name: z22.string(),
|
|
3821
|
+
arguments: z22.string(),
|
|
3822
|
+
approval_request_id: z22.string().optional()
|
|
3719
3823
|
}),
|
|
3720
|
-
|
|
3721
|
-
type:
|
|
3722
|
-
id:
|
|
3723
|
-
call_id:
|
|
3724
|
-
status:
|
|
3725
|
-
operation:
|
|
3726
|
-
|
|
3727
|
-
type:
|
|
3728
|
-
path:
|
|
3729
|
-
diff:
|
|
3824
|
+
z22.object({
|
|
3825
|
+
type: z22.literal("apply_patch_call"),
|
|
3826
|
+
id: z22.string(),
|
|
3827
|
+
call_id: z22.string(),
|
|
3828
|
+
status: z22.enum(["in_progress", "completed"]),
|
|
3829
|
+
operation: z22.discriminatedUnion("type", [
|
|
3830
|
+
z22.object({
|
|
3831
|
+
type: z22.literal("create_file"),
|
|
3832
|
+
path: z22.string(),
|
|
3833
|
+
diff: z22.string()
|
|
3730
3834
|
}),
|
|
3731
|
-
|
|
3732
|
-
type:
|
|
3733
|
-
path:
|
|
3835
|
+
z22.object({
|
|
3836
|
+
type: z22.literal("delete_file"),
|
|
3837
|
+
path: z22.string()
|
|
3734
3838
|
}),
|
|
3735
|
-
|
|
3736
|
-
type:
|
|
3737
|
-
path:
|
|
3738
|
-
diff:
|
|
3839
|
+
z22.object({
|
|
3840
|
+
type: z22.literal("update_file"),
|
|
3841
|
+
path: z22.string(),
|
|
3842
|
+
diff: z22.string()
|
|
3739
3843
|
})
|
|
3740
3844
|
])
|
|
3741
3845
|
}),
|
|
3742
|
-
|
|
3743
|
-
type:
|
|
3744
|
-
id:
|
|
3745
|
-
call_id:
|
|
3746
|
-
status:
|
|
3747
|
-
action:
|
|
3748
|
-
commands:
|
|
3846
|
+
z22.object({
|
|
3847
|
+
type: z22.literal("shell_call"),
|
|
3848
|
+
id: z22.string(),
|
|
3849
|
+
call_id: z22.string(),
|
|
3850
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3851
|
+
action: z22.object({
|
|
3852
|
+
commands: z22.array(z22.string())
|
|
3749
3853
|
})
|
|
3750
3854
|
}),
|
|
3751
|
-
|
|
3752
|
-
type:
|
|
3753
|
-
id:
|
|
3754
|
-
call_id:
|
|
3755
|
-
status:
|
|
3756
|
-
output:
|
|
3757
|
-
|
|
3758
|
-
stdout:
|
|
3759
|
-
stderr:
|
|
3760
|
-
outcome:
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
type:
|
|
3764
|
-
exit_code:
|
|
3855
|
+
z22.object({
|
|
3856
|
+
type: z22.literal("shell_call_output"),
|
|
3857
|
+
id: z22.string(),
|
|
3858
|
+
call_id: z22.string(),
|
|
3859
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3860
|
+
output: z22.array(
|
|
3861
|
+
z22.object({
|
|
3862
|
+
stdout: z22.string(),
|
|
3863
|
+
stderr: z22.string(),
|
|
3864
|
+
outcome: z22.discriminatedUnion("type", [
|
|
3865
|
+
z22.object({ type: z22.literal("timeout") }),
|
|
3866
|
+
z22.object({
|
|
3867
|
+
type: z22.literal("exit"),
|
|
3868
|
+
exit_code: z22.number()
|
|
3765
3869
|
})
|
|
3766
3870
|
])
|
|
3767
3871
|
})
|
|
3768
3872
|
)
|
|
3769
3873
|
}),
|
|
3770
|
-
|
|
3771
|
-
type:
|
|
3772
|
-
id:
|
|
3773
|
-
execution:
|
|
3774
|
-
call_id:
|
|
3775
|
-
status:
|
|
3776
|
-
arguments:
|
|
3874
|
+
z22.object({
|
|
3875
|
+
type: z22.literal("tool_search_call"),
|
|
3876
|
+
id: z22.string(),
|
|
3877
|
+
execution: z22.enum(["server", "client"]),
|
|
3878
|
+
call_id: z22.string().nullable(),
|
|
3879
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3880
|
+
arguments: z22.unknown()
|
|
3777
3881
|
}),
|
|
3778
|
-
|
|
3779
|
-
type:
|
|
3780
|
-
id:
|
|
3781
|
-
execution:
|
|
3782
|
-
call_id:
|
|
3783
|
-
status:
|
|
3784
|
-
tools:
|
|
3882
|
+
z22.object({
|
|
3883
|
+
type: z22.literal("tool_search_output"),
|
|
3884
|
+
id: z22.string(),
|
|
3885
|
+
execution: z22.enum(["server", "client"]),
|
|
3886
|
+
call_id: z22.string().nullable(),
|
|
3887
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3888
|
+
tools: z22.array(z22.record(z22.string(), jsonValueSchema2.optional()))
|
|
3785
3889
|
})
|
|
3786
3890
|
])
|
|
3787
3891
|
}),
|
|
3788
|
-
|
|
3789
|
-
type:
|
|
3790
|
-
item_id:
|
|
3791
|
-
output_index:
|
|
3792
|
-
delta:
|
|
3892
|
+
z22.object({
|
|
3893
|
+
type: z22.literal("response.function_call_arguments.delta"),
|
|
3894
|
+
item_id: z22.string(),
|
|
3895
|
+
output_index: z22.number(),
|
|
3896
|
+
delta: z22.string()
|
|
3793
3897
|
}),
|
|
3794
|
-
|
|
3795
|
-
type:
|
|
3796
|
-
item_id:
|
|
3797
|
-
output_index:
|
|
3798
|
-
delta:
|
|
3898
|
+
z22.object({
|
|
3899
|
+
type: z22.literal("response.custom_tool_call_input.delta"),
|
|
3900
|
+
item_id: z22.string(),
|
|
3901
|
+
output_index: z22.number(),
|
|
3902
|
+
delta: z22.string()
|
|
3799
3903
|
}),
|
|
3800
|
-
|
|
3801
|
-
type:
|
|
3802
|
-
item_id:
|
|
3803
|
-
output_index:
|
|
3804
|
-
partial_image_b64:
|
|
3904
|
+
z22.object({
|
|
3905
|
+
type: z22.literal("response.image_generation_call.partial_image"),
|
|
3906
|
+
item_id: z22.string(),
|
|
3907
|
+
output_index: z22.number(),
|
|
3908
|
+
partial_image_b64: z22.string()
|
|
3805
3909
|
}),
|
|
3806
|
-
|
|
3807
|
-
type:
|
|
3808
|
-
item_id:
|
|
3809
|
-
output_index:
|
|
3810
|
-
delta:
|
|
3910
|
+
z22.object({
|
|
3911
|
+
type: z22.literal("response.code_interpreter_call_code.delta"),
|
|
3912
|
+
item_id: z22.string(),
|
|
3913
|
+
output_index: z22.number(),
|
|
3914
|
+
delta: z22.string()
|
|
3811
3915
|
}),
|
|
3812
|
-
|
|
3813
|
-
type:
|
|
3814
|
-
item_id:
|
|
3815
|
-
output_index:
|
|
3816
|
-
code:
|
|
3916
|
+
z22.object({
|
|
3917
|
+
type: z22.literal("response.code_interpreter_call_code.done"),
|
|
3918
|
+
item_id: z22.string(),
|
|
3919
|
+
output_index: z22.number(),
|
|
3920
|
+
code: z22.string()
|
|
3817
3921
|
}),
|
|
3818
|
-
|
|
3819
|
-
type:
|
|
3820
|
-
annotation:
|
|
3821
|
-
|
|
3822
|
-
type:
|
|
3823
|
-
start_index:
|
|
3824
|
-
end_index:
|
|
3825
|
-
url:
|
|
3826
|
-
title:
|
|
3922
|
+
z22.object({
|
|
3923
|
+
type: z22.literal("response.output_text.annotation.added"),
|
|
3924
|
+
annotation: z22.discriminatedUnion("type", [
|
|
3925
|
+
z22.object({
|
|
3926
|
+
type: z22.literal("url_citation"),
|
|
3927
|
+
start_index: z22.number(),
|
|
3928
|
+
end_index: z22.number(),
|
|
3929
|
+
url: z22.string(),
|
|
3930
|
+
title: z22.string()
|
|
3827
3931
|
}),
|
|
3828
|
-
|
|
3829
|
-
type:
|
|
3830
|
-
file_id:
|
|
3831
|
-
filename:
|
|
3832
|
-
index:
|
|
3932
|
+
z22.object({
|
|
3933
|
+
type: z22.literal("file_citation"),
|
|
3934
|
+
file_id: z22.string(),
|
|
3935
|
+
filename: z22.string(),
|
|
3936
|
+
index: z22.number()
|
|
3833
3937
|
}),
|
|
3834
|
-
|
|
3835
|
-
type:
|
|
3836
|
-
container_id:
|
|
3837
|
-
file_id:
|
|
3838
|
-
filename:
|
|
3839
|
-
start_index:
|
|
3840
|
-
end_index:
|
|
3938
|
+
z22.object({
|
|
3939
|
+
type: z22.literal("container_file_citation"),
|
|
3940
|
+
container_id: z22.string(),
|
|
3941
|
+
file_id: z22.string(),
|
|
3942
|
+
filename: z22.string(),
|
|
3943
|
+
start_index: z22.number(),
|
|
3944
|
+
end_index: z22.number()
|
|
3841
3945
|
}),
|
|
3842
|
-
|
|
3843
|
-
type:
|
|
3844
|
-
file_id:
|
|
3845
|
-
index:
|
|
3946
|
+
z22.object({
|
|
3947
|
+
type: z22.literal("file_path"),
|
|
3948
|
+
file_id: z22.string(),
|
|
3949
|
+
index: z22.number()
|
|
3846
3950
|
})
|
|
3847
3951
|
])
|
|
3848
3952
|
}),
|
|
3849
|
-
|
|
3850
|
-
type:
|
|
3851
|
-
item_id:
|
|
3852
|
-
summary_index:
|
|
3953
|
+
z22.object({
|
|
3954
|
+
type: z22.literal("response.reasoning_summary_part.added"),
|
|
3955
|
+
item_id: z22.string(),
|
|
3956
|
+
summary_index: z22.number()
|
|
3853
3957
|
}),
|
|
3854
|
-
|
|
3855
|
-
type:
|
|
3856
|
-
item_id:
|
|
3857
|
-
summary_index:
|
|
3858
|
-
delta:
|
|
3958
|
+
z22.object({
|
|
3959
|
+
type: z22.literal("response.reasoning_summary_text.delta"),
|
|
3960
|
+
item_id: z22.string(),
|
|
3961
|
+
summary_index: z22.number(),
|
|
3962
|
+
delta: z22.string()
|
|
3859
3963
|
}),
|
|
3860
|
-
|
|
3861
|
-
type:
|
|
3862
|
-
item_id:
|
|
3863
|
-
summary_index:
|
|
3964
|
+
z22.object({
|
|
3965
|
+
type: z22.literal("response.reasoning_summary_part.done"),
|
|
3966
|
+
item_id: z22.string(),
|
|
3967
|
+
summary_index: z22.number()
|
|
3864
3968
|
}),
|
|
3865
|
-
|
|
3866
|
-
type:
|
|
3867
|
-
item_id:
|
|
3868
|
-
output_index:
|
|
3869
|
-
delta:
|
|
3870
|
-
obfuscation:
|
|
3969
|
+
z22.object({
|
|
3970
|
+
type: z22.literal("response.apply_patch_call_operation_diff.delta"),
|
|
3971
|
+
item_id: z22.string(),
|
|
3972
|
+
output_index: z22.number(),
|
|
3973
|
+
delta: z22.string(),
|
|
3974
|
+
obfuscation: z22.string().nullish()
|
|
3871
3975
|
}),
|
|
3872
|
-
|
|
3873
|
-
type:
|
|
3874
|
-
item_id:
|
|
3875
|
-
output_index:
|
|
3876
|
-
diff:
|
|
3976
|
+
z22.object({
|
|
3977
|
+
type: z22.literal("response.apply_patch_call_operation_diff.done"),
|
|
3978
|
+
item_id: z22.string(),
|
|
3979
|
+
output_index: z22.number(),
|
|
3980
|
+
diff: z22.string()
|
|
3877
3981
|
}),
|
|
3878
|
-
|
|
3879
|
-
type:
|
|
3880
|
-
sequence_number:
|
|
3881
|
-
error:
|
|
3882
|
-
type:
|
|
3883
|
-
code:
|
|
3884
|
-
message:
|
|
3885
|
-
param:
|
|
3982
|
+
z22.object({
|
|
3983
|
+
type: z22.literal("error"),
|
|
3984
|
+
sequence_number: z22.number(),
|
|
3985
|
+
error: z22.object({
|
|
3986
|
+
type: z22.string(),
|
|
3987
|
+
code: z22.string(),
|
|
3988
|
+
message: z22.string(),
|
|
3989
|
+
param: z22.string().nullish()
|
|
3886
3990
|
})
|
|
3887
3991
|
}),
|
|
3888
|
-
|
|
3992
|
+
z22.object({ type: z22.string() }).loose().transform((value) => ({
|
|
3889
3993
|
type: "unknown_chunk",
|
|
3890
3994
|
message: value.type
|
|
3891
3995
|
}))
|
|
@@ -3893,310 +3997,313 @@ var openaiResponsesChunkSchema = lazySchema19(
|
|
|
3893
3997
|
])
|
|
3894
3998
|
)
|
|
3895
3999
|
);
|
|
3896
|
-
var openaiResponsesResponseSchema =
|
|
3897
|
-
() =>
|
|
3898
|
-
|
|
3899
|
-
id:
|
|
3900
|
-
created_at:
|
|
3901
|
-
error:
|
|
3902
|
-
message:
|
|
3903
|
-
type:
|
|
3904
|
-
param:
|
|
3905
|
-
code:
|
|
4000
|
+
var openaiResponsesResponseSchema = lazySchema20(
|
|
4001
|
+
() => zodSchema20(
|
|
4002
|
+
z22.object({
|
|
4003
|
+
id: z22.string().optional(),
|
|
4004
|
+
created_at: z22.number().optional(),
|
|
4005
|
+
error: z22.object({
|
|
4006
|
+
message: z22.string(),
|
|
4007
|
+
type: z22.string(),
|
|
4008
|
+
param: z22.string().nullish(),
|
|
4009
|
+
code: z22.string()
|
|
3906
4010
|
}).nullish(),
|
|
3907
|
-
model:
|
|
3908
|
-
output:
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
type:
|
|
3912
|
-
role:
|
|
3913
|
-
id:
|
|
3914
|
-
phase:
|
|
3915
|
-
content:
|
|
3916
|
-
|
|
3917
|
-
type:
|
|
3918
|
-
text:
|
|
3919
|
-
logprobs:
|
|
3920
|
-
|
|
3921
|
-
token:
|
|
3922
|
-
logprob:
|
|
3923
|
-
top_logprobs:
|
|
3924
|
-
|
|
3925
|
-
token:
|
|
3926
|
-
logprob:
|
|
4011
|
+
model: z22.string().optional(),
|
|
4012
|
+
output: z22.array(
|
|
4013
|
+
z22.discriminatedUnion("type", [
|
|
4014
|
+
z22.object({
|
|
4015
|
+
type: z22.literal("message"),
|
|
4016
|
+
role: z22.literal("assistant"),
|
|
4017
|
+
id: z22.string(),
|
|
4018
|
+
phase: z22.enum(["commentary", "final_answer"]).nullish(),
|
|
4019
|
+
content: z22.array(
|
|
4020
|
+
z22.object({
|
|
4021
|
+
type: z22.literal("output_text"),
|
|
4022
|
+
text: z22.string(),
|
|
4023
|
+
logprobs: z22.array(
|
|
4024
|
+
z22.object({
|
|
4025
|
+
token: z22.string(),
|
|
4026
|
+
logprob: z22.number(),
|
|
4027
|
+
top_logprobs: z22.array(
|
|
4028
|
+
z22.object({
|
|
4029
|
+
token: z22.string(),
|
|
4030
|
+
logprob: z22.number()
|
|
3927
4031
|
})
|
|
3928
4032
|
)
|
|
3929
4033
|
})
|
|
3930
4034
|
).nullish(),
|
|
3931
|
-
annotations:
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
type:
|
|
3935
|
-
start_index:
|
|
3936
|
-
end_index:
|
|
3937
|
-
url:
|
|
3938
|
-
title:
|
|
4035
|
+
annotations: z22.array(
|
|
4036
|
+
z22.discriminatedUnion("type", [
|
|
4037
|
+
z22.object({
|
|
4038
|
+
type: z22.literal("url_citation"),
|
|
4039
|
+
start_index: z22.number(),
|
|
4040
|
+
end_index: z22.number(),
|
|
4041
|
+
url: z22.string(),
|
|
4042
|
+
title: z22.string()
|
|
3939
4043
|
}),
|
|
3940
|
-
|
|
3941
|
-
type:
|
|
3942
|
-
file_id:
|
|
3943
|
-
filename:
|
|
3944
|
-
index:
|
|
4044
|
+
z22.object({
|
|
4045
|
+
type: z22.literal("file_citation"),
|
|
4046
|
+
file_id: z22.string(),
|
|
4047
|
+
filename: z22.string(),
|
|
4048
|
+
index: z22.number()
|
|
3945
4049
|
}),
|
|
3946
|
-
|
|
3947
|
-
type:
|
|
3948
|
-
container_id:
|
|
3949
|
-
file_id:
|
|
3950
|
-
filename:
|
|
3951
|
-
start_index:
|
|
3952
|
-
end_index:
|
|
4050
|
+
z22.object({
|
|
4051
|
+
type: z22.literal("container_file_citation"),
|
|
4052
|
+
container_id: z22.string(),
|
|
4053
|
+
file_id: z22.string(),
|
|
4054
|
+
filename: z22.string(),
|
|
4055
|
+
start_index: z22.number(),
|
|
4056
|
+
end_index: z22.number()
|
|
3953
4057
|
}),
|
|
3954
|
-
|
|
3955
|
-
type:
|
|
3956
|
-
file_id:
|
|
3957
|
-
index:
|
|
4058
|
+
z22.object({
|
|
4059
|
+
type: z22.literal("file_path"),
|
|
4060
|
+
file_id: z22.string(),
|
|
4061
|
+
index: z22.number()
|
|
3958
4062
|
})
|
|
3959
4063
|
])
|
|
3960
4064
|
)
|
|
3961
4065
|
})
|
|
3962
4066
|
)
|
|
3963
4067
|
}),
|
|
3964
|
-
|
|
3965
|
-
type:
|
|
3966
|
-
id:
|
|
3967
|
-
status:
|
|
3968
|
-
action:
|
|
3969
|
-
|
|
3970
|
-
type:
|
|
3971
|
-
query:
|
|
3972
|
-
sources:
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
type:
|
|
3977
|
-
name:
|
|
4068
|
+
z22.object({
|
|
4069
|
+
type: z22.literal("web_search_call"),
|
|
4070
|
+
id: z22.string(),
|
|
4071
|
+
status: z22.string(),
|
|
4072
|
+
action: z22.discriminatedUnion("type", [
|
|
4073
|
+
z22.object({
|
|
4074
|
+
type: z22.literal("search"),
|
|
4075
|
+
query: z22.string().nullish(),
|
|
4076
|
+
sources: z22.array(
|
|
4077
|
+
z22.discriminatedUnion("type", [
|
|
4078
|
+
z22.object({ type: z22.literal("url"), url: z22.string() }),
|
|
4079
|
+
z22.object({
|
|
4080
|
+
type: z22.literal("api"),
|
|
4081
|
+
name: z22.string()
|
|
3978
4082
|
})
|
|
3979
4083
|
])
|
|
3980
4084
|
).nullish()
|
|
3981
4085
|
}),
|
|
3982
|
-
|
|
3983
|
-
type:
|
|
3984
|
-
url:
|
|
4086
|
+
z22.object({
|
|
4087
|
+
type: z22.literal("open_page"),
|
|
4088
|
+
url: z22.string().nullish()
|
|
3985
4089
|
}),
|
|
3986
|
-
|
|
3987
|
-
type:
|
|
3988
|
-
url:
|
|
3989
|
-
pattern:
|
|
4090
|
+
z22.object({
|
|
4091
|
+
type: z22.literal("find_in_page"),
|
|
4092
|
+
url: z22.string().nullish(),
|
|
4093
|
+
pattern: z22.string().nullish()
|
|
3990
4094
|
})
|
|
3991
4095
|
]).nullish()
|
|
3992
4096
|
}),
|
|
3993
|
-
|
|
3994
|
-
type:
|
|
3995
|
-
id:
|
|
3996
|
-
queries:
|
|
3997
|
-
results:
|
|
3998
|
-
|
|
3999
|
-
attributes:
|
|
4000
|
-
|
|
4001
|
-
|
|
4097
|
+
z22.object({
|
|
4098
|
+
type: z22.literal("file_search_call"),
|
|
4099
|
+
id: z22.string(),
|
|
4100
|
+
queries: z22.array(z22.string()),
|
|
4101
|
+
results: z22.array(
|
|
4102
|
+
z22.object({
|
|
4103
|
+
attributes: z22.record(
|
|
4104
|
+
z22.string(),
|
|
4105
|
+
z22.union([z22.string(), z22.number(), z22.boolean()])
|
|
4002
4106
|
),
|
|
4003
|
-
file_id:
|
|
4004
|
-
filename:
|
|
4005
|
-
score:
|
|
4006
|
-
text:
|
|
4107
|
+
file_id: z22.string(),
|
|
4108
|
+
filename: z22.string(),
|
|
4109
|
+
score: z22.number(),
|
|
4110
|
+
text: z22.string()
|
|
4007
4111
|
})
|
|
4008
4112
|
).nullish()
|
|
4009
4113
|
}),
|
|
4010
|
-
|
|
4011
|
-
type:
|
|
4012
|
-
id:
|
|
4013
|
-
code:
|
|
4014
|
-
container_id:
|
|
4015
|
-
outputs:
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4114
|
+
z22.object({
|
|
4115
|
+
type: z22.literal("code_interpreter_call"),
|
|
4116
|
+
id: z22.string(),
|
|
4117
|
+
code: z22.string().nullable(),
|
|
4118
|
+
container_id: z22.string(),
|
|
4119
|
+
outputs: z22.array(
|
|
4120
|
+
z22.discriminatedUnion("type", [
|
|
4121
|
+
z22.object({ type: z22.literal("logs"), logs: z22.string() }),
|
|
4122
|
+
z22.object({ type: z22.literal("image"), url: z22.string() })
|
|
4019
4123
|
])
|
|
4020
4124
|
).nullable()
|
|
4021
4125
|
}),
|
|
4022
|
-
|
|
4023
|
-
type:
|
|
4024
|
-
id:
|
|
4025
|
-
result:
|
|
4126
|
+
z22.object({
|
|
4127
|
+
type: z22.literal("image_generation_call"),
|
|
4128
|
+
id: z22.string(),
|
|
4129
|
+
result: z22.string()
|
|
4026
4130
|
}),
|
|
4027
|
-
|
|
4028
|
-
type:
|
|
4029
|
-
id:
|
|
4030
|
-
call_id:
|
|
4031
|
-
action:
|
|
4032
|
-
type:
|
|
4033
|
-
command:
|
|
4034
|
-
timeout_ms:
|
|
4035
|
-
user:
|
|
4036
|
-
working_directory:
|
|
4037
|
-
env:
|
|
4131
|
+
z22.object({
|
|
4132
|
+
type: z22.literal("local_shell_call"),
|
|
4133
|
+
id: z22.string(),
|
|
4134
|
+
call_id: z22.string(),
|
|
4135
|
+
action: z22.object({
|
|
4136
|
+
type: z22.literal("exec"),
|
|
4137
|
+
command: z22.array(z22.string()),
|
|
4138
|
+
timeout_ms: z22.number().optional(),
|
|
4139
|
+
user: z22.string().optional(),
|
|
4140
|
+
working_directory: z22.string().optional(),
|
|
4141
|
+
env: z22.record(z22.string(), z22.string()).optional()
|
|
4038
4142
|
})
|
|
4039
4143
|
}),
|
|
4040
|
-
|
|
4041
|
-
type:
|
|
4042
|
-
call_id:
|
|
4043
|
-
name:
|
|
4044
|
-
arguments:
|
|
4045
|
-
id:
|
|
4144
|
+
z22.object({
|
|
4145
|
+
type: z22.literal("function_call"),
|
|
4146
|
+
call_id: z22.string(),
|
|
4147
|
+
name: z22.string(),
|
|
4148
|
+
arguments: z22.string(),
|
|
4149
|
+
id: z22.string()
|
|
4046
4150
|
}),
|
|
4047
|
-
|
|
4048
|
-
type:
|
|
4049
|
-
call_id:
|
|
4050
|
-
name:
|
|
4051
|
-
input:
|
|
4052
|
-
id:
|
|
4151
|
+
z22.object({
|
|
4152
|
+
type: z22.literal("custom_tool_call"),
|
|
4153
|
+
call_id: z22.string(),
|
|
4154
|
+
name: z22.string(),
|
|
4155
|
+
input: z22.string(),
|
|
4156
|
+
id: z22.string()
|
|
4053
4157
|
}),
|
|
4054
|
-
|
|
4055
|
-
type:
|
|
4056
|
-
id:
|
|
4057
|
-
status:
|
|
4158
|
+
z22.object({
|
|
4159
|
+
type: z22.literal("computer_call"),
|
|
4160
|
+
id: z22.string(),
|
|
4161
|
+
status: z22.string().optional()
|
|
4058
4162
|
}),
|
|
4059
|
-
|
|
4060
|
-
type:
|
|
4061
|
-
id:
|
|
4062
|
-
encrypted_content:
|
|
4063
|
-
summary:
|
|
4064
|
-
|
|
4065
|
-
type:
|
|
4066
|
-
text:
|
|
4163
|
+
z22.object({
|
|
4164
|
+
type: z22.literal("reasoning"),
|
|
4165
|
+
id: z22.string(),
|
|
4166
|
+
encrypted_content: z22.string().nullish(),
|
|
4167
|
+
summary: z22.array(
|
|
4168
|
+
z22.object({
|
|
4169
|
+
type: z22.literal("summary_text"),
|
|
4170
|
+
text: z22.string()
|
|
4067
4171
|
})
|
|
4068
4172
|
)
|
|
4069
4173
|
}),
|
|
4070
|
-
|
|
4071
|
-
type:
|
|
4072
|
-
id:
|
|
4073
|
-
status:
|
|
4074
|
-
arguments:
|
|
4075
|
-
name:
|
|
4076
|
-
server_label:
|
|
4077
|
-
output:
|
|
4078
|
-
error:
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
type:
|
|
4082
|
-
code:
|
|
4083
|
-
message:
|
|
4174
|
+
z22.object({
|
|
4175
|
+
type: z22.literal("mcp_call"),
|
|
4176
|
+
id: z22.string(),
|
|
4177
|
+
status: z22.string(),
|
|
4178
|
+
arguments: z22.string(),
|
|
4179
|
+
name: z22.string(),
|
|
4180
|
+
server_label: z22.string(),
|
|
4181
|
+
output: z22.string().nullish(),
|
|
4182
|
+
error: z22.union([
|
|
4183
|
+
z22.string(),
|
|
4184
|
+
z22.object({
|
|
4185
|
+
type: z22.string().optional(),
|
|
4186
|
+
code: z22.union([z22.number(), z22.string()]).optional(),
|
|
4187
|
+
message: z22.string().optional()
|
|
4084
4188
|
}).loose()
|
|
4085
4189
|
]).nullish(),
|
|
4086
|
-
approval_request_id:
|
|
4190
|
+
approval_request_id: z22.string().nullish()
|
|
4087
4191
|
}),
|
|
4088
|
-
|
|
4089
|
-
type:
|
|
4090
|
-
id:
|
|
4091
|
-
server_label:
|
|
4092
|
-
tools:
|
|
4093
|
-
|
|
4094
|
-
name:
|
|
4095
|
-
description:
|
|
4096
|
-
input_schema:
|
|
4097
|
-
annotations:
|
|
4192
|
+
z22.object({
|
|
4193
|
+
type: z22.literal("mcp_list_tools"),
|
|
4194
|
+
id: z22.string(),
|
|
4195
|
+
server_label: z22.string(),
|
|
4196
|
+
tools: z22.array(
|
|
4197
|
+
z22.object({
|
|
4198
|
+
name: z22.string(),
|
|
4199
|
+
description: z22.string().optional(),
|
|
4200
|
+
input_schema: z22.any(),
|
|
4201
|
+
annotations: z22.record(z22.string(), z22.unknown()).optional()
|
|
4098
4202
|
})
|
|
4099
4203
|
),
|
|
4100
|
-
error:
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
type:
|
|
4104
|
-
code:
|
|
4105
|
-
message:
|
|
4204
|
+
error: z22.union([
|
|
4205
|
+
z22.string(),
|
|
4206
|
+
z22.object({
|
|
4207
|
+
type: z22.string().optional(),
|
|
4208
|
+
code: z22.union([z22.number(), z22.string()]).optional(),
|
|
4209
|
+
message: z22.string().optional()
|
|
4106
4210
|
}).loose()
|
|
4107
4211
|
]).optional()
|
|
4108
4212
|
}),
|
|
4109
|
-
|
|
4110
|
-
type:
|
|
4111
|
-
id:
|
|
4112
|
-
server_label:
|
|
4113
|
-
name:
|
|
4114
|
-
arguments:
|
|
4115
|
-
approval_request_id:
|
|
4213
|
+
z22.object({
|
|
4214
|
+
type: z22.literal("mcp_approval_request"),
|
|
4215
|
+
id: z22.string(),
|
|
4216
|
+
server_label: z22.string(),
|
|
4217
|
+
name: z22.string(),
|
|
4218
|
+
arguments: z22.string(),
|
|
4219
|
+
approval_request_id: z22.string().optional()
|
|
4116
4220
|
}),
|
|
4117
|
-
|
|
4118
|
-
type:
|
|
4119
|
-
id:
|
|
4120
|
-
call_id:
|
|
4121
|
-
status:
|
|
4122
|
-
operation:
|
|
4123
|
-
|
|
4124
|
-
type:
|
|
4125
|
-
path:
|
|
4126
|
-
diff:
|
|
4221
|
+
z22.object({
|
|
4222
|
+
type: z22.literal("apply_patch_call"),
|
|
4223
|
+
id: z22.string(),
|
|
4224
|
+
call_id: z22.string(),
|
|
4225
|
+
status: z22.enum(["in_progress", "completed"]),
|
|
4226
|
+
operation: z22.discriminatedUnion("type", [
|
|
4227
|
+
z22.object({
|
|
4228
|
+
type: z22.literal("create_file"),
|
|
4229
|
+
path: z22.string(),
|
|
4230
|
+
diff: z22.string()
|
|
4127
4231
|
}),
|
|
4128
|
-
|
|
4129
|
-
type:
|
|
4130
|
-
path:
|
|
4232
|
+
z22.object({
|
|
4233
|
+
type: z22.literal("delete_file"),
|
|
4234
|
+
path: z22.string()
|
|
4131
4235
|
}),
|
|
4132
|
-
|
|
4133
|
-
type:
|
|
4134
|
-
path:
|
|
4135
|
-
diff:
|
|
4236
|
+
z22.object({
|
|
4237
|
+
type: z22.literal("update_file"),
|
|
4238
|
+
path: z22.string(),
|
|
4239
|
+
diff: z22.string()
|
|
4136
4240
|
})
|
|
4137
4241
|
])
|
|
4138
4242
|
}),
|
|
4139
|
-
|
|
4140
|
-
type:
|
|
4141
|
-
id:
|
|
4142
|
-
call_id:
|
|
4143
|
-
status:
|
|
4144
|
-
action:
|
|
4145
|
-
commands:
|
|
4243
|
+
z22.object({
|
|
4244
|
+
type: z22.literal("shell_call"),
|
|
4245
|
+
id: z22.string(),
|
|
4246
|
+
call_id: z22.string(),
|
|
4247
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
4248
|
+
action: z22.object({
|
|
4249
|
+
commands: z22.array(z22.string())
|
|
4146
4250
|
})
|
|
4147
4251
|
}),
|
|
4148
|
-
|
|
4149
|
-
type:
|
|
4150
|
-
id:
|
|
4151
|
-
call_id:
|
|
4152
|
-
status:
|
|
4153
|
-
output:
|
|
4154
|
-
|
|
4155
|
-
stdout:
|
|
4156
|
-
stderr:
|
|
4157
|
-
outcome:
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
type:
|
|
4161
|
-
exit_code:
|
|
4252
|
+
z22.object({
|
|
4253
|
+
type: z22.literal("shell_call_output"),
|
|
4254
|
+
id: z22.string(),
|
|
4255
|
+
call_id: z22.string(),
|
|
4256
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
4257
|
+
output: z22.array(
|
|
4258
|
+
z22.object({
|
|
4259
|
+
stdout: z22.string(),
|
|
4260
|
+
stderr: z22.string(),
|
|
4261
|
+
outcome: z22.discriminatedUnion("type", [
|
|
4262
|
+
z22.object({ type: z22.literal("timeout") }),
|
|
4263
|
+
z22.object({
|
|
4264
|
+
type: z22.literal("exit"),
|
|
4265
|
+
exit_code: z22.number()
|
|
4162
4266
|
})
|
|
4163
4267
|
])
|
|
4164
4268
|
})
|
|
4165
4269
|
)
|
|
4166
4270
|
}),
|
|
4167
|
-
|
|
4168
|
-
type:
|
|
4169
|
-
id:
|
|
4170
|
-
execution:
|
|
4171
|
-
call_id:
|
|
4172
|
-
status:
|
|
4173
|
-
arguments:
|
|
4271
|
+
z22.object({
|
|
4272
|
+
type: z22.literal("tool_search_call"),
|
|
4273
|
+
id: z22.string(),
|
|
4274
|
+
execution: z22.enum(["server", "client"]),
|
|
4275
|
+
call_id: z22.string().nullable(),
|
|
4276
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
4277
|
+
arguments: z22.unknown()
|
|
4174
4278
|
}),
|
|
4175
|
-
|
|
4176
|
-
type:
|
|
4177
|
-
id:
|
|
4178
|
-
execution:
|
|
4179
|
-
call_id:
|
|
4180
|
-
status:
|
|
4181
|
-
tools:
|
|
4279
|
+
z22.object({
|
|
4280
|
+
type: z22.literal("tool_search_output"),
|
|
4281
|
+
id: z22.string(),
|
|
4282
|
+
execution: z22.enum(["server", "client"]),
|
|
4283
|
+
call_id: z22.string().nullable(),
|
|
4284
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
4285
|
+
tools: z22.array(z22.record(z22.string(), jsonValueSchema2.optional()))
|
|
4182
4286
|
})
|
|
4183
4287
|
])
|
|
4184
4288
|
).optional(),
|
|
4185
|
-
service_tier:
|
|
4186
|
-
incomplete_details:
|
|
4187
|
-
usage:
|
|
4188
|
-
input_tokens:
|
|
4189
|
-
input_tokens_details:
|
|
4190
|
-
output_tokens:
|
|
4191
|
-
output_tokens_details:
|
|
4289
|
+
service_tier: z22.string().nullish(),
|
|
4290
|
+
incomplete_details: z22.object({ reason: z22.string() }).nullish(),
|
|
4291
|
+
usage: z22.object({
|
|
4292
|
+
input_tokens: z22.number(),
|
|
4293
|
+
input_tokens_details: z22.object({ cached_tokens: z22.number().nullish() }).nullish(),
|
|
4294
|
+
output_tokens: z22.number(),
|
|
4295
|
+
output_tokens_details: z22.object({ reasoning_tokens: z22.number().nullish() }).nullish()
|
|
4192
4296
|
}).optional()
|
|
4193
4297
|
})
|
|
4194
4298
|
)
|
|
4195
4299
|
);
|
|
4196
4300
|
|
|
4197
4301
|
// src/responses/openai-responses-options.ts
|
|
4198
|
-
import {
|
|
4199
|
-
|
|
4302
|
+
import {
|
|
4303
|
+
lazySchema as lazySchema21,
|
|
4304
|
+
zodSchema as zodSchema21
|
|
4305
|
+
} from "@ai-sdk/provider-utils";
|
|
4306
|
+
import { z as z23 } from "zod/v4";
|
|
4200
4307
|
var TOP_LOGPROBS_MAX = 20;
|
|
4201
4308
|
var openaiResponsesReasoningModelIds = [
|
|
4202
4309
|
"o1",
|
|
@@ -4261,9 +4368,9 @@ var openaiResponsesModelIds = [
|
|
|
4261
4368
|
"gpt-5-chat-latest",
|
|
4262
4369
|
...openaiResponsesReasoningModelIds
|
|
4263
4370
|
];
|
|
4264
|
-
var openaiLanguageModelResponsesOptionsSchema =
|
|
4265
|
-
() =>
|
|
4266
|
-
|
|
4371
|
+
var openaiLanguageModelResponsesOptionsSchema = lazySchema21(
|
|
4372
|
+
() => zodSchema21(
|
|
4373
|
+
z23.object({
|
|
4267
4374
|
/**
|
|
4268
4375
|
* The ID of the OpenAI Conversation to continue.
|
|
4269
4376
|
* You must create a conversation first via the OpenAI API.
|
|
@@ -4271,13 +4378,13 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4271
4378
|
* Defaults to `undefined`.
|
|
4272
4379
|
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
4273
4380
|
*/
|
|
4274
|
-
conversation:
|
|
4381
|
+
conversation: z23.string().nullish(),
|
|
4275
4382
|
/**
|
|
4276
4383
|
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
4277
4384
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
|
|
4278
4385
|
*/
|
|
4279
|
-
include:
|
|
4280
|
-
|
|
4386
|
+
include: z23.array(
|
|
4387
|
+
z23.enum([
|
|
4281
4388
|
"reasoning.encrypted_content",
|
|
4282
4389
|
// handled internally by default, only needed for unknown reasoning models
|
|
4283
4390
|
"file_search_call.results",
|
|
@@ -4289,7 +4396,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4289
4396
|
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
4290
4397
|
* Defaults to `undefined`.
|
|
4291
4398
|
*/
|
|
4292
|
-
instructions:
|
|
4399
|
+
instructions: z23.string().nullish(),
|
|
4293
4400
|
/**
|
|
4294
4401
|
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
4295
4402
|
* the response size and can slow down response times. However, it can
|
|
@@ -4304,30 +4411,30 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4304
4411
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
4305
4412
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
4306
4413
|
*/
|
|
4307
|
-
logprobs:
|
|
4414
|
+
logprobs: z23.union([z23.boolean(), z23.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
4308
4415
|
/**
|
|
4309
4416
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
4310
4417
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
4311
4418
|
* Any further attempts to call a tool by the model will be ignored.
|
|
4312
4419
|
*/
|
|
4313
|
-
maxToolCalls:
|
|
4420
|
+
maxToolCalls: z23.number().nullish(),
|
|
4314
4421
|
/**
|
|
4315
4422
|
* Additional metadata to store with the generation.
|
|
4316
4423
|
*/
|
|
4317
|
-
metadata:
|
|
4424
|
+
metadata: z23.any().nullish(),
|
|
4318
4425
|
/**
|
|
4319
4426
|
* Whether to use parallel tool calls. Defaults to `true`.
|
|
4320
4427
|
*/
|
|
4321
|
-
parallelToolCalls:
|
|
4428
|
+
parallelToolCalls: z23.boolean().nullish(),
|
|
4322
4429
|
/**
|
|
4323
4430
|
* The ID of the previous response. You can use it to continue a conversation.
|
|
4324
4431
|
* Defaults to `undefined`.
|
|
4325
4432
|
*/
|
|
4326
|
-
previousResponseId:
|
|
4433
|
+
previousResponseId: z23.string().nullish(),
|
|
4327
4434
|
/**
|
|
4328
4435
|
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
4329
4436
|
*/
|
|
4330
|
-
promptCacheKey:
|
|
4437
|
+
promptCacheKey: z23.string().nullish(),
|
|
4331
4438
|
/**
|
|
4332
4439
|
* The retention policy for the prompt cache.
|
|
4333
4440
|
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
@@ -4336,7 +4443,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4336
4443
|
*
|
|
4337
4444
|
* @default 'in_memory'
|
|
4338
4445
|
*/
|
|
4339
|
-
promptCacheRetention:
|
|
4446
|
+
promptCacheRetention: z23.enum(["in_memory", "24h"]).nullish(),
|
|
4340
4447
|
/**
|
|
4341
4448
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
4342
4449
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
@@ -4347,17 +4454,17 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4347
4454
|
* OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
|
|
4348
4455
|
* an error.
|
|
4349
4456
|
*/
|
|
4350
|
-
reasoningEffort:
|
|
4457
|
+
reasoningEffort: z23.string().nullish(),
|
|
4351
4458
|
/**
|
|
4352
4459
|
* Controls reasoning summary output from the model.
|
|
4353
4460
|
* Set to "auto" to automatically receive the richest level available,
|
|
4354
4461
|
* or "detailed" for comprehensive summaries.
|
|
4355
4462
|
*/
|
|
4356
|
-
reasoningSummary:
|
|
4463
|
+
reasoningSummary: z23.string().nullish(),
|
|
4357
4464
|
/**
|
|
4358
4465
|
* The identifier for safety monitoring and tracking.
|
|
4359
4466
|
*/
|
|
4360
|
-
safetyIdentifier:
|
|
4467
|
+
safetyIdentifier: z23.string().nullish(),
|
|
4361
4468
|
/**
|
|
4362
4469
|
* Service tier for the request.
|
|
4363
4470
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
@@ -4365,34 +4472,34 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4365
4472
|
*
|
|
4366
4473
|
* Defaults to 'auto'.
|
|
4367
4474
|
*/
|
|
4368
|
-
serviceTier:
|
|
4475
|
+
serviceTier: z23.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
4369
4476
|
/**
|
|
4370
4477
|
* Whether to store the generation. Defaults to `true`.
|
|
4371
4478
|
*/
|
|
4372
|
-
store:
|
|
4479
|
+
store: z23.boolean().nullish(),
|
|
4373
4480
|
/**
|
|
4374
4481
|
* Whether to use strict JSON schema validation.
|
|
4375
4482
|
* Defaults to `true`.
|
|
4376
4483
|
*/
|
|
4377
|
-
strictJsonSchema:
|
|
4484
|
+
strictJsonSchema: z23.boolean().nullish(),
|
|
4378
4485
|
/**
|
|
4379
4486
|
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
4380
4487
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
4381
4488
|
* Valid values: 'low', 'medium', 'high'.
|
|
4382
4489
|
*/
|
|
4383
|
-
textVerbosity:
|
|
4490
|
+
textVerbosity: z23.enum(["low", "medium", "high"]).nullish(),
|
|
4384
4491
|
/**
|
|
4385
4492
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
4386
4493
|
* 'disabled' turns truncation off.
|
|
4387
4494
|
*/
|
|
4388
|
-
truncation:
|
|
4495
|
+
truncation: z23.enum(["auto", "disabled"]).nullish(),
|
|
4389
4496
|
/**
|
|
4390
4497
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
4391
4498
|
* monitor and detect abuse.
|
|
4392
4499
|
* Defaults to `undefined`.
|
|
4393
4500
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
4394
4501
|
*/
|
|
4395
|
-
user:
|
|
4502
|
+
user: z23.string().nullish(),
|
|
4396
4503
|
/**
|
|
4397
4504
|
* Override the system message mode for this model.
|
|
4398
4505
|
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
@@ -4401,7 +4508,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4401
4508
|
*
|
|
4402
4509
|
* If not specified, the mode is automatically determined based on the model.
|
|
4403
4510
|
*/
|
|
4404
|
-
systemMessageMode:
|
|
4511
|
+
systemMessageMode: z23.enum(["system", "developer", "remove"]).optional(),
|
|
4405
4512
|
/**
|
|
4406
4513
|
* Force treating this model as a reasoning model.
|
|
4407
4514
|
*
|
|
@@ -4411,7 +4518,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4411
4518
|
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
4412
4519
|
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
4413
4520
|
*/
|
|
4414
|
-
forceReasoning:
|
|
4521
|
+
forceReasoning: z23.boolean().optional()
|
|
4415
4522
|
})
|
|
4416
4523
|
)
|
|
4417
4524
|
);
|
|
@@ -4753,13 +4860,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4753
4860
|
warnings.push({ type: "unsupported", feature: "stopSequences" });
|
|
4754
4861
|
}
|
|
4755
4862
|
const providerOptionsName = this.config.provider.includes("azure") ? "azure" : "openai";
|
|
4756
|
-
let openaiOptions = await
|
|
4863
|
+
let openaiOptions = await parseProviderOptions6({
|
|
4757
4864
|
provider: providerOptionsName,
|
|
4758
4865
|
providerOptions,
|
|
4759
4866
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
4760
4867
|
});
|
|
4761
4868
|
if (openaiOptions == null && providerOptionsName !== "openai") {
|
|
4762
|
-
openaiOptions = await
|
|
4869
|
+
openaiOptions = await parseProviderOptions6({
|
|
4763
4870
|
provider: "openai",
|
|
4764
4871
|
providerOptions,
|
|
4765
4872
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
@@ -6385,18 +6492,21 @@ function escapeJSONDelta(delta) {
|
|
|
6385
6492
|
import {
|
|
6386
6493
|
combineHeaders as combineHeaders6,
|
|
6387
6494
|
createBinaryResponseHandler,
|
|
6388
|
-
parseProviderOptions as
|
|
6495
|
+
parseProviderOptions as parseProviderOptions7,
|
|
6389
6496
|
postJsonToApi as postJsonToApi6
|
|
6390
6497
|
} from "@ai-sdk/provider-utils";
|
|
6391
6498
|
|
|
6392
6499
|
// src/speech/openai-speech-options.ts
|
|
6393
|
-
import {
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6500
|
+
import {
|
|
6501
|
+
lazySchema as lazySchema22,
|
|
6502
|
+
zodSchema as zodSchema22
|
|
6503
|
+
} from "@ai-sdk/provider-utils";
|
|
6504
|
+
import { z as z24 } from "zod/v4";
|
|
6505
|
+
var openaiSpeechModelOptionsSchema = lazySchema22(
|
|
6506
|
+
() => zodSchema22(
|
|
6507
|
+
z24.object({
|
|
6508
|
+
instructions: z24.string().nullish(),
|
|
6509
|
+
speed: z24.number().min(0.25).max(4).default(1).nullish()
|
|
6400
6510
|
})
|
|
6401
6511
|
)
|
|
6402
6512
|
);
|
|
@@ -6421,7 +6531,7 @@ var OpenAISpeechModel = class {
|
|
|
6421
6531
|
providerOptions
|
|
6422
6532
|
}) {
|
|
6423
6533
|
const warnings = [];
|
|
6424
|
-
const openAIOptions = await
|
|
6534
|
+
const openAIOptions = await parseProviderOptions7({
|
|
6425
6535
|
provider: "openai",
|
|
6426
6536
|
providerOptions,
|
|
6427
6537
|
schema: openaiSpeechModelOptionsSchema
|
|
@@ -6508,38 +6618,38 @@ import {
|
|
|
6508
6618
|
convertBase64ToUint8Array as convertBase64ToUint8Array2,
|
|
6509
6619
|
createJsonResponseHandler as createJsonResponseHandler6,
|
|
6510
6620
|
mediaTypeToExtension,
|
|
6511
|
-
parseProviderOptions as
|
|
6621
|
+
parseProviderOptions as parseProviderOptions8,
|
|
6512
6622
|
postFormDataToApi as postFormDataToApi2
|
|
6513
6623
|
} from "@ai-sdk/provider-utils";
|
|
6514
6624
|
|
|
6515
6625
|
// src/transcription/openai-transcription-api.ts
|
|
6516
|
-
import { lazySchema as
|
|
6517
|
-
import { z as
|
|
6518
|
-
var openaiTranscriptionResponseSchema =
|
|
6519
|
-
() =>
|
|
6520
|
-
|
|
6521
|
-
text:
|
|
6522
|
-
language:
|
|
6523
|
-
duration:
|
|
6524
|
-
words:
|
|
6525
|
-
|
|
6526
|
-
word:
|
|
6527
|
-
start:
|
|
6528
|
-
end:
|
|
6626
|
+
import { lazySchema as lazySchema23, zodSchema as zodSchema23 } from "@ai-sdk/provider-utils";
|
|
6627
|
+
import { z as z25 } from "zod/v4";
|
|
6628
|
+
var openaiTranscriptionResponseSchema = lazySchema23(
|
|
6629
|
+
() => zodSchema23(
|
|
6630
|
+
z25.object({
|
|
6631
|
+
text: z25.string(),
|
|
6632
|
+
language: z25.string().nullish(),
|
|
6633
|
+
duration: z25.number().nullish(),
|
|
6634
|
+
words: z25.array(
|
|
6635
|
+
z25.object({
|
|
6636
|
+
word: z25.string(),
|
|
6637
|
+
start: z25.number(),
|
|
6638
|
+
end: z25.number()
|
|
6529
6639
|
})
|
|
6530
6640
|
).nullish(),
|
|
6531
|
-
segments:
|
|
6532
|
-
|
|
6533
|
-
id:
|
|
6534
|
-
seek:
|
|
6535
|
-
start:
|
|
6536
|
-
end:
|
|
6537
|
-
text:
|
|
6538
|
-
tokens:
|
|
6539
|
-
temperature:
|
|
6540
|
-
avg_logprob:
|
|
6541
|
-
compression_ratio:
|
|
6542
|
-
no_speech_prob:
|
|
6641
|
+
segments: z25.array(
|
|
6642
|
+
z25.object({
|
|
6643
|
+
id: z25.number(),
|
|
6644
|
+
seek: z25.number(),
|
|
6645
|
+
start: z25.number(),
|
|
6646
|
+
end: z25.number(),
|
|
6647
|
+
text: z25.string(),
|
|
6648
|
+
tokens: z25.array(z25.number()),
|
|
6649
|
+
temperature: z25.number(),
|
|
6650
|
+
avg_logprob: z25.number(),
|
|
6651
|
+
compression_ratio: z25.number(),
|
|
6652
|
+
no_speech_prob: z25.number()
|
|
6543
6653
|
})
|
|
6544
6654
|
).nullish()
|
|
6545
6655
|
})
|
|
@@ -6547,33 +6657,36 @@ var openaiTranscriptionResponseSchema = lazySchema22(
|
|
|
6547
6657
|
);
|
|
6548
6658
|
|
|
6549
6659
|
// src/transcription/openai-transcription-options.ts
|
|
6550
|
-
import {
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6660
|
+
import {
|
|
6661
|
+
lazySchema as lazySchema24,
|
|
6662
|
+
zodSchema as zodSchema24
|
|
6663
|
+
} from "@ai-sdk/provider-utils";
|
|
6664
|
+
import { z as z26 } from "zod/v4";
|
|
6665
|
+
var openAITranscriptionModelOptions = lazySchema24(
|
|
6666
|
+
() => zodSchema24(
|
|
6667
|
+
z26.object({
|
|
6555
6668
|
/**
|
|
6556
6669
|
* Additional information to include in the transcription response.
|
|
6557
6670
|
*/
|
|
6558
|
-
include:
|
|
6671
|
+
include: z26.array(z26.string()).optional(),
|
|
6559
6672
|
/**
|
|
6560
6673
|
* The language of the input audio in ISO-639-1 format.
|
|
6561
6674
|
*/
|
|
6562
|
-
language:
|
|
6675
|
+
language: z26.string().optional(),
|
|
6563
6676
|
/**
|
|
6564
6677
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
6565
6678
|
*/
|
|
6566
|
-
prompt:
|
|
6679
|
+
prompt: z26.string().optional(),
|
|
6567
6680
|
/**
|
|
6568
6681
|
* The sampling temperature, between 0 and 1.
|
|
6569
6682
|
* @default 0
|
|
6570
6683
|
*/
|
|
6571
|
-
temperature:
|
|
6684
|
+
temperature: z26.number().min(0).max(1).default(0).optional(),
|
|
6572
6685
|
/**
|
|
6573
6686
|
* The timestamp granularities to populate for this transcription.
|
|
6574
6687
|
* @default ['segment']
|
|
6575
6688
|
*/
|
|
6576
|
-
timestampGranularities:
|
|
6689
|
+
timestampGranularities: z26.array(z26.enum(["word", "segment"])).default(["segment"]).optional()
|
|
6577
6690
|
})
|
|
6578
6691
|
)
|
|
6579
6692
|
);
|
|
@@ -6653,7 +6766,7 @@ var OpenAITranscriptionModel = class {
|
|
|
6653
6766
|
providerOptions
|
|
6654
6767
|
}) {
|
|
6655
6768
|
const warnings = [];
|
|
6656
|
-
const openAIOptions = await
|
|
6769
|
+
const openAIOptions = await parseProviderOptions8({
|
|
6657
6770
|
provider: "openai",
|
|
6658
6771
|
providerOptions,
|
|
6659
6772
|
schema: openAITranscriptionModelOptions
|
|
@@ -6746,7 +6859,7 @@ var OpenAITranscriptionModel = class {
|
|
|
6746
6859
|
};
|
|
6747
6860
|
|
|
6748
6861
|
// src/version.ts
|
|
6749
|
-
var VERSION = true ? "3.0.
|
|
6862
|
+
var VERSION = true ? "3.0.57" : "0.0.0-test";
|
|
6750
6863
|
|
|
6751
6864
|
// src/openai-provider.ts
|
|
6752
6865
|
function createOpenAI(options = {}) {
|