@ai-sdk/openai 3.0.55 → 3.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/index.d.mts +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +1221 -1125
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1165 -1065
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +30 -1
- package/dist/internal/index.d.ts +30 -1
- package/dist/internal/index.js +1220 -1118
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1166 -1063
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +12 -3
- package/package.json +2 -2
- package/src/image/openai-image-model-options.ts +123 -0
- package/src/image/openai-image-model.ts +40 -77
- package/src/index.ts +5 -0
- package/src/internal/index.ts +1 -1
- package/src/openai-provider.ts +1 -1
- package/src/responses/openai-responses-api.ts +3 -0
- package/src/responses/openai-responses-language-model.ts +11 -0
- package/src/image/openai-image-options.ts +0 -34
package/dist/index.mjs
CHANGED
|
@@ -1742,6 +1742,7 @@ import {
|
|
|
1742
1742
|
convertToFormData,
|
|
1743
1743
|
createJsonResponseHandler as createJsonResponseHandler4,
|
|
1744
1744
|
downloadBlob,
|
|
1745
|
+
parseProviderOptions as parseProviderOptions4,
|
|
1745
1746
|
postFormDataToApi,
|
|
1746
1747
|
postJsonToApi as postJsonToApi4
|
|
1747
1748
|
} from "@ai-sdk/provider-utils";
|
|
@@ -1776,7 +1777,12 @@ var openaiImageResponseSchema = lazySchema7(
|
|
|
1776
1777
|
)
|
|
1777
1778
|
);
|
|
1778
1779
|
|
|
1779
|
-
// 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";
|
|
1780
1786
|
var modelMaxImagesPerCall = {
|
|
1781
1787
|
"dall-e-3": 1,
|
|
1782
1788
|
"dall-e-2": 10,
|
|
@@ -1798,6 +1804,65 @@ function hasDefaultResponseFormat(modelId) {
|
|
|
1798
1804
|
(prefix) => modelId.startsWith(prefix)
|
|
1799
1805
|
);
|
|
1800
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
|
+
);
|
|
1801
1866
|
|
|
1802
1867
|
// src/image/openai-image-model.ts
|
|
1803
1868
|
var OpenAIImageModel = class {
|
|
@@ -1839,6 +1904,11 @@ var OpenAIImageModel = class {
|
|
|
1839
1904
|
}
|
|
1840
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();
|
|
1841
1906
|
if (files != null) {
|
|
1907
|
+
const openaiOptions2 = (_d = await parseProviderOptions4({
|
|
1908
|
+
provider: "openai",
|
|
1909
|
+
providerOptions,
|
|
1910
|
+
schema: openaiImageModelEditOptions
|
|
1911
|
+
})) != null ? _d : {};
|
|
1842
1912
|
const { value: response2, responseHeaders: responseHeaders2 } = await postFormDataToApi({
|
|
1843
1913
|
url: this.config.url({
|
|
1844
1914
|
path: "/images/edits",
|
|
@@ -1865,7 +1935,12 @@ var OpenAIImageModel = class {
|
|
|
1865
1935
|
mask: mask != null ? await fileToBlob(mask) : void 0,
|
|
1866
1936
|
n,
|
|
1867
1937
|
size,
|
|
1868
|
-
|
|
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
|
|
1869
1944
|
}),
|
|
1870
1945
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
1871
1946
|
successfulResponseHandler: createJsonResponseHandler4(
|
|
@@ -1909,6 +1984,11 @@ var OpenAIImageModel = class {
|
|
|
1909
1984
|
}
|
|
1910
1985
|
};
|
|
1911
1986
|
}
|
|
1987
|
+
const openaiOptions = (_h = await parseProviderOptions4({
|
|
1988
|
+
provider: "openai",
|
|
1989
|
+
providerOptions,
|
|
1990
|
+
schema: openaiImageModelGenerationOptions
|
|
1991
|
+
})) != null ? _h : {};
|
|
1912
1992
|
const { value: response, responseHeaders } = await postJsonToApi4({
|
|
1913
1993
|
url: this.config.url({
|
|
1914
1994
|
path: "/images/generations",
|
|
@@ -1920,7 +2000,13 @@ var OpenAIImageModel = class {
|
|
|
1920
2000
|
prompt,
|
|
1921
2001
|
n,
|
|
1922
2002
|
size,
|
|
1923
|
-
|
|
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,
|
|
1924
2010
|
...!hasDefaultResponseFormat(this.modelId) ? { response_format: "b64_json" } : {}
|
|
1925
2011
|
},
|
|
1926
2012
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
@@ -1995,42 +2081,42 @@ async function fileToBlob(file) {
|
|
|
1995
2081
|
// src/tool/apply-patch.ts
|
|
1996
2082
|
import {
|
|
1997
2083
|
createProviderToolFactoryWithOutputSchema,
|
|
1998
|
-
lazySchema as
|
|
1999
|
-
zodSchema as
|
|
2084
|
+
lazySchema as lazySchema9,
|
|
2085
|
+
zodSchema as zodSchema9
|
|
2000
2086
|
} from "@ai-sdk/provider-utils";
|
|
2001
|
-
import { z as
|
|
2002
|
-
var applyPatchInputSchema =
|
|
2003
|
-
() =>
|
|
2004
|
-
|
|
2005
|
-
callId:
|
|
2006
|
-
operation:
|
|
2007
|
-
|
|
2008
|
-
type:
|
|
2009
|
-
path:
|
|
2010
|
-
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()
|
|
2011
2097
|
}),
|
|
2012
|
-
|
|
2013
|
-
type:
|
|
2014
|
-
path:
|
|
2098
|
+
z10.object({
|
|
2099
|
+
type: z10.literal("delete_file"),
|
|
2100
|
+
path: z10.string()
|
|
2015
2101
|
}),
|
|
2016
|
-
|
|
2017
|
-
type:
|
|
2018
|
-
path:
|
|
2019
|
-
diff:
|
|
2102
|
+
z10.object({
|
|
2103
|
+
type: z10.literal("update_file"),
|
|
2104
|
+
path: z10.string(),
|
|
2105
|
+
diff: z10.string()
|
|
2020
2106
|
})
|
|
2021
2107
|
])
|
|
2022
2108
|
})
|
|
2023
2109
|
)
|
|
2024
2110
|
);
|
|
2025
|
-
var applyPatchOutputSchema =
|
|
2026
|
-
() =>
|
|
2027
|
-
|
|
2028
|
-
status:
|
|
2029
|
-
output:
|
|
2111
|
+
var applyPatchOutputSchema = lazySchema9(
|
|
2112
|
+
() => zodSchema9(
|
|
2113
|
+
z10.object({
|
|
2114
|
+
status: z10.enum(["completed", "failed"]),
|
|
2115
|
+
output: z10.string().optional()
|
|
2030
2116
|
})
|
|
2031
2117
|
)
|
|
2032
2118
|
);
|
|
2033
|
-
var applyPatchArgsSchema =
|
|
2119
|
+
var applyPatchArgsSchema = lazySchema9(() => zodSchema9(z10.object({})));
|
|
2034
2120
|
var applyPatchToolFactory = createProviderToolFactoryWithOutputSchema({
|
|
2035
2121
|
id: "openai.apply_patch",
|
|
2036
2122
|
inputSchema: applyPatchInputSchema,
|
|
@@ -2041,37 +2127,37 @@ var applyPatch = applyPatchToolFactory;
|
|
|
2041
2127
|
// src/tool/code-interpreter.ts
|
|
2042
2128
|
import {
|
|
2043
2129
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
|
|
2044
|
-
lazySchema as
|
|
2045
|
-
zodSchema as
|
|
2130
|
+
lazySchema as lazySchema10,
|
|
2131
|
+
zodSchema as zodSchema10
|
|
2046
2132
|
} from "@ai-sdk/provider-utils";
|
|
2047
|
-
import { z as
|
|
2048
|
-
var codeInterpreterInputSchema =
|
|
2049
|
-
() =>
|
|
2050
|
-
|
|
2051
|
-
code:
|
|
2052
|
-
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()
|
|
2053
2139
|
})
|
|
2054
2140
|
)
|
|
2055
2141
|
);
|
|
2056
|
-
var codeInterpreterOutputSchema =
|
|
2057
|
-
() =>
|
|
2058
|
-
|
|
2059
|
-
outputs:
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
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() })
|
|
2063
2149
|
])
|
|
2064
2150
|
).nullish()
|
|
2065
2151
|
})
|
|
2066
2152
|
)
|
|
2067
2153
|
);
|
|
2068
|
-
var codeInterpreterArgsSchema =
|
|
2069
|
-
() =>
|
|
2070
|
-
|
|
2071
|
-
container:
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
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()
|
|
2075
2161
|
})
|
|
2076
2162
|
]).optional()
|
|
2077
2163
|
})
|
|
@@ -2089,29 +2175,29 @@ var codeInterpreter = (args = {}) => {
|
|
|
2089
2175
|
// src/tool/custom.ts
|
|
2090
2176
|
import {
|
|
2091
2177
|
createProviderToolFactory,
|
|
2092
|
-
lazySchema as
|
|
2093
|
-
zodSchema as
|
|
2178
|
+
lazySchema as lazySchema11,
|
|
2179
|
+
zodSchema as zodSchema11
|
|
2094
2180
|
} from "@ai-sdk/provider-utils";
|
|
2095
|
-
import { z as
|
|
2096
|
-
var customArgsSchema =
|
|
2097
|
-
() =>
|
|
2098
|
-
|
|
2099
|
-
name:
|
|
2100
|
-
description:
|
|
2101
|
-
format:
|
|
2102
|
-
|
|
2103
|
-
type:
|
|
2104
|
-
syntax:
|
|
2105
|
-
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()
|
|
2106
2192
|
}),
|
|
2107
|
-
|
|
2108
|
-
type:
|
|
2193
|
+
z12.object({
|
|
2194
|
+
type: z12.literal("text")
|
|
2109
2195
|
})
|
|
2110
2196
|
]).optional()
|
|
2111
2197
|
})
|
|
2112
2198
|
)
|
|
2113
2199
|
);
|
|
2114
|
-
var customInputSchema =
|
|
2200
|
+
var customInputSchema = lazySchema11(() => zodSchema11(z12.string()));
|
|
2115
2201
|
var customToolFactory = createProviderToolFactory({
|
|
2116
2202
|
id: "openai.custom",
|
|
2117
2203
|
inputSchema: customInputSchema
|
|
@@ -2121,45 +2207,45 @@ var customTool = (args) => customToolFactory(args);
|
|
|
2121
2207
|
// src/tool/file-search.ts
|
|
2122
2208
|
import {
|
|
2123
2209
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
|
|
2124
|
-
lazySchema as
|
|
2125
|
-
zodSchema as
|
|
2210
|
+
lazySchema as lazySchema12,
|
|
2211
|
+
zodSchema as zodSchema12
|
|
2126
2212
|
} from "@ai-sdk/provider-utils";
|
|
2127
|
-
import { z as
|
|
2128
|
-
var comparisonFilterSchema =
|
|
2129
|
-
key:
|
|
2130
|
-
type:
|
|
2131
|
-
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())])
|
|
2132
2218
|
});
|
|
2133
|
-
var compoundFilterSchema =
|
|
2134
|
-
type:
|
|
2135
|
-
filters:
|
|
2136
|
-
|
|
2219
|
+
var compoundFilterSchema = z13.object({
|
|
2220
|
+
type: z13.enum(["and", "or"]),
|
|
2221
|
+
filters: z13.array(
|
|
2222
|
+
z13.union([comparisonFilterSchema, z13.lazy(() => compoundFilterSchema)])
|
|
2137
2223
|
)
|
|
2138
2224
|
});
|
|
2139
|
-
var fileSearchArgsSchema =
|
|
2140
|
-
() =>
|
|
2141
|
-
|
|
2142
|
-
vectorStoreIds:
|
|
2143
|
-
maxNumResults:
|
|
2144
|
-
ranking:
|
|
2145
|
-
ranker:
|
|
2146
|
-
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()
|
|
2147
2233
|
}).optional(),
|
|
2148
|
-
filters:
|
|
2234
|
+
filters: z13.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
2149
2235
|
})
|
|
2150
2236
|
)
|
|
2151
2237
|
);
|
|
2152
|
-
var fileSearchOutputSchema =
|
|
2153
|
-
() =>
|
|
2154
|
-
|
|
2155
|
-
queries:
|
|
2156
|
-
results:
|
|
2157
|
-
|
|
2158
|
-
attributes:
|
|
2159
|
-
fileId:
|
|
2160
|
-
filename:
|
|
2161
|
-
score:
|
|
2162
|
-
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()
|
|
2163
2249
|
})
|
|
2164
2250
|
).nullable()
|
|
2165
2251
|
})
|
|
@@ -2167,39 +2253,39 @@ var fileSearchOutputSchema = lazySchema11(
|
|
|
2167
2253
|
);
|
|
2168
2254
|
var fileSearch = createProviderToolFactoryWithOutputSchema3({
|
|
2169
2255
|
id: "openai.file_search",
|
|
2170
|
-
inputSchema:
|
|
2256
|
+
inputSchema: z13.object({}),
|
|
2171
2257
|
outputSchema: fileSearchOutputSchema
|
|
2172
2258
|
});
|
|
2173
2259
|
|
|
2174
2260
|
// src/tool/image-generation.ts
|
|
2175
2261
|
import {
|
|
2176
2262
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
|
|
2177
|
-
lazySchema as
|
|
2178
|
-
zodSchema as
|
|
2263
|
+
lazySchema as lazySchema13,
|
|
2264
|
+
zodSchema as zodSchema13
|
|
2179
2265
|
} from "@ai-sdk/provider-utils";
|
|
2180
|
-
import { z as
|
|
2181
|
-
var imageGenerationArgsSchema =
|
|
2182
|
-
() =>
|
|
2183
|
-
|
|
2184
|
-
background:
|
|
2185
|
-
inputFidelity:
|
|
2186
|
-
inputImageMask:
|
|
2187
|
-
fileId:
|
|
2188
|
-
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()
|
|
2189
2275
|
}).optional(),
|
|
2190
|
-
model:
|
|
2191
|
-
moderation:
|
|
2192
|
-
outputCompression:
|
|
2193
|
-
outputFormat:
|
|
2194
|
-
partialImages:
|
|
2195
|
-
quality:
|
|
2196
|
-
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()
|
|
2197
2283
|
}).strict()
|
|
2198
2284
|
)
|
|
2199
2285
|
);
|
|
2200
|
-
var imageGenerationInputSchema =
|
|
2201
|
-
var imageGenerationOutputSchema =
|
|
2202
|
-
() =>
|
|
2286
|
+
var imageGenerationInputSchema = lazySchema13(() => zodSchema13(z14.object({})));
|
|
2287
|
+
var imageGenerationOutputSchema = lazySchema13(
|
|
2288
|
+
() => zodSchema13(z14.object({ result: z14.string() }))
|
|
2203
2289
|
);
|
|
2204
2290
|
var imageGenerationToolFactory = createProviderToolFactoryWithOutputSchema4({
|
|
2205
2291
|
id: "openai.image_generation",
|
|
@@ -2213,26 +2299,26 @@ var imageGeneration = (args = {}) => {
|
|
|
2213
2299
|
// src/tool/local-shell.ts
|
|
2214
2300
|
import {
|
|
2215
2301
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
|
|
2216
|
-
lazySchema as
|
|
2217
|
-
zodSchema as
|
|
2302
|
+
lazySchema as lazySchema14,
|
|
2303
|
+
zodSchema as zodSchema14
|
|
2218
2304
|
} from "@ai-sdk/provider-utils";
|
|
2219
|
-
import { z as
|
|
2220
|
-
var localShellInputSchema =
|
|
2221
|
-
() =>
|
|
2222
|
-
|
|
2223
|
-
action:
|
|
2224
|
-
type:
|
|
2225
|
-
command:
|
|
2226
|
-
timeoutMs:
|
|
2227
|
-
user:
|
|
2228
|
-
workingDirectory:
|
|
2229
|
-
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()
|
|
2230
2316
|
})
|
|
2231
2317
|
})
|
|
2232
2318
|
)
|
|
2233
2319
|
);
|
|
2234
|
-
var localShellOutputSchema =
|
|
2235
|
-
() =>
|
|
2320
|
+
var localShellOutputSchema = lazySchema14(
|
|
2321
|
+
() => zodSchema14(z15.object({ output: z15.string() }))
|
|
2236
2322
|
);
|
|
2237
2323
|
var localShell = createProviderToolFactoryWithOutputSchema5({
|
|
2238
2324
|
id: "openai.local_shell",
|
|
@@ -2243,91 +2329,91 @@ var localShell = createProviderToolFactoryWithOutputSchema5({
|
|
|
2243
2329
|
// src/tool/shell.ts
|
|
2244
2330
|
import {
|
|
2245
2331
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
|
|
2246
|
-
lazySchema as
|
|
2247
|
-
zodSchema as
|
|
2332
|
+
lazySchema as lazySchema15,
|
|
2333
|
+
zodSchema as zodSchema15
|
|
2248
2334
|
} from "@ai-sdk/provider-utils";
|
|
2249
|
-
import { z as
|
|
2250
|
-
var shellInputSchema =
|
|
2251
|
-
() =>
|
|
2252
|
-
|
|
2253
|
-
action:
|
|
2254
|
-
commands:
|
|
2255
|
-
timeoutMs:
|
|
2256
|
-
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()
|
|
2257
2343
|
})
|
|
2258
2344
|
})
|
|
2259
2345
|
)
|
|
2260
2346
|
);
|
|
2261
|
-
var shellOutputSchema =
|
|
2262
|
-
() =>
|
|
2263
|
-
|
|
2264
|
-
output:
|
|
2265
|
-
|
|
2266
|
-
stdout:
|
|
2267
|
-
stderr:
|
|
2268
|
-
outcome:
|
|
2269
|
-
|
|
2270
|
-
|
|
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() })
|
|
2271
2357
|
])
|
|
2272
2358
|
})
|
|
2273
2359
|
)
|
|
2274
2360
|
})
|
|
2275
2361
|
)
|
|
2276
2362
|
);
|
|
2277
|
-
var shellSkillsSchema =
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
type:
|
|
2281
|
-
skillId:
|
|
2282
|
-
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()
|
|
2283
2369
|
}),
|
|
2284
|
-
|
|
2285
|
-
type:
|
|
2286
|
-
name:
|
|
2287
|
-
description:
|
|
2288
|
-
source:
|
|
2289
|
-
type:
|
|
2290
|
-
mediaType:
|
|
2291
|
-
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()
|
|
2292
2378
|
})
|
|
2293
2379
|
})
|
|
2294
2380
|
])
|
|
2295
2381
|
).optional();
|
|
2296
|
-
var shellArgsSchema =
|
|
2297
|
-
() =>
|
|
2298
|
-
|
|
2299
|
-
environment:
|
|
2300
|
-
|
|
2301
|
-
type:
|
|
2302
|
-
fileIds:
|
|
2303
|
-
memoryLimit:
|
|
2304
|
-
networkPolicy:
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
type:
|
|
2308
|
-
allowedDomains:
|
|
2309
|
-
domainSecrets:
|
|
2310
|
-
|
|
2311
|
-
domain:
|
|
2312
|
-
name:
|
|
2313
|
-
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()
|
|
2314
2400
|
})
|
|
2315
2401
|
).optional()
|
|
2316
2402
|
})
|
|
2317
2403
|
]).optional(),
|
|
2318
2404
|
skills: shellSkillsSchema
|
|
2319
2405
|
}),
|
|
2320
|
-
|
|
2321
|
-
type:
|
|
2322
|
-
containerId:
|
|
2406
|
+
z16.object({
|
|
2407
|
+
type: z16.literal("containerReference"),
|
|
2408
|
+
containerId: z16.string()
|
|
2323
2409
|
}),
|
|
2324
|
-
|
|
2325
|
-
type:
|
|
2326
|
-
skills:
|
|
2327
|
-
|
|
2328
|
-
name:
|
|
2329
|
-
description:
|
|
2330
|
-
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()
|
|
2331
2417
|
})
|
|
2332
2418
|
).optional()
|
|
2333
2419
|
})
|
|
@@ -2344,31 +2430,31 @@ var shell = createProviderToolFactoryWithOutputSchema6({
|
|
|
2344
2430
|
// src/tool/tool-search.ts
|
|
2345
2431
|
import {
|
|
2346
2432
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
|
|
2347
|
-
lazySchema as
|
|
2348
|
-
zodSchema as
|
|
2433
|
+
lazySchema as lazySchema16,
|
|
2434
|
+
zodSchema as zodSchema16
|
|
2349
2435
|
} from "@ai-sdk/provider-utils";
|
|
2350
|
-
import { z as
|
|
2351
|
-
var toolSearchArgsSchema =
|
|
2352
|
-
() =>
|
|
2353
|
-
|
|
2354
|
-
execution:
|
|
2355
|
-
description:
|
|
2356
|
-
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()
|
|
2357
2443
|
})
|
|
2358
2444
|
)
|
|
2359
2445
|
);
|
|
2360
|
-
var toolSearchInputSchema =
|
|
2361
|
-
() =>
|
|
2362
|
-
|
|
2363
|
-
arguments:
|
|
2364
|
-
call_id:
|
|
2446
|
+
var toolSearchInputSchema = lazySchema16(
|
|
2447
|
+
() => zodSchema16(
|
|
2448
|
+
z17.object({
|
|
2449
|
+
arguments: z17.unknown().optional(),
|
|
2450
|
+
call_id: z17.string().nullish()
|
|
2365
2451
|
})
|
|
2366
2452
|
)
|
|
2367
2453
|
);
|
|
2368
|
-
var toolSearchOutputSchema =
|
|
2369
|
-
() =>
|
|
2370
|
-
|
|
2371
|
-
tools:
|
|
2454
|
+
var toolSearchOutputSchema = lazySchema16(
|
|
2455
|
+
() => zodSchema16(
|
|
2456
|
+
z17.object({
|
|
2457
|
+
tools: z17.array(z17.record(z17.string(), z17.unknown()))
|
|
2372
2458
|
})
|
|
2373
2459
|
)
|
|
2374
2460
|
);
|
|
@@ -2382,71 +2468,15 @@ var toolSearch = (args = {}) => toolSearchToolFactory(args);
|
|
|
2382
2468
|
// src/tool/web-search.ts
|
|
2383
2469
|
import {
|
|
2384
2470
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
|
|
2385
|
-
lazySchema as lazySchema16,
|
|
2386
|
-
zodSchema as zodSchema16
|
|
2387
|
-
} from "@ai-sdk/provider-utils";
|
|
2388
|
-
import { z as z17 } from "zod/v4";
|
|
2389
|
-
var webSearchArgsSchema = lazySchema16(
|
|
2390
|
-
() => zodSchema16(
|
|
2391
|
-
z17.object({
|
|
2392
|
-
externalWebAccess: z17.boolean().optional(),
|
|
2393
|
-
filters: z17.object({ allowedDomains: z17.array(z17.string()).optional() }).optional(),
|
|
2394
|
-
searchContextSize: z17.enum(["low", "medium", "high"]).optional(),
|
|
2395
|
-
userLocation: z17.object({
|
|
2396
|
-
type: z17.literal("approximate"),
|
|
2397
|
-
country: z17.string().optional(),
|
|
2398
|
-
city: z17.string().optional(),
|
|
2399
|
-
region: z17.string().optional(),
|
|
2400
|
-
timezone: z17.string().optional()
|
|
2401
|
-
}).optional()
|
|
2402
|
-
})
|
|
2403
|
-
)
|
|
2404
|
-
);
|
|
2405
|
-
var webSearchInputSchema = lazySchema16(() => zodSchema16(z17.object({})));
|
|
2406
|
-
var webSearchOutputSchema = lazySchema16(
|
|
2407
|
-
() => zodSchema16(
|
|
2408
|
-
z17.object({
|
|
2409
|
-
action: z17.discriminatedUnion("type", [
|
|
2410
|
-
z17.object({
|
|
2411
|
-
type: z17.literal("search"),
|
|
2412
|
-
query: z17.string().optional()
|
|
2413
|
-
}),
|
|
2414
|
-
z17.object({
|
|
2415
|
-
type: z17.literal("openPage"),
|
|
2416
|
-
url: z17.string().nullish()
|
|
2417
|
-
}),
|
|
2418
|
-
z17.object({
|
|
2419
|
-
type: z17.literal("findInPage"),
|
|
2420
|
-
url: z17.string().nullish(),
|
|
2421
|
-
pattern: z17.string().nullish()
|
|
2422
|
-
})
|
|
2423
|
-
]).optional(),
|
|
2424
|
-
sources: z17.array(
|
|
2425
|
-
z17.discriminatedUnion("type", [
|
|
2426
|
-
z17.object({ type: z17.literal("url"), url: z17.string() }),
|
|
2427
|
-
z17.object({ type: z17.literal("api"), name: z17.string() })
|
|
2428
|
-
])
|
|
2429
|
-
).optional()
|
|
2430
|
-
})
|
|
2431
|
-
)
|
|
2432
|
-
);
|
|
2433
|
-
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema8({
|
|
2434
|
-
id: "openai.web_search",
|
|
2435
|
-
inputSchema: webSearchInputSchema,
|
|
2436
|
-
outputSchema: webSearchOutputSchema
|
|
2437
|
-
});
|
|
2438
|
-
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
2439
|
-
|
|
2440
|
-
// src/tool/web-search-preview.ts
|
|
2441
|
-
import {
|
|
2442
|
-
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
|
|
2443
2471
|
lazySchema as lazySchema17,
|
|
2444
2472
|
zodSchema as zodSchema17
|
|
2445
2473
|
} from "@ai-sdk/provider-utils";
|
|
2446
2474
|
import { z as z18 } from "zod/v4";
|
|
2447
|
-
var
|
|
2475
|
+
var webSearchArgsSchema = lazySchema17(
|
|
2448
2476
|
() => zodSchema17(
|
|
2449
2477
|
z18.object({
|
|
2478
|
+
externalWebAccess: z18.boolean().optional(),
|
|
2479
|
+
filters: z18.object({ allowedDomains: z18.array(z18.string()).optional() }).optional(),
|
|
2450
2480
|
searchContextSize: z18.enum(["low", "medium", "high"]).optional(),
|
|
2451
2481
|
userLocation: z18.object({
|
|
2452
2482
|
type: z18.literal("approximate"),
|
|
@@ -2458,10 +2488,8 @@ var webSearchPreviewArgsSchema = lazySchema17(
|
|
|
2458
2488
|
})
|
|
2459
2489
|
)
|
|
2460
2490
|
);
|
|
2461
|
-
var
|
|
2462
|
-
|
|
2463
|
-
);
|
|
2464
|
-
var webSearchPreviewOutputSchema = lazySchema17(
|
|
2491
|
+
var webSearchInputSchema = lazySchema17(() => zodSchema17(z18.object({})));
|
|
2492
|
+
var webSearchOutputSchema = lazySchema17(
|
|
2465
2493
|
() => zodSchema17(
|
|
2466
2494
|
z18.object({
|
|
2467
2495
|
action: z18.discriminatedUnion("type", [
|
|
@@ -2478,6 +2506,64 @@ var webSearchPreviewOutputSchema = lazySchema17(
|
|
|
2478
2506
|
url: z18.string().nullish(),
|
|
2479
2507
|
pattern: z18.string().nullish()
|
|
2480
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
|
+
})
|
|
2481
2567
|
]).optional()
|
|
2482
2568
|
})
|
|
2483
2569
|
)
|
|
@@ -2491,60 +2577,60 @@ var webSearchPreview = createProviderToolFactoryWithOutputSchema9({
|
|
|
2491
2577
|
// src/tool/mcp.ts
|
|
2492
2578
|
import {
|
|
2493
2579
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema10,
|
|
2494
|
-
lazySchema as
|
|
2495
|
-
zodSchema as
|
|
2580
|
+
lazySchema as lazySchema19,
|
|
2581
|
+
zodSchema as zodSchema19
|
|
2496
2582
|
} from "@ai-sdk/provider-utils";
|
|
2497
|
-
import { z as
|
|
2498
|
-
var jsonValueSchema =
|
|
2499
|
-
() =>
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
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)
|
|
2506
2592
|
])
|
|
2507
2593
|
);
|
|
2508
|
-
var mcpArgsSchema =
|
|
2509
|
-
() =>
|
|
2510
|
-
|
|
2511
|
-
serverLabel:
|
|
2512
|
-
allowedTools:
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
readOnly:
|
|
2516
|
-
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()
|
|
2517
2603
|
})
|
|
2518
2604
|
]).optional(),
|
|
2519
|
-
authorization:
|
|
2520
|
-
connectorId:
|
|
2521
|
-
headers:
|
|
2522
|
-
requireApproval:
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
never:
|
|
2526
|
-
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()
|
|
2527
2613
|
}).optional()
|
|
2528
2614
|
})
|
|
2529
2615
|
]).optional(),
|
|
2530
|
-
serverDescription:
|
|
2531
|
-
serverUrl:
|
|
2616
|
+
serverDescription: z20.string().optional(),
|
|
2617
|
+
serverUrl: z20.string().optional()
|
|
2532
2618
|
}).refine(
|
|
2533
2619
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
2534
2620
|
"One of serverUrl or connectorId must be provided."
|
|
2535
2621
|
)
|
|
2536
2622
|
)
|
|
2537
2623
|
);
|
|
2538
|
-
var mcpInputSchema =
|
|
2539
|
-
var mcpOutputSchema =
|
|
2540
|
-
() =>
|
|
2541
|
-
|
|
2542
|
-
type:
|
|
2543
|
-
serverLabel:
|
|
2544
|
-
name:
|
|
2545
|
-
arguments:
|
|
2546
|
-
output:
|
|
2547
|
-
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()
|
|
2548
2634
|
})
|
|
2549
2635
|
)
|
|
2550
2636
|
);
|
|
@@ -2683,7 +2769,7 @@ import {
|
|
|
2683
2769
|
createJsonResponseHandler as createJsonResponseHandler5,
|
|
2684
2770
|
createToolNameMapping,
|
|
2685
2771
|
generateId as generateId2,
|
|
2686
|
-
parseProviderOptions as
|
|
2772
|
+
parseProviderOptions as parseProviderOptions6,
|
|
2687
2773
|
postJsonToApi as postJsonToApi5
|
|
2688
2774
|
} from "@ai-sdk/provider-utils";
|
|
2689
2775
|
|
|
@@ -2734,10 +2820,10 @@ import {
|
|
|
2734
2820
|
convertToBase64 as convertToBase642,
|
|
2735
2821
|
isNonNullable,
|
|
2736
2822
|
parseJSON,
|
|
2737
|
-
parseProviderOptions as
|
|
2823
|
+
parseProviderOptions as parseProviderOptions5,
|
|
2738
2824
|
validateTypes
|
|
2739
2825
|
} from "@ai-sdk/provider-utils";
|
|
2740
|
-
import { z as
|
|
2826
|
+
import { z as z21 } from "zod/v4";
|
|
2741
2827
|
function serializeToolCallArguments2(input) {
|
|
2742
2828
|
return JSON.stringify(input === void 0 ? {} : input);
|
|
2743
2829
|
}
|
|
@@ -3033,7 +3119,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3033
3119
|
break;
|
|
3034
3120
|
}
|
|
3035
3121
|
case "reasoning": {
|
|
3036
|
-
const providerOptions = await
|
|
3122
|
+
const providerOptions = await parseProviderOptions5({
|
|
3037
3123
|
provider: providerOptionsName,
|
|
3038
3124
|
providerOptions: part.providerOptions,
|
|
3039
3125
|
schema: openaiResponsesReasoningProviderOptionsSchema
|
|
@@ -3341,9 +3427,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
3341
3427
|
}
|
|
3342
3428
|
return { input, warnings };
|
|
3343
3429
|
}
|
|
3344
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
3345
|
-
itemId:
|
|
3346
|
-
reasoningEncryptedContent:
|
|
3430
|
+
var openaiResponsesReasoningProviderOptionsSchema = z21.object({
|
|
3431
|
+
itemId: z21.string().nullish(),
|
|
3432
|
+
reasoningEncryptedContent: z21.string().nullish()
|
|
3347
3433
|
});
|
|
3348
3434
|
|
|
3349
3435
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -3366,544 +3452,546 @@ function mapOpenAIResponseFinishReason({
|
|
|
3366
3452
|
|
|
3367
3453
|
// src/responses/openai-responses-api.ts
|
|
3368
3454
|
import {
|
|
3369
|
-
lazySchema as
|
|
3370
|
-
zodSchema as
|
|
3455
|
+
lazySchema as lazySchema20,
|
|
3456
|
+
zodSchema as zodSchema20
|
|
3371
3457
|
} from "@ai-sdk/provider-utils";
|
|
3372
|
-
import { z as
|
|
3373
|
-
var jsonValueSchema2 =
|
|
3374
|
-
() =>
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
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())
|
|
3381
3467
|
])
|
|
3382
3468
|
);
|
|
3383
|
-
var openaiResponsesChunkSchema =
|
|
3384
|
-
() =>
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
type:
|
|
3388
|
-
item_id:
|
|
3389
|
-
delta:
|
|
3390
|
-
logprobs:
|
|
3391
|
-
|
|
3392
|
-
token:
|
|
3393
|
-
logprob:
|
|
3394
|
-
top_logprobs:
|
|
3395
|
-
|
|
3396
|
-
token:
|
|
3397
|
-
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()
|
|
3398
3484
|
})
|
|
3399
3485
|
)
|
|
3400
3486
|
})
|
|
3401
3487
|
).nullish()
|
|
3402
3488
|
}),
|
|
3403
|
-
|
|
3404
|
-
type:
|
|
3405
|
-
response:
|
|
3406
|
-
incomplete_details:
|
|
3407
|
-
usage:
|
|
3408
|
-
input_tokens:
|
|
3409
|
-
input_tokens_details:
|
|
3410
|
-
output_tokens:
|
|
3411
|
-
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()
|
|
3412
3498
|
}),
|
|
3413
|
-
service_tier:
|
|
3499
|
+
service_tier: z22.string().nullish()
|
|
3414
3500
|
})
|
|
3415
3501
|
}),
|
|
3416
|
-
|
|
3417
|
-
type:
|
|
3418
|
-
response:
|
|
3419
|
-
error:
|
|
3420
|
-
code:
|
|
3421
|
-
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()
|
|
3422
3508
|
}).nullish(),
|
|
3423
|
-
incomplete_details:
|
|
3424
|
-
usage:
|
|
3425
|
-
input_tokens:
|
|
3426
|
-
input_tokens_details:
|
|
3427
|
-
output_tokens:
|
|
3428
|
-
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()
|
|
3429
3515
|
}).nullish(),
|
|
3430
|
-
service_tier:
|
|
3516
|
+
service_tier: z22.string().nullish()
|
|
3431
3517
|
})
|
|
3432
3518
|
}),
|
|
3433
|
-
|
|
3434
|
-
type:
|
|
3435
|
-
response:
|
|
3436
|
-
id:
|
|
3437
|
-
created_at:
|
|
3438
|
-
model:
|
|
3439
|
-
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()
|
|
3440
3526
|
})
|
|
3441
3527
|
}),
|
|
3442
|
-
|
|
3443
|
-
type:
|
|
3444
|
-
output_index:
|
|
3445
|
-
item:
|
|
3446
|
-
|
|
3447
|
-
type:
|
|
3448
|
-
id:
|
|
3449
|
-
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()
|
|
3450
3536
|
}),
|
|
3451
|
-
|
|
3452
|
-
type:
|
|
3453
|
-
id:
|
|
3454
|
-
encrypted_content:
|
|
3537
|
+
z22.object({
|
|
3538
|
+
type: z22.literal("reasoning"),
|
|
3539
|
+
id: z22.string(),
|
|
3540
|
+
encrypted_content: z22.string().nullish()
|
|
3455
3541
|
}),
|
|
3456
|
-
|
|
3457
|
-
type:
|
|
3458
|
-
id:
|
|
3459
|
-
call_id:
|
|
3460
|
-
name:
|
|
3461
|
-
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(),
|
|
3548
|
+
namespace: z22.string().nullish()
|
|
3462
3549
|
}),
|
|
3463
|
-
|
|
3464
|
-
type:
|
|
3465
|
-
id:
|
|
3466
|
-
status:
|
|
3550
|
+
z22.object({
|
|
3551
|
+
type: z22.literal("web_search_call"),
|
|
3552
|
+
id: z22.string(),
|
|
3553
|
+
status: z22.string()
|
|
3467
3554
|
}),
|
|
3468
|
-
|
|
3469
|
-
type:
|
|
3470
|
-
id:
|
|
3471
|
-
status:
|
|
3555
|
+
z22.object({
|
|
3556
|
+
type: z22.literal("computer_call"),
|
|
3557
|
+
id: z22.string(),
|
|
3558
|
+
status: z22.string()
|
|
3472
3559
|
}),
|
|
3473
|
-
|
|
3474
|
-
type:
|
|
3475
|
-
id:
|
|
3560
|
+
z22.object({
|
|
3561
|
+
type: z22.literal("file_search_call"),
|
|
3562
|
+
id: z22.string()
|
|
3476
3563
|
}),
|
|
3477
|
-
|
|
3478
|
-
type:
|
|
3479
|
-
id:
|
|
3564
|
+
z22.object({
|
|
3565
|
+
type: z22.literal("image_generation_call"),
|
|
3566
|
+
id: z22.string()
|
|
3480
3567
|
}),
|
|
3481
|
-
|
|
3482
|
-
type:
|
|
3483
|
-
id:
|
|
3484
|
-
container_id:
|
|
3485
|
-
code:
|
|
3486
|
-
outputs:
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3568
|
+
z22.object({
|
|
3569
|
+
type: z22.literal("code_interpreter_call"),
|
|
3570
|
+
id: z22.string(),
|
|
3571
|
+
container_id: z22.string(),
|
|
3572
|
+
code: z22.string().nullable(),
|
|
3573
|
+
outputs: z22.array(
|
|
3574
|
+
z22.discriminatedUnion("type", [
|
|
3575
|
+
z22.object({ type: z22.literal("logs"), logs: z22.string() }),
|
|
3576
|
+
z22.object({ type: z22.literal("image"), url: z22.string() })
|
|
3490
3577
|
])
|
|
3491
3578
|
).nullable(),
|
|
3492
|
-
status:
|
|
3579
|
+
status: z22.string()
|
|
3493
3580
|
}),
|
|
3494
|
-
|
|
3495
|
-
type:
|
|
3496
|
-
id:
|
|
3497
|
-
status:
|
|
3498
|
-
approval_request_id:
|
|
3581
|
+
z22.object({
|
|
3582
|
+
type: z22.literal("mcp_call"),
|
|
3583
|
+
id: z22.string(),
|
|
3584
|
+
status: z22.string(),
|
|
3585
|
+
approval_request_id: z22.string().nullish()
|
|
3499
3586
|
}),
|
|
3500
|
-
|
|
3501
|
-
type:
|
|
3502
|
-
id:
|
|
3587
|
+
z22.object({
|
|
3588
|
+
type: z22.literal("mcp_list_tools"),
|
|
3589
|
+
id: z22.string()
|
|
3503
3590
|
}),
|
|
3504
|
-
|
|
3505
|
-
type:
|
|
3506
|
-
id:
|
|
3591
|
+
z22.object({
|
|
3592
|
+
type: z22.literal("mcp_approval_request"),
|
|
3593
|
+
id: z22.string()
|
|
3507
3594
|
}),
|
|
3508
|
-
|
|
3509
|
-
type:
|
|
3510
|
-
id:
|
|
3511
|
-
call_id:
|
|
3512
|
-
status:
|
|
3513
|
-
operation:
|
|
3514
|
-
|
|
3515
|
-
type:
|
|
3516
|
-
path:
|
|
3517
|
-
diff:
|
|
3595
|
+
z22.object({
|
|
3596
|
+
type: z22.literal("apply_patch_call"),
|
|
3597
|
+
id: z22.string(),
|
|
3598
|
+
call_id: z22.string(),
|
|
3599
|
+
status: z22.enum(["in_progress", "completed"]),
|
|
3600
|
+
operation: z22.discriminatedUnion("type", [
|
|
3601
|
+
z22.object({
|
|
3602
|
+
type: z22.literal("create_file"),
|
|
3603
|
+
path: z22.string(),
|
|
3604
|
+
diff: z22.string()
|
|
3518
3605
|
}),
|
|
3519
|
-
|
|
3520
|
-
type:
|
|
3521
|
-
path:
|
|
3606
|
+
z22.object({
|
|
3607
|
+
type: z22.literal("delete_file"),
|
|
3608
|
+
path: z22.string()
|
|
3522
3609
|
}),
|
|
3523
|
-
|
|
3524
|
-
type:
|
|
3525
|
-
path:
|
|
3526
|
-
diff:
|
|
3610
|
+
z22.object({
|
|
3611
|
+
type: z22.literal("update_file"),
|
|
3612
|
+
path: z22.string(),
|
|
3613
|
+
diff: z22.string()
|
|
3527
3614
|
})
|
|
3528
3615
|
])
|
|
3529
3616
|
}),
|
|
3530
|
-
|
|
3531
|
-
type:
|
|
3532
|
-
id:
|
|
3533
|
-
call_id:
|
|
3534
|
-
name:
|
|
3535
|
-
input:
|
|
3617
|
+
z22.object({
|
|
3618
|
+
type: z22.literal("custom_tool_call"),
|
|
3619
|
+
id: z22.string(),
|
|
3620
|
+
call_id: z22.string(),
|
|
3621
|
+
name: z22.string(),
|
|
3622
|
+
input: z22.string()
|
|
3536
3623
|
}),
|
|
3537
|
-
|
|
3538
|
-
type:
|
|
3539
|
-
id:
|
|
3540
|
-
call_id:
|
|
3541
|
-
status:
|
|
3542
|
-
action:
|
|
3543
|
-
commands:
|
|
3624
|
+
z22.object({
|
|
3625
|
+
type: z22.literal("shell_call"),
|
|
3626
|
+
id: z22.string(),
|
|
3627
|
+
call_id: z22.string(),
|
|
3628
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3629
|
+
action: z22.object({
|
|
3630
|
+
commands: z22.array(z22.string())
|
|
3544
3631
|
})
|
|
3545
3632
|
}),
|
|
3546
|
-
|
|
3547
|
-
type:
|
|
3548
|
-
id:
|
|
3549
|
-
call_id:
|
|
3550
|
-
status:
|
|
3551
|
-
output:
|
|
3552
|
-
|
|
3553
|
-
stdout:
|
|
3554
|
-
stderr:
|
|
3555
|
-
outcome:
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
type:
|
|
3559
|
-
exit_code:
|
|
3633
|
+
z22.object({
|
|
3634
|
+
type: z22.literal("shell_call_output"),
|
|
3635
|
+
id: z22.string(),
|
|
3636
|
+
call_id: z22.string(),
|
|
3637
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3638
|
+
output: z22.array(
|
|
3639
|
+
z22.object({
|
|
3640
|
+
stdout: z22.string(),
|
|
3641
|
+
stderr: z22.string(),
|
|
3642
|
+
outcome: z22.discriminatedUnion("type", [
|
|
3643
|
+
z22.object({ type: z22.literal("timeout") }),
|
|
3644
|
+
z22.object({
|
|
3645
|
+
type: z22.literal("exit"),
|
|
3646
|
+
exit_code: z22.number()
|
|
3560
3647
|
})
|
|
3561
3648
|
])
|
|
3562
3649
|
})
|
|
3563
3650
|
)
|
|
3564
3651
|
}),
|
|
3565
|
-
|
|
3566
|
-
type:
|
|
3567
|
-
id:
|
|
3568
|
-
execution:
|
|
3569
|
-
call_id:
|
|
3570
|
-
status:
|
|
3571
|
-
arguments:
|
|
3652
|
+
z22.object({
|
|
3653
|
+
type: z22.literal("tool_search_call"),
|
|
3654
|
+
id: z22.string(),
|
|
3655
|
+
execution: z22.enum(["server", "client"]),
|
|
3656
|
+
call_id: z22.string().nullable(),
|
|
3657
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3658
|
+
arguments: z22.unknown()
|
|
3572
3659
|
}),
|
|
3573
|
-
|
|
3574
|
-
type:
|
|
3575
|
-
id:
|
|
3576
|
-
execution:
|
|
3577
|
-
call_id:
|
|
3578
|
-
status:
|
|
3579
|
-
tools:
|
|
3660
|
+
z22.object({
|
|
3661
|
+
type: z22.literal("tool_search_output"),
|
|
3662
|
+
id: z22.string(),
|
|
3663
|
+
execution: z22.enum(["server", "client"]),
|
|
3664
|
+
call_id: z22.string().nullable(),
|
|
3665
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3666
|
+
tools: z22.array(z22.record(z22.string(), jsonValueSchema2.optional()))
|
|
3580
3667
|
})
|
|
3581
3668
|
])
|
|
3582
3669
|
}),
|
|
3583
|
-
|
|
3584
|
-
type:
|
|
3585
|
-
output_index:
|
|
3586
|
-
item:
|
|
3587
|
-
|
|
3588
|
-
type:
|
|
3589
|
-
id:
|
|
3590
|
-
phase:
|
|
3670
|
+
z22.object({
|
|
3671
|
+
type: z22.literal("response.output_item.done"),
|
|
3672
|
+
output_index: z22.number(),
|
|
3673
|
+
item: z22.discriminatedUnion("type", [
|
|
3674
|
+
z22.object({
|
|
3675
|
+
type: z22.literal("message"),
|
|
3676
|
+
id: z22.string(),
|
|
3677
|
+
phase: z22.enum(["commentary", "final_answer"]).nullish()
|
|
3591
3678
|
}),
|
|
3592
|
-
|
|
3593
|
-
type:
|
|
3594
|
-
id:
|
|
3595
|
-
encrypted_content:
|
|
3679
|
+
z22.object({
|
|
3680
|
+
type: z22.literal("reasoning"),
|
|
3681
|
+
id: z22.string(),
|
|
3682
|
+
encrypted_content: z22.string().nullish()
|
|
3596
3683
|
}),
|
|
3597
|
-
|
|
3598
|
-
type:
|
|
3599
|
-
id:
|
|
3600
|
-
call_id:
|
|
3601
|
-
name:
|
|
3602
|
-
arguments:
|
|
3603
|
-
status:
|
|
3684
|
+
z22.object({
|
|
3685
|
+
type: z22.literal("function_call"),
|
|
3686
|
+
id: z22.string(),
|
|
3687
|
+
call_id: z22.string(),
|
|
3688
|
+
name: z22.string(),
|
|
3689
|
+
arguments: z22.string(),
|
|
3690
|
+
status: z22.literal("completed"),
|
|
3691
|
+
namespace: z22.string().nullish()
|
|
3604
3692
|
}),
|
|
3605
|
-
|
|
3606
|
-
type:
|
|
3607
|
-
id:
|
|
3608
|
-
call_id:
|
|
3609
|
-
name:
|
|
3610
|
-
input:
|
|
3611
|
-
status:
|
|
3693
|
+
z22.object({
|
|
3694
|
+
type: z22.literal("custom_tool_call"),
|
|
3695
|
+
id: z22.string(),
|
|
3696
|
+
call_id: z22.string(),
|
|
3697
|
+
name: z22.string(),
|
|
3698
|
+
input: z22.string(),
|
|
3699
|
+
status: z22.literal("completed")
|
|
3612
3700
|
}),
|
|
3613
|
-
|
|
3614
|
-
type:
|
|
3615
|
-
id:
|
|
3616
|
-
code:
|
|
3617
|
-
container_id:
|
|
3618
|
-
outputs:
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3701
|
+
z22.object({
|
|
3702
|
+
type: z22.literal("code_interpreter_call"),
|
|
3703
|
+
id: z22.string(),
|
|
3704
|
+
code: z22.string().nullable(),
|
|
3705
|
+
container_id: z22.string(),
|
|
3706
|
+
outputs: z22.array(
|
|
3707
|
+
z22.discriminatedUnion("type", [
|
|
3708
|
+
z22.object({ type: z22.literal("logs"), logs: z22.string() }),
|
|
3709
|
+
z22.object({ type: z22.literal("image"), url: z22.string() })
|
|
3622
3710
|
])
|
|
3623
3711
|
).nullable()
|
|
3624
3712
|
}),
|
|
3625
|
-
|
|
3626
|
-
type:
|
|
3627
|
-
id:
|
|
3628
|
-
result:
|
|
3713
|
+
z22.object({
|
|
3714
|
+
type: z22.literal("image_generation_call"),
|
|
3715
|
+
id: z22.string(),
|
|
3716
|
+
result: z22.string()
|
|
3629
3717
|
}),
|
|
3630
|
-
|
|
3631
|
-
type:
|
|
3632
|
-
id:
|
|
3633
|
-
status:
|
|
3634
|
-
action:
|
|
3635
|
-
|
|
3636
|
-
type:
|
|
3637
|
-
query:
|
|
3638
|
-
sources:
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3718
|
+
z22.object({
|
|
3719
|
+
type: z22.literal("web_search_call"),
|
|
3720
|
+
id: z22.string(),
|
|
3721
|
+
status: z22.string(),
|
|
3722
|
+
action: z22.discriminatedUnion("type", [
|
|
3723
|
+
z22.object({
|
|
3724
|
+
type: z22.literal("search"),
|
|
3725
|
+
query: z22.string().nullish(),
|
|
3726
|
+
sources: z22.array(
|
|
3727
|
+
z22.discriminatedUnion("type", [
|
|
3728
|
+
z22.object({ type: z22.literal("url"), url: z22.string() }),
|
|
3729
|
+
z22.object({ type: z22.literal("api"), name: z22.string() })
|
|
3642
3730
|
])
|
|
3643
3731
|
).nullish()
|
|
3644
3732
|
}),
|
|
3645
|
-
|
|
3646
|
-
type:
|
|
3647
|
-
url:
|
|
3733
|
+
z22.object({
|
|
3734
|
+
type: z22.literal("open_page"),
|
|
3735
|
+
url: z22.string().nullish()
|
|
3648
3736
|
}),
|
|
3649
|
-
|
|
3650
|
-
type:
|
|
3651
|
-
url:
|
|
3652
|
-
pattern:
|
|
3737
|
+
z22.object({
|
|
3738
|
+
type: z22.literal("find_in_page"),
|
|
3739
|
+
url: z22.string().nullish(),
|
|
3740
|
+
pattern: z22.string().nullish()
|
|
3653
3741
|
})
|
|
3654
3742
|
]).nullish()
|
|
3655
3743
|
}),
|
|
3656
|
-
|
|
3657
|
-
type:
|
|
3658
|
-
id:
|
|
3659
|
-
queries:
|
|
3660
|
-
results:
|
|
3661
|
-
|
|
3662
|
-
attributes:
|
|
3663
|
-
|
|
3664
|
-
|
|
3744
|
+
z22.object({
|
|
3745
|
+
type: z22.literal("file_search_call"),
|
|
3746
|
+
id: z22.string(),
|
|
3747
|
+
queries: z22.array(z22.string()),
|
|
3748
|
+
results: z22.array(
|
|
3749
|
+
z22.object({
|
|
3750
|
+
attributes: z22.record(
|
|
3751
|
+
z22.string(),
|
|
3752
|
+
z22.union([z22.string(), z22.number(), z22.boolean()])
|
|
3665
3753
|
),
|
|
3666
|
-
file_id:
|
|
3667
|
-
filename:
|
|
3668
|
-
score:
|
|
3669
|
-
text:
|
|
3754
|
+
file_id: z22.string(),
|
|
3755
|
+
filename: z22.string(),
|
|
3756
|
+
score: z22.number(),
|
|
3757
|
+
text: z22.string()
|
|
3670
3758
|
})
|
|
3671
3759
|
).nullish()
|
|
3672
3760
|
}),
|
|
3673
|
-
|
|
3674
|
-
type:
|
|
3675
|
-
id:
|
|
3676
|
-
call_id:
|
|
3677
|
-
action:
|
|
3678
|
-
type:
|
|
3679
|
-
command:
|
|
3680
|
-
timeout_ms:
|
|
3681
|
-
user:
|
|
3682
|
-
working_directory:
|
|
3683
|
-
env:
|
|
3761
|
+
z22.object({
|
|
3762
|
+
type: z22.literal("local_shell_call"),
|
|
3763
|
+
id: z22.string(),
|
|
3764
|
+
call_id: z22.string(),
|
|
3765
|
+
action: z22.object({
|
|
3766
|
+
type: z22.literal("exec"),
|
|
3767
|
+
command: z22.array(z22.string()),
|
|
3768
|
+
timeout_ms: z22.number().optional(),
|
|
3769
|
+
user: z22.string().optional(),
|
|
3770
|
+
working_directory: z22.string().optional(),
|
|
3771
|
+
env: z22.record(z22.string(), z22.string()).optional()
|
|
3684
3772
|
})
|
|
3685
3773
|
}),
|
|
3686
|
-
|
|
3687
|
-
type:
|
|
3688
|
-
id:
|
|
3689
|
-
status:
|
|
3774
|
+
z22.object({
|
|
3775
|
+
type: z22.literal("computer_call"),
|
|
3776
|
+
id: z22.string(),
|
|
3777
|
+
status: z22.literal("completed")
|
|
3690
3778
|
}),
|
|
3691
|
-
|
|
3692
|
-
type:
|
|
3693
|
-
id:
|
|
3694
|
-
status:
|
|
3695
|
-
arguments:
|
|
3696
|
-
name:
|
|
3697
|
-
server_label:
|
|
3698
|
-
output:
|
|
3699
|
-
error:
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
type:
|
|
3703
|
-
code:
|
|
3704
|
-
message:
|
|
3779
|
+
z22.object({
|
|
3780
|
+
type: z22.literal("mcp_call"),
|
|
3781
|
+
id: z22.string(),
|
|
3782
|
+
status: z22.string(),
|
|
3783
|
+
arguments: z22.string(),
|
|
3784
|
+
name: z22.string(),
|
|
3785
|
+
server_label: z22.string(),
|
|
3786
|
+
output: z22.string().nullish(),
|
|
3787
|
+
error: z22.union([
|
|
3788
|
+
z22.string(),
|
|
3789
|
+
z22.object({
|
|
3790
|
+
type: z22.string().optional(),
|
|
3791
|
+
code: z22.union([z22.number(), z22.string()]).optional(),
|
|
3792
|
+
message: z22.string().optional()
|
|
3705
3793
|
}).loose()
|
|
3706
3794
|
]).nullish(),
|
|
3707
|
-
approval_request_id:
|
|
3795
|
+
approval_request_id: z22.string().nullish()
|
|
3708
3796
|
}),
|
|
3709
|
-
|
|
3710
|
-
type:
|
|
3711
|
-
id:
|
|
3712
|
-
server_label:
|
|
3713
|
-
tools:
|
|
3714
|
-
|
|
3715
|
-
name:
|
|
3716
|
-
description:
|
|
3717
|
-
input_schema:
|
|
3718
|
-
annotations:
|
|
3797
|
+
z22.object({
|
|
3798
|
+
type: z22.literal("mcp_list_tools"),
|
|
3799
|
+
id: z22.string(),
|
|
3800
|
+
server_label: z22.string(),
|
|
3801
|
+
tools: z22.array(
|
|
3802
|
+
z22.object({
|
|
3803
|
+
name: z22.string(),
|
|
3804
|
+
description: z22.string().optional(),
|
|
3805
|
+
input_schema: z22.any(),
|
|
3806
|
+
annotations: z22.record(z22.string(), z22.unknown()).optional()
|
|
3719
3807
|
})
|
|
3720
3808
|
),
|
|
3721
|
-
error:
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
type:
|
|
3725
|
-
code:
|
|
3726
|
-
message:
|
|
3809
|
+
error: z22.union([
|
|
3810
|
+
z22.string(),
|
|
3811
|
+
z22.object({
|
|
3812
|
+
type: z22.string().optional(),
|
|
3813
|
+
code: z22.union([z22.number(), z22.string()]).optional(),
|
|
3814
|
+
message: z22.string().optional()
|
|
3727
3815
|
}).loose()
|
|
3728
3816
|
]).optional()
|
|
3729
3817
|
}),
|
|
3730
|
-
|
|
3731
|
-
type:
|
|
3732
|
-
id:
|
|
3733
|
-
server_label:
|
|
3734
|
-
name:
|
|
3735
|
-
arguments:
|
|
3736
|
-
approval_request_id:
|
|
3818
|
+
z22.object({
|
|
3819
|
+
type: z22.literal("mcp_approval_request"),
|
|
3820
|
+
id: z22.string(),
|
|
3821
|
+
server_label: z22.string(),
|
|
3822
|
+
name: z22.string(),
|
|
3823
|
+
arguments: z22.string(),
|
|
3824
|
+
approval_request_id: z22.string().optional()
|
|
3737
3825
|
}),
|
|
3738
|
-
|
|
3739
|
-
type:
|
|
3740
|
-
id:
|
|
3741
|
-
call_id:
|
|
3742
|
-
status:
|
|
3743
|
-
operation:
|
|
3744
|
-
|
|
3745
|
-
type:
|
|
3746
|
-
path:
|
|
3747
|
-
diff:
|
|
3826
|
+
z22.object({
|
|
3827
|
+
type: z22.literal("apply_patch_call"),
|
|
3828
|
+
id: z22.string(),
|
|
3829
|
+
call_id: z22.string(),
|
|
3830
|
+
status: z22.enum(["in_progress", "completed"]),
|
|
3831
|
+
operation: z22.discriminatedUnion("type", [
|
|
3832
|
+
z22.object({
|
|
3833
|
+
type: z22.literal("create_file"),
|
|
3834
|
+
path: z22.string(),
|
|
3835
|
+
diff: z22.string()
|
|
3748
3836
|
}),
|
|
3749
|
-
|
|
3750
|
-
type:
|
|
3751
|
-
path:
|
|
3837
|
+
z22.object({
|
|
3838
|
+
type: z22.literal("delete_file"),
|
|
3839
|
+
path: z22.string()
|
|
3752
3840
|
}),
|
|
3753
|
-
|
|
3754
|
-
type:
|
|
3755
|
-
path:
|
|
3756
|
-
diff:
|
|
3841
|
+
z22.object({
|
|
3842
|
+
type: z22.literal("update_file"),
|
|
3843
|
+
path: z22.string(),
|
|
3844
|
+
diff: z22.string()
|
|
3757
3845
|
})
|
|
3758
3846
|
])
|
|
3759
3847
|
}),
|
|
3760
|
-
|
|
3761
|
-
type:
|
|
3762
|
-
id:
|
|
3763
|
-
call_id:
|
|
3764
|
-
status:
|
|
3765
|
-
action:
|
|
3766
|
-
commands:
|
|
3848
|
+
z22.object({
|
|
3849
|
+
type: z22.literal("shell_call"),
|
|
3850
|
+
id: z22.string(),
|
|
3851
|
+
call_id: z22.string(),
|
|
3852
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3853
|
+
action: z22.object({
|
|
3854
|
+
commands: z22.array(z22.string())
|
|
3767
3855
|
})
|
|
3768
3856
|
}),
|
|
3769
|
-
|
|
3770
|
-
type:
|
|
3771
|
-
id:
|
|
3772
|
-
call_id:
|
|
3773
|
-
status:
|
|
3774
|
-
output:
|
|
3775
|
-
|
|
3776
|
-
stdout:
|
|
3777
|
-
stderr:
|
|
3778
|
-
outcome:
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
type:
|
|
3782
|
-
exit_code:
|
|
3857
|
+
z22.object({
|
|
3858
|
+
type: z22.literal("shell_call_output"),
|
|
3859
|
+
id: z22.string(),
|
|
3860
|
+
call_id: z22.string(),
|
|
3861
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3862
|
+
output: z22.array(
|
|
3863
|
+
z22.object({
|
|
3864
|
+
stdout: z22.string(),
|
|
3865
|
+
stderr: z22.string(),
|
|
3866
|
+
outcome: z22.discriminatedUnion("type", [
|
|
3867
|
+
z22.object({ type: z22.literal("timeout") }),
|
|
3868
|
+
z22.object({
|
|
3869
|
+
type: z22.literal("exit"),
|
|
3870
|
+
exit_code: z22.number()
|
|
3783
3871
|
})
|
|
3784
3872
|
])
|
|
3785
3873
|
})
|
|
3786
3874
|
)
|
|
3787
3875
|
}),
|
|
3788
|
-
|
|
3789
|
-
type:
|
|
3790
|
-
id:
|
|
3791
|
-
execution:
|
|
3792
|
-
call_id:
|
|
3793
|
-
status:
|
|
3794
|
-
arguments:
|
|
3876
|
+
z22.object({
|
|
3877
|
+
type: z22.literal("tool_search_call"),
|
|
3878
|
+
id: z22.string(),
|
|
3879
|
+
execution: z22.enum(["server", "client"]),
|
|
3880
|
+
call_id: z22.string().nullable(),
|
|
3881
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3882
|
+
arguments: z22.unknown()
|
|
3795
3883
|
}),
|
|
3796
|
-
|
|
3797
|
-
type:
|
|
3798
|
-
id:
|
|
3799
|
-
execution:
|
|
3800
|
-
call_id:
|
|
3801
|
-
status:
|
|
3802
|
-
tools:
|
|
3884
|
+
z22.object({
|
|
3885
|
+
type: z22.literal("tool_search_output"),
|
|
3886
|
+
id: z22.string(),
|
|
3887
|
+
execution: z22.enum(["server", "client"]),
|
|
3888
|
+
call_id: z22.string().nullable(),
|
|
3889
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3890
|
+
tools: z22.array(z22.record(z22.string(), jsonValueSchema2.optional()))
|
|
3803
3891
|
})
|
|
3804
3892
|
])
|
|
3805
3893
|
}),
|
|
3806
|
-
|
|
3807
|
-
type:
|
|
3808
|
-
item_id:
|
|
3809
|
-
output_index:
|
|
3810
|
-
delta:
|
|
3894
|
+
z22.object({
|
|
3895
|
+
type: z22.literal("response.function_call_arguments.delta"),
|
|
3896
|
+
item_id: z22.string(),
|
|
3897
|
+
output_index: z22.number(),
|
|
3898
|
+
delta: z22.string()
|
|
3811
3899
|
}),
|
|
3812
|
-
|
|
3813
|
-
type:
|
|
3814
|
-
item_id:
|
|
3815
|
-
output_index:
|
|
3816
|
-
delta:
|
|
3900
|
+
z22.object({
|
|
3901
|
+
type: z22.literal("response.custom_tool_call_input.delta"),
|
|
3902
|
+
item_id: z22.string(),
|
|
3903
|
+
output_index: z22.number(),
|
|
3904
|
+
delta: z22.string()
|
|
3817
3905
|
}),
|
|
3818
|
-
|
|
3819
|
-
type:
|
|
3820
|
-
item_id:
|
|
3821
|
-
output_index:
|
|
3822
|
-
partial_image_b64:
|
|
3906
|
+
z22.object({
|
|
3907
|
+
type: z22.literal("response.image_generation_call.partial_image"),
|
|
3908
|
+
item_id: z22.string(),
|
|
3909
|
+
output_index: z22.number(),
|
|
3910
|
+
partial_image_b64: z22.string()
|
|
3823
3911
|
}),
|
|
3824
|
-
|
|
3825
|
-
type:
|
|
3826
|
-
item_id:
|
|
3827
|
-
output_index:
|
|
3828
|
-
delta:
|
|
3912
|
+
z22.object({
|
|
3913
|
+
type: z22.literal("response.code_interpreter_call_code.delta"),
|
|
3914
|
+
item_id: z22.string(),
|
|
3915
|
+
output_index: z22.number(),
|
|
3916
|
+
delta: z22.string()
|
|
3829
3917
|
}),
|
|
3830
|
-
|
|
3831
|
-
type:
|
|
3832
|
-
item_id:
|
|
3833
|
-
output_index:
|
|
3834
|
-
code:
|
|
3918
|
+
z22.object({
|
|
3919
|
+
type: z22.literal("response.code_interpreter_call_code.done"),
|
|
3920
|
+
item_id: z22.string(),
|
|
3921
|
+
output_index: z22.number(),
|
|
3922
|
+
code: z22.string()
|
|
3835
3923
|
}),
|
|
3836
|
-
|
|
3837
|
-
type:
|
|
3838
|
-
annotation:
|
|
3839
|
-
|
|
3840
|
-
type:
|
|
3841
|
-
start_index:
|
|
3842
|
-
end_index:
|
|
3843
|
-
url:
|
|
3844
|
-
title:
|
|
3924
|
+
z22.object({
|
|
3925
|
+
type: z22.literal("response.output_text.annotation.added"),
|
|
3926
|
+
annotation: z22.discriminatedUnion("type", [
|
|
3927
|
+
z22.object({
|
|
3928
|
+
type: z22.literal("url_citation"),
|
|
3929
|
+
start_index: z22.number(),
|
|
3930
|
+
end_index: z22.number(),
|
|
3931
|
+
url: z22.string(),
|
|
3932
|
+
title: z22.string()
|
|
3845
3933
|
}),
|
|
3846
|
-
|
|
3847
|
-
type:
|
|
3848
|
-
file_id:
|
|
3849
|
-
filename:
|
|
3850
|
-
index:
|
|
3934
|
+
z22.object({
|
|
3935
|
+
type: z22.literal("file_citation"),
|
|
3936
|
+
file_id: z22.string(),
|
|
3937
|
+
filename: z22.string(),
|
|
3938
|
+
index: z22.number()
|
|
3851
3939
|
}),
|
|
3852
|
-
|
|
3853
|
-
type:
|
|
3854
|
-
container_id:
|
|
3855
|
-
file_id:
|
|
3856
|
-
filename:
|
|
3857
|
-
start_index:
|
|
3858
|
-
end_index:
|
|
3940
|
+
z22.object({
|
|
3941
|
+
type: z22.literal("container_file_citation"),
|
|
3942
|
+
container_id: z22.string(),
|
|
3943
|
+
file_id: z22.string(),
|
|
3944
|
+
filename: z22.string(),
|
|
3945
|
+
start_index: z22.number(),
|
|
3946
|
+
end_index: z22.number()
|
|
3859
3947
|
}),
|
|
3860
|
-
|
|
3861
|
-
type:
|
|
3862
|
-
file_id:
|
|
3863
|
-
index:
|
|
3948
|
+
z22.object({
|
|
3949
|
+
type: z22.literal("file_path"),
|
|
3950
|
+
file_id: z22.string(),
|
|
3951
|
+
index: z22.number()
|
|
3864
3952
|
})
|
|
3865
3953
|
])
|
|
3866
3954
|
}),
|
|
3867
|
-
|
|
3868
|
-
type:
|
|
3869
|
-
item_id:
|
|
3870
|
-
summary_index:
|
|
3955
|
+
z22.object({
|
|
3956
|
+
type: z22.literal("response.reasoning_summary_part.added"),
|
|
3957
|
+
item_id: z22.string(),
|
|
3958
|
+
summary_index: z22.number()
|
|
3871
3959
|
}),
|
|
3872
|
-
|
|
3873
|
-
type:
|
|
3874
|
-
item_id:
|
|
3875
|
-
summary_index:
|
|
3876
|
-
delta:
|
|
3960
|
+
z22.object({
|
|
3961
|
+
type: z22.literal("response.reasoning_summary_text.delta"),
|
|
3962
|
+
item_id: z22.string(),
|
|
3963
|
+
summary_index: z22.number(),
|
|
3964
|
+
delta: z22.string()
|
|
3877
3965
|
}),
|
|
3878
|
-
|
|
3879
|
-
type:
|
|
3880
|
-
item_id:
|
|
3881
|
-
summary_index:
|
|
3966
|
+
z22.object({
|
|
3967
|
+
type: z22.literal("response.reasoning_summary_part.done"),
|
|
3968
|
+
item_id: z22.string(),
|
|
3969
|
+
summary_index: z22.number()
|
|
3882
3970
|
}),
|
|
3883
|
-
|
|
3884
|
-
type:
|
|
3885
|
-
item_id:
|
|
3886
|
-
output_index:
|
|
3887
|
-
delta:
|
|
3888
|
-
obfuscation:
|
|
3971
|
+
z22.object({
|
|
3972
|
+
type: z22.literal("response.apply_patch_call_operation_diff.delta"),
|
|
3973
|
+
item_id: z22.string(),
|
|
3974
|
+
output_index: z22.number(),
|
|
3975
|
+
delta: z22.string(),
|
|
3976
|
+
obfuscation: z22.string().nullish()
|
|
3889
3977
|
}),
|
|
3890
|
-
|
|
3891
|
-
type:
|
|
3892
|
-
item_id:
|
|
3893
|
-
output_index:
|
|
3894
|
-
diff:
|
|
3978
|
+
z22.object({
|
|
3979
|
+
type: z22.literal("response.apply_patch_call_operation_diff.done"),
|
|
3980
|
+
item_id: z22.string(),
|
|
3981
|
+
output_index: z22.number(),
|
|
3982
|
+
diff: z22.string()
|
|
3895
3983
|
}),
|
|
3896
|
-
|
|
3897
|
-
type:
|
|
3898
|
-
sequence_number:
|
|
3899
|
-
error:
|
|
3900
|
-
type:
|
|
3901
|
-
code:
|
|
3902
|
-
message:
|
|
3903
|
-
param:
|
|
3984
|
+
z22.object({
|
|
3985
|
+
type: z22.literal("error"),
|
|
3986
|
+
sequence_number: z22.number(),
|
|
3987
|
+
error: z22.object({
|
|
3988
|
+
type: z22.string(),
|
|
3989
|
+
code: z22.string(),
|
|
3990
|
+
message: z22.string(),
|
|
3991
|
+
param: z22.string().nullish()
|
|
3904
3992
|
})
|
|
3905
3993
|
}),
|
|
3906
|
-
|
|
3994
|
+
z22.object({ type: z22.string() }).loose().transform((value) => ({
|
|
3907
3995
|
type: "unknown_chunk",
|
|
3908
3996
|
message: value.type
|
|
3909
3997
|
}))
|
|
@@ -3911,302 +3999,303 @@ var openaiResponsesChunkSchema = lazySchema19(
|
|
|
3911
3999
|
])
|
|
3912
4000
|
)
|
|
3913
4001
|
);
|
|
3914
|
-
var openaiResponsesResponseSchema =
|
|
3915
|
-
() =>
|
|
3916
|
-
|
|
3917
|
-
id:
|
|
3918
|
-
created_at:
|
|
3919
|
-
error:
|
|
3920
|
-
message:
|
|
3921
|
-
type:
|
|
3922
|
-
param:
|
|
3923
|
-
code:
|
|
4002
|
+
var openaiResponsesResponseSchema = lazySchema20(
|
|
4003
|
+
() => zodSchema20(
|
|
4004
|
+
z22.object({
|
|
4005
|
+
id: z22.string().optional(),
|
|
4006
|
+
created_at: z22.number().optional(),
|
|
4007
|
+
error: z22.object({
|
|
4008
|
+
message: z22.string(),
|
|
4009
|
+
type: z22.string(),
|
|
4010
|
+
param: z22.string().nullish(),
|
|
4011
|
+
code: z22.string()
|
|
3924
4012
|
}).nullish(),
|
|
3925
|
-
model:
|
|
3926
|
-
output:
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
type:
|
|
3930
|
-
role:
|
|
3931
|
-
id:
|
|
3932
|
-
phase:
|
|
3933
|
-
content:
|
|
3934
|
-
|
|
3935
|
-
type:
|
|
3936
|
-
text:
|
|
3937
|
-
logprobs:
|
|
3938
|
-
|
|
3939
|
-
token:
|
|
3940
|
-
logprob:
|
|
3941
|
-
top_logprobs:
|
|
3942
|
-
|
|
3943
|
-
token:
|
|
3944
|
-
logprob:
|
|
4013
|
+
model: z22.string().optional(),
|
|
4014
|
+
output: z22.array(
|
|
4015
|
+
z22.discriminatedUnion("type", [
|
|
4016
|
+
z22.object({
|
|
4017
|
+
type: z22.literal("message"),
|
|
4018
|
+
role: z22.literal("assistant"),
|
|
4019
|
+
id: z22.string(),
|
|
4020
|
+
phase: z22.enum(["commentary", "final_answer"]).nullish(),
|
|
4021
|
+
content: z22.array(
|
|
4022
|
+
z22.object({
|
|
4023
|
+
type: z22.literal("output_text"),
|
|
4024
|
+
text: z22.string(),
|
|
4025
|
+
logprobs: z22.array(
|
|
4026
|
+
z22.object({
|
|
4027
|
+
token: z22.string(),
|
|
4028
|
+
logprob: z22.number(),
|
|
4029
|
+
top_logprobs: z22.array(
|
|
4030
|
+
z22.object({
|
|
4031
|
+
token: z22.string(),
|
|
4032
|
+
logprob: z22.number()
|
|
3945
4033
|
})
|
|
3946
4034
|
)
|
|
3947
4035
|
})
|
|
3948
4036
|
).nullish(),
|
|
3949
|
-
annotations:
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
type:
|
|
3953
|
-
start_index:
|
|
3954
|
-
end_index:
|
|
3955
|
-
url:
|
|
3956
|
-
title:
|
|
4037
|
+
annotations: z22.array(
|
|
4038
|
+
z22.discriminatedUnion("type", [
|
|
4039
|
+
z22.object({
|
|
4040
|
+
type: z22.literal("url_citation"),
|
|
4041
|
+
start_index: z22.number(),
|
|
4042
|
+
end_index: z22.number(),
|
|
4043
|
+
url: z22.string(),
|
|
4044
|
+
title: z22.string()
|
|
3957
4045
|
}),
|
|
3958
|
-
|
|
3959
|
-
type:
|
|
3960
|
-
file_id:
|
|
3961
|
-
filename:
|
|
3962
|
-
index:
|
|
4046
|
+
z22.object({
|
|
4047
|
+
type: z22.literal("file_citation"),
|
|
4048
|
+
file_id: z22.string(),
|
|
4049
|
+
filename: z22.string(),
|
|
4050
|
+
index: z22.number()
|
|
3963
4051
|
}),
|
|
3964
|
-
|
|
3965
|
-
type:
|
|
3966
|
-
container_id:
|
|
3967
|
-
file_id:
|
|
3968
|
-
filename:
|
|
3969
|
-
start_index:
|
|
3970
|
-
end_index:
|
|
4052
|
+
z22.object({
|
|
4053
|
+
type: z22.literal("container_file_citation"),
|
|
4054
|
+
container_id: z22.string(),
|
|
4055
|
+
file_id: z22.string(),
|
|
4056
|
+
filename: z22.string(),
|
|
4057
|
+
start_index: z22.number(),
|
|
4058
|
+
end_index: z22.number()
|
|
3971
4059
|
}),
|
|
3972
|
-
|
|
3973
|
-
type:
|
|
3974
|
-
file_id:
|
|
3975
|
-
index:
|
|
4060
|
+
z22.object({
|
|
4061
|
+
type: z22.literal("file_path"),
|
|
4062
|
+
file_id: z22.string(),
|
|
4063
|
+
index: z22.number()
|
|
3976
4064
|
})
|
|
3977
4065
|
])
|
|
3978
4066
|
)
|
|
3979
4067
|
})
|
|
3980
4068
|
)
|
|
3981
4069
|
}),
|
|
3982
|
-
|
|
3983
|
-
type:
|
|
3984
|
-
id:
|
|
3985
|
-
status:
|
|
3986
|
-
action:
|
|
3987
|
-
|
|
3988
|
-
type:
|
|
3989
|
-
query:
|
|
3990
|
-
sources:
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
type:
|
|
3995
|
-
name:
|
|
4070
|
+
z22.object({
|
|
4071
|
+
type: z22.literal("web_search_call"),
|
|
4072
|
+
id: z22.string(),
|
|
4073
|
+
status: z22.string(),
|
|
4074
|
+
action: z22.discriminatedUnion("type", [
|
|
4075
|
+
z22.object({
|
|
4076
|
+
type: z22.literal("search"),
|
|
4077
|
+
query: z22.string().nullish(),
|
|
4078
|
+
sources: z22.array(
|
|
4079
|
+
z22.discriminatedUnion("type", [
|
|
4080
|
+
z22.object({ type: z22.literal("url"), url: z22.string() }),
|
|
4081
|
+
z22.object({
|
|
4082
|
+
type: z22.literal("api"),
|
|
4083
|
+
name: z22.string()
|
|
3996
4084
|
})
|
|
3997
4085
|
])
|
|
3998
4086
|
).nullish()
|
|
3999
4087
|
}),
|
|
4000
|
-
|
|
4001
|
-
type:
|
|
4002
|
-
url:
|
|
4088
|
+
z22.object({
|
|
4089
|
+
type: z22.literal("open_page"),
|
|
4090
|
+
url: z22.string().nullish()
|
|
4003
4091
|
}),
|
|
4004
|
-
|
|
4005
|
-
type:
|
|
4006
|
-
url:
|
|
4007
|
-
pattern:
|
|
4092
|
+
z22.object({
|
|
4093
|
+
type: z22.literal("find_in_page"),
|
|
4094
|
+
url: z22.string().nullish(),
|
|
4095
|
+
pattern: z22.string().nullish()
|
|
4008
4096
|
})
|
|
4009
4097
|
]).nullish()
|
|
4010
4098
|
}),
|
|
4011
|
-
|
|
4012
|
-
type:
|
|
4013
|
-
id:
|
|
4014
|
-
queries:
|
|
4015
|
-
results:
|
|
4016
|
-
|
|
4017
|
-
attributes:
|
|
4018
|
-
|
|
4019
|
-
|
|
4099
|
+
z22.object({
|
|
4100
|
+
type: z22.literal("file_search_call"),
|
|
4101
|
+
id: z22.string(),
|
|
4102
|
+
queries: z22.array(z22.string()),
|
|
4103
|
+
results: z22.array(
|
|
4104
|
+
z22.object({
|
|
4105
|
+
attributes: z22.record(
|
|
4106
|
+
z22.string(),
|
|
4107
|
+
z22.union([z22.string(), z22.number(), z22.boolean()])
|
|
4020
4108
|
),
|
|
4021
|
-
file_id:
|
|
4022
|
-
filename:
|
|
4023
|
-
score:
|
|
4024
|
-
text:
|
|
4109
|
+
file_id: z22.string(),
|
|
4110
|
+
filename: z22.string(),
|
|
4111
|
+
score: z22.number(),
|
|
4112
|
+
text: z22.string()
|
|
4025
4113
|
})
|
|
4026
4114
|
).nullish()
|
|
4027
4115
|
}),
|
|
4028
|
-
|
|
4029
|
-
type:
|
|
4030
|
-
id:
|
|
4031
|
-
code:
|
|
4032
|
-
container_id:
|
|
4033
|
-
outputs:
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4116
|
+
z22.object({
|
|
4117
|
+
type: z22.literal("code_interpreter_call"),
|
|
4118
|
+
id: z22.string(),
|
|
4119
|
+
code: z22.string().nullable(),
|
|
4120
|
+
container_id: z22.string(),
|
|
4121
|
+
outputs: z22.array(
|
|
4122
|
+
z22.discriminatedUnion("type", [
|
|
4123
|
+
z22.object({ type: z22.literal("logs"), logs: z22.string() }),
|
|
4124
|
+
z22.object({ type: z22.literal("image"), url: z22.string() })
|
|
4037
4125
|
])
|
|
4038
4126
|
).nullable()
|
|
4039
4127
|
}),
|
|
4040
|
-
|
|
4041
|
-
type:
|
|
4042
|
-
id:
|
|
4043
|
-
result:
|
|
4128
|
+
z22.object({
|
|
4129
|
+
type: z22.literal("image_generation_call"),
|
|
4130
|
+
id: z22.string(),
|
|
4131
|
+
result: z22.string()
|
|
4044
4132
|
}),
|
|
4045
|
-
|
|
4046
|
-
type:
|
|
4047
|
-
id:
|
|
4048
|
-
call_id:
|
|
4049
|
-
action:
|
|
4050
|
-
type:
|
|
4051
|
-
command:
|
|
4052
|
-
timeout_ms:
|
|
4053
|
-
user:
|
|
4054
|
-
working_directory:
|
|
4055
|
-
env:
|
|
4133
|
+
z22.object({
|
|
4134
|
+
type: z22.literal("local_shell_call"),
|
|
4135
|
+
id: z22.string(),
|
|
4136
|
+
call_id: z22.string(),
|
|
4137
|
+
action: z22.object({
|
|
4138
|
+
type: z22.literal("exec"),
|
|
4139
|
+
command: z22.array(z22.string()),
|
|
4140
|
+
timeout_ms: z22.number().optional(),
|
|
4141
|
+
user: z22.string().optional(),
|
|
4142
|
+
working_directory: z22.string().optional(),
|
|
4143
|
+
env: z22.record(z22.string(), z22.string()).optional()
|
|
4056
4144
|
})
|
|
4057
4145
|
}),
|
|
4058
|
-
|
|
4059
|
-
type:
|
|
4060
|
-
call_id:
|
|
4061
|
-
name:
|
|
4062
|
-
arguments:
|
|
4063
|
-
id:
|
|
4146
|
+
z22.object({
|
|
4147
|
+
type: z22.literal("function_call"),
|
|
4148
|
+
call_id: z22.string(),
|
|
4149
|
+
name: z22.string(),
|
|
4150
|
+
arguments: z22.string(),
|
|
4151
|
+
id: z22.string(),
|
|
4152
|
+
namespace: z22.string().nullish()
|
|
4064
4153
|
}),
|
|
4065
|
-
|
|
4066
|
-
type:
|
|
4067
|
-
call_id:
|
|
4068
|
-
name:
|
|
4069
|
-
input:
|
|
4070
|
-
id:
|
|
4154
|
+
z22.object({
|
|
4155
|
+
type: z22.literal("custom_tool_call"),
|
|
4156
|
+
call_id: z22.string(),
|
|
4157
|
+
name: z22.string(),
|
|
4158
|
+
input: z22.string(),
|
|
4159
|
+
id: z22.string()
|
|
4071
4160
|
}),
|
|
4072
|
-
|
|
4073
|
-
type:
|
|
4074
|
-
id:
|
|
4075
|
-
status:
|
|
4161
|
+
z22.object({
|
|
4162
|
+
type: z22.literal("computer_call"),
|
|
4163
|
+
id: z22.string(),
|
|
4164
|
+
status: z22.string().optional()
|
|
4076
4165
|
}),
|
|
4077
|
-
|
|
4078
|
-
type:
|
|
4079
|
-
id:
|
|
4080
|
-
encrypted_content:
|
|
4081
|
-
summary:
|
|
4082
|
-
|
|
4083
|
-
type:
|
|
4084
|
-
text:
|
|
4166
|
+
z22.object({
|
|
4167
|
+
type: z22.literal("reasoning"),
|
|
4168
|
+
id: z22.string(),
|
|
4169
|
+
encrypted_content: z22.string().nullish(),
|
|
4170
|
+
summary: z22.array(
|
|
4171
|
+
z22.object({
|
|
4172
|
+
type: z22.literal("summary_text"),
|
|
4173
|
+
text: z22.string()
|
|
4085
4174
|
})
|
|
4086
4175
|
)
|
|
4087
4176
|
}),
|
|
4088
|
-
|
|
4089
|
-
type:
|
|
4090
|
-
id:
|
|
4091
|
-
status:
|
|
4092
|
-
arguments:
|
|
4093
|
-
name:
|
|
4094
|
-
server_label:
|
|
4095
|
-
output:
|
|
4096
|
-
error:
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
type:
|
|
4100
|
-
code:
|
|
4101
|
-
message:
|
|
4177
|
+
z22.object({
|
|
4178
|
+
type: z22.literal("mcp_call"),
|
|
4179
|
+
id: z22.string(),
|
|
4180
|
+
status: z22.string(),
|
|
4181
|
+
arguments: z22.string(),
|
|
4182
|
+
name: z22.string(),
|
|
4183
|
+
server_label: z22.string(),
|
|
4184
|
+
output: z22.string().nullish(),
|
|
4185
|
+
error: z22.union([
|
|
4186
|
+
z22.string(),
|
|
4187
|
+
z22.object({
|
|
4188
|
+
type: z22.string().optional(),
|
|
4189
|
+
code: z22.union([z22.number(), z22.string()]).optional(),
|
|
4190
|
+
message: z22.string().optional()
|
|
4102
4191
|
}).loose()
|
|
4103
4192
|
]).nullish(),
|
|
4104
|
-
approval_request_id:
|
|
4193
|
+
approval_request_id: z22.string().nullish()
|
|
4105
4194
|
}),
|
|
4106
|
-
|
|
4107
|
-
type:
|
|
4108
|
-
id:
|
|
4109
|
-
server_label:
|
|
4110
|
-
tools:
|
|
4111
|
-
|
|
4112
|
-
name:
|
|
4113
|
-
description:
|
|
4114
|
-
input_schema:
|
|
4115
|
-
annotations:
|
|
4195
|
+
z22.object({
|
|
4196
|
+
type: z22.literal("mcp_list_tools"),
|
|
4197
|
+
id: z22.string(),
|
|
4198
|
+
server_label: z22.string(),
|
|
4199
|
+
tools: z22.array(
|
|
4200
|
+
z22.object({
|
|
4201
|
+
name: z22.string(),
|
|
4202
|
+
description: z22.string().optional(),
|
|
4203
|
+
input_schema: z22.any(),
|
|
4204
|
+
annotations: z22.record(z22.string(), z22.unknown()).optional()
|
|
4116
4205
|
})
|
|
4117
4206
|
),
|
|
4118
|
-
error:
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
type:
|
|
4122
|
-
code:
|
|
4123
|
-
message:
|
|
4207
|
+
error: z22.union([
|
|
4208
|
+
z22.string(),
|
|
4209
|
+
z22.object({
|
|
4210
|
+
type: z22.string().optional(),
|
|
4211
|
+
code: z22.union([z22.number(), z22.string()]).optional(),
|
|
4212
|
+
message: z22.string().optional()
|
|
4124
4213
|
}).loose()
|
|
4125
4214
|
]).optional()
|
|
4126
4215
|
}),
|
|
4127
|
-
|
|
4128
|
-
type:
|
|
4129
|
-
id:
|
|
4130
|
-
server_label:
|
|
4131
|
-
name:
|
|
4132
|
-
arguments:
|
|
4133
|
-
approval_request_id:
|
|
4216
|
+
z22.object({
|
|
4217
|
+
type: z22.literal("mcp_approval_request"),
|
|
4218
|
+
id: z22.string(),
|
|
4219
|
+
server_label: z22.string(),
|
|
4220
|
+
name: z22.string(),
|
|
4221
|
+
arguments: z22.string(),
|
|
4222
|
+
approval_request_id: z22.string().optional()
|
|
4134
4223
|
}),
|
|
4135
|
-
|
|
4136
|
-
type:
|
|
4137
|
-
id:
|
|
4138
|
-
call_id:
|
|
4139
|
-
status:
|
|
4140
|
-
operation:
|
|
4141
|
-
|
|
4142
|
-
type:
|
|
4143
|
-
path:
|
|
4144
|
-
diff:
|
|
4224
|
+
z22.object({
|
|
4225
|
+
type: z22.literal("apply_patch_call"),
|
|
4226
|
+
id: z22.string(),
|
|
4227
|
+
call_id: z22.string(),
|
|
4228
|
+
status: z22.enum(["in_progress", "completed"]),
|
|
4229
|
+
operation: z22.discriminatedUnion("type", [
|
|
4230
|
+
z22.object({
|
|
4231
|
+
type: z22.literal("create_file"),
|
|
4232
|
+
path: z22.string(),
|
|
4233
|
+
diff: z22.string()
|
|
4145
4234
|
}),
|
|
4146
|
-
|
|
4147
|
-
type:
|
|
4148
|
-
path:
|
|
4235
|
+
z22.object({
|
|
4236
|
+
type: z22.literal("delete_file"),
|
|
4237
|
+
path: z22.string()
|
|
4149
4238
|
}),
|
|
4150
|
-
|
|
4151
|
-
type:
|
|
4152
|
-
path:
|
|
4153
|
-
diff:
|
|
4239
|
+
z22.object({
|
|
4240
|
+
type: z22.literal("update_file"),
|
|
4241
|
+
path: z22.string(),
|
|
4242
|
+
diff: z22.string()
|
|
4154
4243
|
})
|
|
4155
4244
|
])
|
|
4156
4245
|
}),
|
|
4157
|
-
|
|
4158
|
-
type:
|
|
4159
|
-
id:
|
|
4160
|
-
call_id:
|
|
4161
|
-
status:
|
|
4162
|
-
action:
|
|
4163
|
-
commands:
|
|
4246
|
+
z22.object({
|
|
4247
|
+
type: z22.literal("shell_call"),
|
|
4248
|
+
id: z22.string(),
|
|
4249
|
+
call_id: z22.string(),
|
|
4250
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
4251
|
+
action: z22.object({
|
|
4252
|
+
commands: z22.array(z22.string())
|
|
4164
4253
|
})
|
|
4165
4254
|
}),
|
|
4166
|
-
|
|
4167
|
-
type:
|
|
4168
|
-
id:
|
|
4169
|
-
call_id:
|
|
4170
|
-
status:
|
|
4171
|
-
output:
|
|
4172
|
-
|
|
4173
|
-
stdout:
|
|
4174
|
-
stderr:
|
|
4175
|
-
outcome:
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
type:
|
|
4179
|
-
exit_code:
|
|
4255
|
+
z22.object({
|
|
4256
|
+
type: z22.literal("shell_call_output"),
|
|
4257
|
+
id: z22.string(),
|
|
4258
|
+
call_id: z22.string(),
|
|
4259
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
4260
|
+
output: z22.array(
|
|
4261
|
+
z22.object({
|
|
4262
|
+
stdout: z22.string(),
|
|
4263
|
+
stderr: z22.string(),
|
|
4264
|
+
outcome: z22.discriminatedUnion("type", [
|
|
4265
|
+
z22.object({ type: z22.literal("timeout") }),
|
|
4266
|
+
z22.object({
|
|
4267
|
+
type: z22.literal("exit"),
|
|
4268
|
+
exit_code: z22.number()
|
|
4180
4269
|
})
|
|
4181
4270
|
])
|
|
4182
4271
|
})
|
|
4183
4272
|
)
|
|
4184
4273
|
}),
|
|
4185
|
-
|
|
4186
|
-
type:
|
|
4187
|
-
id:
|
|
4188
|
-
execution:
|
|
4189
|
-
call_id:
|
|
4190
|
-
status:
|
|
4191
|
-
arguments:
|
|
4274
|
+
z22.object({
|
|
4275
|
+
type: z22.literal("tool_search_call"),
|
|
4276
|
+
id: z22.string(),
|
|
4277
|
+
execution: z22.enum(["server", "client"]),
|
|
4278
|
+
call_id: z22.string().nullable(),
|
|
4279
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
4280
|
+
arguments: z22.unknown()
|
|
4192
4281
|
}),
|
|
4193
|
-
|
|
4194
|
-
type:
|
|
4195
|
-
id:
|
|
4196
|
-
execution:
|
|
4197
|
-
call_id:
|
|
4198
|
-
status:
|
|
4199
|
-
tools:
|
|
4282
|
+
z22.object({
|
|
4283
|
+
type: z22.literal("tool_search_output"),
|
|
4284
|
+
id: z22.string(),
|
|
4285
|
+
execution: z22.enum(["server", "client"]),
|
|
4286
|
+
call_id: z22.string().nullable(),
|
|
4287
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
4288
|
+
tools: z22.array(z22.record(z22.string(), jsonValueSchema2.optional()))
|
|
4200
4289
|
})
|
|
4201
4290
|
])
|
|
4202
4291
|
).optional(),
|
|
4203
|
-
service_tier:
|
|
4204
|
-
incomplete_details:
|
|
4205
|
-
usage:
|
|
4206
|
-
input_tokens:
|
|
4207
|
-
input_tokens_details:
|
|
4208
|
-
output_tokens:
|
|
4209
|
-
output_tokens_details:
|
|
4292
|
+
service_tier: z22.string().nullish(),
|
|
4293
|
+
incomplete_details: z22.object({ reason: z22.string() }).nullish(),
|
|
4294
|
+
usage: z22.object({
|
|
4295
|
+
input_tokens: z22.number(),
|
|
4296
|
+
input_tokens_details: z22.object({ cached_tokens: z22.number().nullish() }).nullish(),
|
|
4297
|
+
output_tokens: z22.number(),
|
|
4298
|
+
output_tokens_details: z22.object({ reasoning_tokens: z22.number().nullish() }).nullish()
|
|
4210
4299
|
}).optional()
|
|
4211
4300
|
})
|
|
4212
4301
|
)
|
|
@@ -4214,10 +4303,10 @@ var openaiResponsesResponseSchema = lazySchema19(
|
|
|
4214
4303
|
|
|
4215
4304
|
// src/responses/openai-responses-options.ts
|
|
4216
4305
|
import {
|
|
4217
|
-
lazySchema as
|
|
4218
|
-
zodSchema as
|
|
4306
|
+
lazySchema as lazySchema21,
|
|
4307
|
+
zodSchema as zodSchema21
|
|
4219
4308
|
} from "@ai-sdk/provider-utils";
|
|
4220
|
-
import { z as
|
|
4309
|
+
import { z as z23 } from "zod/v4";
|
|
4221
4310
|
var TOP_LOGPROBS_MAX = 20;
|
|
4222
4311
|
var openaiResponsesReasoningModelIds = [
|
|
4223
4312
|
"o1",
|
|
@@ -4282,9 +4371,9 @@ var openaiResponsesModelIds = [
|
|
|
4282
4371
|
"gpt-5-chat-latest",
|
|
4283
4372
|
...openaiResponsesReasoningModelIds
|
|
4284
4373
|
];
|
|
4285
|
-
var openaiLanguageModelResponsesOptionsSchema =
|
|
4286
|
-
() =>
|
|
4287
|
-
|
|
4374
|
+
var openaiLanguageModelResponsesOptionsSchema = lazySchema21(
|
|
4375
|
+
() => zodSchema21(
|
|
4376
|
+
z23.object({
|
|
4288
4377
|
/**
|
|
4289
4378
|
* The ID of the OpenAI Conversation to continue.
|
|
4290
4379
|
* You must create a conversation first via the OpenAI API.
|
|
@@ -4292,13 +4381,13 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4292
4381
|
* Defaults to `undefined`.
|
|
4293
4382
|
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
4294
4383
|
*/
|
|
4295
|
-
conversation:
|
|
4384
|
+
conversation: z23.string().nullish(),
|
|
4296
4385
|
/**
|
|
4297
4386
|
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
4298
4387
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
|
|
4299
4388
|
*/
|
|
4300
|
-
include:
|
|
4301
|
-
|
|
4389
|
+
include: z23.array(
|
|
4390
|
+
z23.enum([
|
|
4302
4391
|
"reasoning.encrypted_content",
|
|
4303
4392
|
// handled internally by default, only needed for unknown reasoning models
|
|
4304
4393
|
"file_search_call.results",
|
|
@@ -4310,7 +4399,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4310
4399
|
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
4311
4400
|
* Defaults to `undefined`.
|
|
4312
4401
|
*/
|
|
4313
|
-
instructions:
|
|
4402
|
+
instructions: z23.string().nullish(),
|
|
4314
4403
|
/**
|
|
4315
4404
|
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
4316
4405
|
* the response size and can slow down response times. However, it can
|
|
@@ -4325,30 +4414,30 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4325
4414
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
4326
4415
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
4327
4416
|
*/
|
|
4328
|
-
logprobs:
|
|
4417
|
+
logprobs: z23.union([z23.boolean(), z23.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
4329
4418
|
/**
|
|
4330
4419
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
4331
4420
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
4332
4421
|
* Any further attempts to call a tool by the model will be ignored.
|
|
4333
4422
|
*/
|
|
4334
|
-
maxToolCalls:
|
|
4423
|
+
maxToolCalls: z23.number().nullish(),
|
|
4335
4424
|
/**
|
|
4336
4425
|
* Additional metadata to store with the generation.
|
|
4337
4426
|
*/
|
|
4338
|
-
metadata:
|
|
4427
|
+
metadata: z23.any().nullish(),
|
|
4339
4428
|
/**
|
|
4340
4429
|
* Whether to use parallel tool calls. Defaults to `true`.
|
|
4341
4430
|
*/
|
|
4342
|
-
parallelToolCalls:
|
|
4431
|
+
parallelToolCalls: z23.boolean().nullish(),
|
|
4343
4432
|
/**
|
|
4344
4433
|
* The ID of the previous response. You can use it to continue a conversation.
|
|
4345
4434
|
* Defaults to `undefined`.
|
|
4346
4435
|
*/
|
|
4347
|
-
previousResponseId:
|
|
4436
|
+
previousResponseId: z23.string().nullish(),
|
|
4348
4437
|
/**
|
|
4349
4438
|
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
4350
4439
|
*/
|
|
4351
|
-
promptCacheKey:
|
|
4440
|
+
promptCacheKey: z23.string().nullish(),
|
|
4352
4441
|
/**
|
|
4353
4442
|
* The retention policy for the prompt cache.
|
|
4354
4443
|
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
@@ -4357,7 +4446,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4357
4446
|
*
|
|
4358
4447
|
* @default 'in_memory'
|
|
4359
4448
|
*/
|
|
4360
|
-
promptCacheRetention:
|
|
4449
|
+
promptCacheRetention: z23.enum(["in_memory", "24h"]).nullish(),
|
|
4361
4450
|
/**
|
|
4362
4451
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
4363
4452
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
@@ -4368,17 +4457,17 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4368
4457
|
* OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
|
|
4369
4458
|
* an error.
|
|
4370
4459
|
*/
|
|
4371
|
-
reasoningEffort:
|
|
4460
|
+
reasoningEffort: z23.string().nullish(),
|
|
4372
4461
|
/**
|
|
4373
4462
|
* Controls reasoning summary output from the model.
|
|
4374
4463
|
* Set to "auto" to automatically receive the richest level available,
|
|
4375
4464
|
* or "detailed" for comprehensive summaries.
|
|
4376
4465
|
*/
|
|
4377
|
-
reasoningSummary:
|
|
4466
|
+
reasoningSummary: z23.string().nullish(),
|
|
4378
4467
|
/**
|
|
4379
4468
|
* The identifier for safety monitoring and tracking.
|
|
4380
4469
|
*/
|
|
4381
|
-
safetyIdentifier:
|
|
4470
|
+
safetyIdentifier: z23.string().nullish(),
|
|
4382
4471
|
/**
|
|
4383
4472
|
* Service tier for the request.
|
|
4384
4473
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
@@ -4386,34 +4475,34 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4386
4475
|
*
|
|
4387
4476
|
* Defaults to 'auto'.
|
|
4388
4477
|
*/
|
|
4389
|
-
serviceTier:
|
|
4478
|
+
serviceTier: z23.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
4390
4479
|
/**
|
|
4391
4480
|
* Whether to store the generation. Defaults to `true`.
|
|
4392
4481
|
*/
|
|
4393
|
-
store:
|
|
4482
|
+
store: z23.boolean().nullish(),
|
|
4394
4483
|
/**
|
|
4395
4484
|
* Whether to use strict JSON schema validation.
|
|
4396
4485
|
* Defaults to `true`.
|
|
4397
4486
|
*/
|
|
4398
|
-
strictJsonSchema:
|
|
4487
|
+
strictJsonSchema: z23.boolean().nullish(),
|
|
4399
4488
|
/**
|
|
4400
4489
|
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
4401
4490
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
4402
4491
|
* Valid values: 'low', 'medium', 'high'.
|
|
4403
4492
|
*/
|
|
4404
|
-
textVerbosity:
|
|
4493
|
+
textVerbosity: z23.enum(["low", "medium", "high"]).nullish(),
|
|
4405
4494
|
/**
|
|
4406
4495
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
4407
4496
|
* 'disabled' turns truncation off.
|
|
4408
4497
|
*/
|
|
4409
|
-
truncation:
|
|
4498
|
+
truncation: z23.enum(["auto", "disabled"]).nullish(),
|
|
4410
4499
|
/**
|
|
4411
4500
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
4412
4501
|
* monitor and detect abuse.
|
|
4413
4502
|
* Defaults to `undefined`.
|
|
4414
4503
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
4415
4504
|
*/
|
|
4416
|
-
user:
|
|
4505
|
+
user: z23.string().nullish(),
|
|
4417
4506
|
/**
|
|
4418
4507
|
* Override the system message mode for this model.
|
|
4419
4508
|
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
@@ -4422,7 +4511,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4422
4511
|
*
|
|
4423
4512
|
* If not specified, the mode is automatically determined based on the model.
|
|
4424
4513
|
*/
|
|
4425
|
-
systemMessageMode:
|
|
4514
|
+
systemMessageMode: z23.enum(["system", "developer", "remove"]).optional(),
|
|
4426
4515
|
/**
|
|
4427
4516
|
* Force treating this model as a reasoning model.
|
|
4428
4517
|
*
|
|
@@ -4432,7 +4521,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4432
4521
|
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
4433
4522
|
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
4434
4523
|
*/
|
|
4435
|
-
forceReasoning:
|
|
4524
|
+
forceReasoning: z23.boolean().optional()
|
|
4436
4525
|
})
|
|
4437
4526
|
)
|
|
4438
4527
|
);
|
|
@@ -4774,13 +4863,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4774
4863
|
warnings.push({ type: "unsupported", feature: "stopSequences" });
|
|
4775
4864
|
}
|
|
4776
4865
|
const providerOptionsName = this.config.provider.includes("azure") ? "azure" : "openai";
|
|
4777
|
-
let openaiOptions = await
|
|
4866
|
+
let openaiOptions = await parseProviderOptions6({
|
|
4778
4867
|
provider: providerOptionsName,
|
|
4779
4868
|
providerOptions,
|
|
4780
4869
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
4781
4870
|
});
|
|
4782
4871
|
if (openaiOptions == null && providerOptionsName !== "openai") {
|
|
4783
|
-
openaiOptions = await
|
|
4872
|
+
openaiOptions = await parseProviderOptions6({
|
|
4784
4873
|
provider: "openai",
|
|
4785
4874
|
providerOptions,
|
|
4786
4875
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
@@ -5249,7 +5338,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5249
5338
|
input: part.arguments,
|
|
5250
5339
|
providerMetadata: {
|
|
5251
5340
|
[providerOptionsName]: {
|
|
5252
|
-
itemId: part.id
|
|
5341
|
+
itemId: part.id,
|
|
5342
|
+
...part.namespace != null && { namespace: part.namespace }
|
|
5253
5343
|
}
|
|
5254
5344
|
}
|
|
5255
5345
|
});
|
|
@@ -5732,7 +5822,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5732
5822
|
hasFunctionCall = true;
|
|
5733
5823
|
controller.enqueue({
|
|
5734
5824
|
type: "tool-input-end",
|
|
5735
|
-
id: value.item.call_id
|
|
5825
|
+
id: value.item.call_id,
|
|
5826
|
+
...value.item.namespace != null && {
|
|
5827
|
+
providerMetadata: {
|
|
5828
|
+
[providerOptionsName]: {
|
|
5829
|
+
namespace: value.item.namespace
|
|
5830
|
+
}
|
|
5831
|
+
}
|
|
5832
|
+
}
|
|
5736
5833
|
});
|
|
5737
5834
|
controller.enqueue({
|
|
5738
5835
|
type: "tool-call",
|
|
@@ -5741,7 +5838,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5741
5838
|
input: value.item.arguments,
|
|
5742
5839
|
providerMetadata: {
|
|
5743
5840
|
[providerOptionsName]: {
|
|
5744
|
-
itemId: value.item.id
|
|
5841
|
+
itemId: value.item.id,
|
|
5842
|
+
...value.item.namespace != null && {
|
|
5843
|
+
namespace: value.item.namespace
|
|
5844
|
+
}
|
|
5745
5845
|
}
|
|
5746
5846
|
}
|
|
5747
5847
|
});
|
|
@@ -6406,21 +6506,21 @@ function escapeJSONDelta(delta) {
|
|
|
6406
6506
|
import {
|
|
6407
6507
|
combineHeaders as combineHeaders6,
|
|
6408
6508
|
createBinaryResponseHandler,
|
|
6409
|
-
parseProviderOptions as
|
|
6509
|
+
parseProviderOptions as parseProviderOptions7,
|
|
6410
6510
|
postJsonToApi as postJsonToApi6
|
|
6411
6511
|
} from "@ai-sdk/provider-utils";
|
|
6412
6512
|
|
|
6413
6513
|
// src/speech/openai-speech-options.ts
|
|
6414
6514
|
import {
|
|
6415
|
-
lazySchema as
|
|
6416
|
-
zodSchema as
|
|
6515
|
+
lazySchema as lazySchema22,
|
|
6516
|
+
zodSchema as zodSchema22
|
|
6417
6517
|
} from "@ai-sdk/provider-utils";
|
|
6418
|
-
import { z as
|
|
6419
|
-
var openaiSpeechModelOptionsSchema =
|
|
6420
|
-
() =>
|
|
6421
|
-
|
|
6422
|
-
instructions:
|
|
6423
|
-
speed:
|
|
6518
|
+
import { z as z24 } from "zod/v4";
|
|
6519
|
+
var openaiSpeechModelOptionsSchema = lazySchema22(
|
|
6520
|
+
() => zodSchema22(
|
|
6521
|
+
z24.object({
|
|
6522
|
+
instructions: z24.string().nullish(),
|
|
6523
|
+
speed: z24.number().min(0.25).max(4).default(1).nullish()
|
|
6424
6524
|
})
|
|
6425
6525
|
)
|
|
6426
6526
|
);
|
|
@@ -6445,7 +6545,7 @@ var OpenAISpeechModel = class {
|
|
|
6445
6545
|
providerOptions
|
|
6446
6546
|
}) {
|
|
6447
6547
|
const warnings = [];
|
|
6448
|
-
const openAIOptions = await
|
|
6548
|
+
const openAIOptions = await parseProviderOptions7({
|
|
6449
6549
|
provider: "openai",
|
|
6450
6550
|
providerOptions,
|
|
6451
6551
|
schema: openaiSpeechModelOptionsSchema
|
|
@@ -6532,38 +6632,38 @@ import {
|
|
|
6532
6632
|
convertBase64ToUint8Array as convertBase64ToUint8Array2,
|
|
6533
6633
|
createJsonResponseHandler as createJsonResponseHandler6,
|
|
6534
6634
|
mediaTypeToExtension,
|
|
6535
|
-
parseProviderOptions as
|
|
6635
|
+
parseProviderOptions as parseProviderOptions8,
|
|
6536
6636
|
postFormDataToApi as postFormDataToApi2
|
|
6537
6637
|
} from "@ai-sdk/provider-utils";
|
|
6538
6638
|
|
|
6539
6639
|
// src/transcription/openai-transcription-api.ts
|
|
6540
|
-
import { lazySchema as
|
|
6541
|
-
import { z as
|
|
6542
|
-
var openaiTranscriptionResponseSchema =
|
|
6543
|
-
() =>
|
|
6544
|
-
|
|
6545
|
-
text:
|
|
6546
|
-
language:
|
|
6547
|
-
duration:
|
|
6548
|
-
words:
|
|
6549
|
-
|
|
6550
|
-
word:
|
|
6551
|
-
start:
|
|
6552
|
-
end:
|
|
6640
|
+
import { lazySchema as lazySchema23, zodSchema as zodSchema23 } from "@ai-sdk/provider-utils";
|
|
6641
|
+
import { z as z25 } from "zod/v4";
|
|
6642
|
+
var openaiTranscriptionResponseSchema = lazySchema23(
|
|
6643
|
+
() => zodSchema23(
|
|
6644
|
+
z25.object({
|
|
6645
|
+
text: z25.string(),
|
|
6646
|
+
language: z25.string().nullish(),
|
|
6647
|
+
duration: z25.number().nullish(),
|
|
6648
|
+
words: z25.array(
|
|
6649
|
+
z25.object({
|
|
6650
|
+
word: z25.string(),
|
|
6651
|
+
start: z25.number(),
|
|
6652
|
+
end: z25.number()
|
|
6553
6653
|
})
|
|
6554
6654
|
).nullish(),
|
|
6555
|
-
segments:
|
|
6556
|
-
|
|
6557
|
-
id:
|
|
6558
|
-
seek:
|
|
6559
|
-
start:
|
|
6560
|
-
end:
|
|
6561
|
-
text:
|
|
6562
|
-
tokens:
|
|
6563
|
-
temperature:
|
|
6564
|
-
avg_logprob:
|
|
6565
|
-
compression_ratio:
|
|
6566
|
-
no_speech_prob:
|
|
6655
|
+
segments: z25.array(
|
|
6656
|
+
z25.object({
|
|
6657
|
+
id: z25.number(),
|
|
6658
|
+
seek: z25.number(),
|
|
6659
|
+
start: z25.number(),
|
|
6660
|
+
end: z25.number(),
|
|
6661
|
+
text: z25.string(),
|
|
6662
|
+
tokens: z25.array(z25.number()),
|
|
6663
|
+
temperature: z25.number(),
|
|
6664
|
+
avg_logprob: z25.number(),
|
|
6665
|
+
compression_ratio: z25.number(),
|
|
6666
|
+
no_speech_prob: z25.number()
|
|
6567
6667
|
})
|
|
6568
6668
|
).nullish()
|
|
6569
6669
|
})
|
|
@@ -6572,35 +6672,35 @@ var openaiTranscriptionResponseSchema = lazySchema22(
|
|
|
6572
6672
|
|
|
6573
6673
|
// src/transcription/openai-transcription-options.ts
|
|
6574
6674
|
import {
|
|
6575
|
-
lazySchema as
|
|
6576
|
-
zodSchema as
|
|
6675
|
+
lazySchema as lazySchema24,
|
|
6676
|
+
zodSchema as zodSchema24
|
|
6577
6677
|
} from "@ai-sdk/provider-utils";
|
|
6578
|
-
import { z as
|
|
6579
|
-
var openAITranscriptionModelOptions =
|
|
6580
|
-
() =>
|
|
6581
|
-
|
|
6678
|
+
import { z as z26 } from "zod/v4";
|
|
6679
|
+
var openAITranscriptionModelOptions = lazySchema24(
|
|
6680
|
+
() => zodSchema24(
|
|
6681
|
+
z26.object({
|
|
6582
6682
|
/**
|
|
6583
6683
|
* Additional information to include in the transcription response.
|
|
6584
6684
|
*/
|
|
6585
|
-
include:
|
|
6685
|
+
include: z26.array(z26.string()).optional(),
|
|
6586
6686
|
/**
|
|
6587
6687
|
* The language of the input audio in ISO-639-1 format.
|
|
6588
6688
|
*/
|
|
6589
|
-
language:
|
|
6689
|
+
language: z26.string().optional(),
|
|
6590
6690
|
/**
|
|
6591
6691
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
6592
6692
|
*/
|
|
6593
|
-
prompt:
|
|
6693
|
+
prompt: z26.string().optional(),
|
|
6594
6694
|
/**
|
|
6595
6695
|
* The sampling temperature, between 0 and 1.
|
|
6596
6696
|
* @default 0
|
|
6597
6697
|
*/
|
|
6598
|
-
temperature:
|
|
6698
|
+
temperature: z26.number().min(0).max(1).default(0).optional(),
|
|
6599
6699
|
/**
|
|
6600
6700
|
* The timestamp granularities to populate for this transcription.
|
|
6601
6701
|
* @default ['segment']
|
|
6602
6702
|
*/
|
|
6603
|
-
timestampGranularities:
|
|
6703
|
+
timestampGranularities: z26.array(z26.enum(["word", "segment"])).default(["segment"]).optional()
|
|
6604
6704
|
})
|
|
6605
6705
|
)
|
|
6606
6706
|
);
|
|
@@ -6680,7 +6780,7 @@ var OpenAITranscriptionModel = class {
|
|
|
6680
6780
|
providerOptions
|
|
6681
6781
|
}) {
|
|
6682
6782
|
const warnings = [];
|
|
6683
|
-
const openAIOptions = await
|
|
6783
|
+
const openAIOptions = await parseProviderOptions8({
|
|
6684
6784
|
provider: "openai",
|
|
6685
6785
|
providerOptions,
|
|
6686
6786
|
schema: openAITranscriptionModelOptions
|
|
@@ -6773,7 +6873,7 @@ var OpenAITranscriptionModel = class {
|
|
|
6773
6873
|
};
|
|
6774
6874
|
|
|
6775
6875
|
// src/version.ts
|
|
6776
|
-
var VERSION = true ? "3.0.
|
|
6876
|
+
var VERSION = true ? "3.0.58" : "0.0.0-test";
|
|
6777
6877
|
|
|
6778
6878
|
// src/openai-provider.ts
|
|
6779
6879
|
function createOpenAI(options = {}) {
|