@ai-sdk/openai 3.0.55 → 3.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/index.d.mts +28 -1
- package/dist/index.d.ts +28 -1
- package/dist/index.js +1204 -1122
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1148 -1062
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +28 -1
- package/dist/internal/index.d.ts +28 -1
- package/dist/internal/index.js +1203 -1115
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1149 -1060
- 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/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,544 @@ 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()
|
|
3462
3548
|
}),
|
|
3463
|
-
|
|
3464
|
-
type:
|
|
3465
|
-
id:
|
|
3466
|
-
status:
|
|
3549
|
+
z22.object({
|
|
3550
|
+
type: z22.literal("web_search_call"),
|
|
3551
|
+
id: z22.string(),
|
|
3552
|
+
status: z22.string()
|
|
3467
3553
|
}),
|
|
3468
|
-
|
|
3469
|
-
type:
|
|
3470
|
-
id:
|
|
3471
|
-
status:
|
|
3554
|
+
z22.object({
|
|
3555
|
+
type: z22.literal("computer_call"),
|
|
3556
|
+
id: z22.string(),
|
|
3557
|
+
status: z22.string()
|
|
3472
3558
|
}),
|
|
3473
|
-
|
|
3474
|
-
type:
|
|
3475
|
-
id:
|
|
3559
|
+
z22.object({
|
|
3560
|
+
type: z22.literal("file_search_call"),
|
|
3561
|
+
id: z22.string()
|
|
3476
3562
|
}),
|
|
3477
|
-
|
|
3478
|
-
type:
|
|
3479
|
-
id:
|
|
3563
|
+
z22.object({
|
|
3564
|
+
type: z22.literal("image_generation_call"),
|
|
3565
|
+
id: z22.string()
|
|
3480
3566
|
}),
|
|
3481
|
-
|
|
3482
|
-
type:
|
|
3483
|
-
id:
|
|
3484
|
-
container_id:
|
|
3485
|
-
code:
|
|
3486
|
-
outputs:
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3567
|
+
z22.object({
|
|
3568
|
+
type: z22.literal("code_interpreter_call"),
|
|
3569
|
+
id: z22.string(),
|
|
3570
|
+
container_id: z22.string(),
|
|
3571
|
+
code: z22.string().nullable(),
|
|
3572
|
+
outputs: z22.array(
|
|
3573
|
+
z22.discriminatedUnion("type", [
|
|
3574
|
+
z22.object({ type: z22.literal("logs"), logs: z22.string() }),
|
|
3575
|
+
z22.object({ type: z22.literal("image"), url: z22.string() })
|
|
3490
3576
|
])
|
|
3491
3577
|
).nullable(),
|
|
3492
|
-
status:
|
|
3578
|
+
status: z22.string()
|
|
3493
3579
|
}),
|
|
3494
|
-
|
|
3495
|
-
type:
|
|
3496
|
-
id:
|
|
3497
|
-
status:
|
|
3498
|
-
approval_request_id:
|
|
3580
|
+
z22.object({
|
|
3581
|
+
type: z22.literal("mcp_call"),
|
|
3582
|
+
id: z22.string(),
|
|
3583
|
+
status: z22.string(),
|
|
3584
|
+
approval_request_id: z22.string().nullish()
|
|
3499
3585
|
}),
|
|
3500
|
-
|
|
3501
|
-
type:
|
|
3502
|
-
id:
|
|
3586
|
+
z22.object({
|
|
3587
|
+
type: z22.literal("mcp_list_tools"),
|
|
3588
|
+
id: z22.string()
|
|
3503
3589
|
}),
|
|
3504
|
-
|
|
3505
|
-
type:
|
|
3506
|
-
id:
|
|
3590
|
+
z22.object({
|
|
3591
|
+
type: z22.literal("mcp_approval_request"),
|
|
3592
|
+
id: z22.string()
|
|
3507
3593
|
}),
|
|
3508
|
-
|
|
3509
|
-
type:
|
|
3510
|
-
id:
|
|
3511
|
-
call_id:
|
|
3512
|
-
status:
|
|
3513
|
-
operation:
|
|
3514
|
-
|
|
3515
|
-
type:
|
|
3516
|
-
path:
|
|
3517
|
-
diff:
|
|
3594
|
+
z22.object({
|
|
3595
|
+
type: z22.literal("apply_patch_call"),
|
|
3596
|
+
id: z22.string(),
|
|
3597
|
+
call_id: z22.string(),
|
|
3598
|
+
status: z22.enum(["in_progress", "completed"]),
|
|
3599
|
+
operation: z22.discriminatedUnion("type", [
|
|
3600
|
+
z22.object({
|
|
3601
|
+
type: z22.literal("create_file"),
|
|
3602
|
+
path: z22.string(),
|
|
3603
|
+
diff: z22.string()
|
|
3518
3604
|
}),
|
|
3519
|
-
|
|
3520
|
-
type:
|
|
3521
|
-
path:
|
|
3605
|
+
z22.object({
|
|
3606
|
+
type: z22.literal("delete_file"),
|
|
3607
|
+
path: z22.string()
|
|
3522
3608
|
}),
|
|
3523
|
-
|
|
3524
|
-
type:
|
|
3525
|
-
path:
|
|
3526
|
-
diff:
|
|
3609
|
+
z22.object({
|
|
3610
|
+
type: z22.literal("update_file"),
|
|
3611
|
+
path: z22.string(),
|
|
3612
|
+
diff: z22.string()
|
|
3527
3613
|
})
|
|
3528
3614
|
])
|
|
3529
3615
|
}),
|
|
3530
|
-
|
|
3531
|
-
type:
|
|
3532
|
-
id:
|
|
3533
|
-
call_id:
|
|
3534
|
-
name:
|
|
3535
|
-
input:
|
|
3616
|
+
z22.object({
|
|
3617
|
+
type: z22.literal("custom_tool_call"),
|
|
3618
|
+
id: z22.string(),
|
|
3619
|
+
call_id: z22.string(),
|
|
3620
|
+
name: z22.string(),
|
|
3621
|
+
input: z22.string()
|
|
3536
3622
|
}),
|
|
3537
|
-
|
|
3538
|
-
type:
|
|
3539
|
-
id:
|
|
3540
|
-
call_id:
|
|
3541
|
-
status:
|
|
3542
|
-
action:
|
|
3543
|
-
commands:
|
|
3623
|
+
z22.object({
|
|
3624
|
+
type: z22.literal("shell_call"),
|
|
3625
|
+
id: z22.string(),
|
|
3626
|
+
call_id: z22.string(),
|
|
3627
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3628
|
+
action: z22.object({
|
|
3629
|
+
commands: z22.array(z22.string())
|
|
3544
3630
|
})
|
|
3545
3631
|
}),
|
|
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:
|
|
3632
|
+
z22.object({
|
|
3633
|
+
type: z22.literal("shell_call_output"),
|
|
3634
|
+
id: z22.string(),
|
|
3635
|
+
call_id: z22.string(),
|
|
3636
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3637
|
+
output: z22.array(
|
|
3638
|
+
z22.object({
|
|
3639
|
+
stdout: z22.string(),
|
|
3640
|
+
stderr: z22.string(),
|
|
3641
|
+
outcome: z22.discriminatedUnion("type", [
|
|
3642
|
+
z22.object({ type: z22.literal("timeout") }),
|
|
3643
|
+
z22.object({
|
|
3644
|
+
type: z22.literal("exit"),
|
|
3645
|
+
exit_code: z22.number()
|
|
3560
3646
|
})
|
|
3561
3647
|
])
|
|
3562
3648
|
})
|
|
3563
3649
|
)
|
|
3564
3650
|
}),
|
|
3565
|
-
|
|
3566
|
-
type:
|
|
3567
|
-
id:
|
|
3568
|
-
execution:
|
|
3569
|
-
call_id:
|
|
3570
|
-
status:
|
|
3571
|
-
arguments:
|
|
3651
|
+
z22.object({
|
|
3652
|
+
type: z22.literal("tool_search_call"),
|
|
3653
|
+
id: z22.string(),
|
|
3654
|
+
execution: z22.enum(["server", "client"]),
|
|
3655
|
+
call_id: z22.string().nullable(),
|
|
3656
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3657
|
+
arguments: z22.unknown()
|
|
3572
3658
|
}),
|
|
3573
|
-
|
|
3574
|
-
type:
|
|
3575
|
-
id:
|
|
3576
|
-
execution:
|
|
3577
|
-
call_id:
|
|
3578
|
-
status:
|
|
3579
|
-
tools:
|
|
3659
|
+
z22.object({
|
|
3660
|
+
type: z22.literal("tool_search_output"),
|
|
3661
|
+
id: z22.string(),
|
|
3662
|
+
execution: z22.enum(["server", "client"]),
|
|
3663
|
+
call_id: z22.string().nullable(),
|
|
3664
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3665
|
+
tools: z22.array(z22.record(z22.string(), jsonValueSchema2.optional()))
|
|
3580
3666
|
})
|
|
3581
3667
|
])
|
|
3582
3668
|
}),
|
|
3583
|
-
|
|
3584
|
-
type:
|
|
3585
|
-
output_index:
|
|
3586
|
-
item:
|
|
3587
|
-
|
|
3588
|
-
type:
|
|
3589
|
-
id:
|
|
3590
|
-
phase:
|
|
3669
|
+
z22.object({
|
|
3670
|
+
type: z22.literal("response.output_item.done"),
|
|
3671
|
+
output_index: z22.number(),
|
|
3672
|
+
item: z22.discriminatedUnion("type", [
|
|
3673
|
+
z22.object({
|
|
3674
|
+
type: z22.literal("message"),
|
|
3675
|
+
id: z22.string(),
|
|
3676
|
+
phase: z22.enum(["commentary", "final_answer"]).nullish()
|
|
3591
3677
|
}),
|
|
3592
|
-
|
|
3593
|
-
type:
|
|
3594
|
-
id:
|
|
3595
|
-
encrypted_content:
|
|
3678
|
+
z22.object({
|
|
3679
|
+
type: z22.literal("reasoning"),
|
|
3680
|
+
id: z22.string(),
|
|
3681
|
+
encrypted_content: z22.string().nullish()
|
|
3596
3682
|
}),
|
|
3597
|
-
|
|
3598
|
-
type:
|
|
3599
|
-
id:
|
|
3600
|
-
call_id:
|
|
3601
|
-
name:
|
|
3602
|
-
arguments:
|
|
3603
|
-
status:
|
|
3683
|
+
z22.object({
|
|
3684
|
+
type: z22.literal("function_call"),
|
|
3685
|
+
id: z22.string(),
|
|
3686
|
+
call_id: z22.string(),
|
|
3687
|
+
name: z22.string(),
|
|
3688
|
+
arguments: z22.string(),
|
|
3689
|
+
status: z22.literal("completed")
|
|
3604
3690
|
}),
|
|
3605
|
-
|
|
3606
|
-
type:
|
|
3607
|
-
id:
|
|
3608
|
-
call_id:
|
|
3609
|
-
name:
|
|
3610
|
-
input:
|
|
3611
|
-
status:
|
|
3691
|
+
z22.object({
|
|
3692
|
+
type: z22.literal("custom_tool_call"),
|
|
3693
|
+
id: z22.string(),
|
|
3694
|
+
call_id: z22.string(),
|
|
3695
|
+
name: z22.string(),
|
|
3696
|
+
input: z22.string(),
|
|
3697
|
+
status: z22.literal("completed")
|
|
3612
3698
|
}),
|
|
3613
|
-
|
|
3614
|
-
type:
|
|
3615
|
-
id:
|
|
3616
|
-
code:
|
|
3617
|
-
container_id:
|
|
3618
|
-
outputs:
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3699
|
+
z22.object({
|
|
3700
|
+
type: z22.literal("code_interpreter_call"),
|
|
3701
|
+
id: z22.string(),
|
|
3702
|
+
code: z22.string().nullable(),
|
|
3703
|
+
container_id: z22.string(),
|
|
3704
|
+
outputs: z22.array(
|
|
3705
|
+
z22.discriminatedUnion("type", [
|
|
3706
|
+
z22.object({ type: z22.literal("logs"), logs: z22.string() }),
|
|
3707
|
+
z22.object({ type: z22.literal("image"), url: z22.string() })
|
|
3622
3708
|
])
|
|
3623
3709
|
).nullable()
|
|
3624
3710
|
}),
|
|
3625
|
-
|
|
3626
|
-
type:
|
|
3627
|
-
id:
|
|
3628
|
-
result:
|
|
3711
|
+
z22.object({
|
|
3712
|
+
type: z22.literal("image_generation_call"),
|
|
3713
|
+
id: z22.string(),
|
|
3714
|
+
result: z22.string()
|
|
3629
3715
|
}),
|
|
3630
|
-
|
|
3631
|
-
type:
|
|
3632
|
-
id:
|
|
3633
|
-
status:
|
|
3634
|
-
action:
|
|
3635
|
-
|
|
3636
|
-
type:
|
|
3637
|
-
query:
|
|
3638
|
-
sources:
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3716
|
+
z22.object({
|
|
3717
|
+
type: z22.literal("web_search_call"),
|
|
3718
|
+
id: z22.string(),
|
|
3719
|
+
status: z22.string(),
|
|
3720
|
+
action: z22.discriminatedUnion("type", [
|
|
3721
|
+
z22.object({
|
|
3722
|
+
type: z22.literal("search"),
|
|
3723
|
+
query: z22.string().nullish(),
|
|
3724
|
+
sources: z22.array(
|
|
3725
|
+
z22.discriminatedUnion("type", [
|
|
3726
|
+
z22.object({ type: z22.literal("url"), url: z22.string() }),
|
|
3727
|
+
z22.object({ type: z22.literal("api"), name: z22.string() })
|
|
3642
3728
|
])
|
|
3643
3729
|
).nullish()
|
|
3644
3730
|
}),
|
|
3645
|
-
|
|
3646
|
-
type:
|
|
3647
|
-
url:
|
|
3731
|
+
z22.object({
|
|
3732
|
+
type: z22.literal("open_page"),
|
|
3733
|
+
url: z22.string().nullish()
|
|
3648
3734
|
}),
|
|
3649
|
-
|
|
3650
|
-
type:
|
|
3651
|
-
url:
|
|
3652
|
-
pattern:
|
|
3735
|
+
z22.object({
|
|
3736
|
+
type: z22.literal("find_in_page"),
|
|
3737
|
+
url: z22.string().nullish(),
|
|
3738
|
+
pattern: z22.string().nullish()
|
|
3653
3739
|
})
|
|
3654
3740
|
]).nullish()
|
|
3655
3741
|
}),
|
|
3656
|
-
|
|
3657
|
-
type:
|
|
3658
|
-
id:
|
|
3659
|
-
queries:
|
|
3660
|
-
results:
|
|
3661
|
-
|
|
3662
|
-
attributes:
|
|
3663
|
-
|
|
3664
|
-
|
|
3742
|
+
z22.object({
|
|
3743
|
+
type: z22.literal("file_search_call"),
|
|
3744
|
+
id: z22.string(),
|
|
3745
|
+
queries: z22.array(z22.string()),
|
|
3746
|
+
results: z22.array(
|
|
3747
|
+
z22.object({
|
|
3748
|
+
attributes: z22.record(
|
|
3749
|
+
z22.string(),
|
|
3750
|
+
z22.union([z22.string(), z22.number(), z22.boolean()])
|
|
3665
3751
|
),
|
|
3666
|
-
file_id:
|
|
3667
|
-
filename:
|
|
3668
|
-
score:
|
|
3669
|
-
text:
|
|
3752
|
+
file_id: z22.string(),
|
|
3753
|
+
filename: z22.string(),
|
|
3754
|
+
score: z22.number(),
|
|
3755
|
+
text: z22.string()
|
|
3670
3756
|
})
|
|
3671
3757
|
).nullish()
|
|
3672
3758
|
}),
|
|
3673
|
-
|
|
3674
|
-
type:
|
|
3675
|
-
id:
|
|
3676
|
-
call_id:
|
|
3677
|
-
action:
|
|
3678
|
-
type:
|
|
3679
|
-
command:
|
|
3680
|
-
timeout_ms:
|
|
3681
|
-
user:
|
|
3682
|
-
working_directory:
|
|
3683
|
-
env:
|
|
3759
|
+
z22.object({
|
|
3760
|
+
type: z22.literal("local_shell_call"),
|
|
3761
|
+
id: z22.string(),
|
|
3762
|
+
call_id: z22.string(),
|
|
3763
|
+
action: z22.object({
|
|
3764
|
+
type: z22.literal("exec"),
|
|
3765
|
+
command: z22.array(z22.string()),
|
|
3766
|
+
timeout_ms: z22.number().optional(),
|
|
3767
|
+
user: z22.string().optional(),
|
|
3768
|
+
working_directory: z22.string().optional(),
|
|
3769
|
+
env: z22.record(z22.string(), z22.string()).optional()
|
|
3684
3770
|
})
|
|
3685
3771
|
}),
|
|
3686
|
-
|
|
3687
|
-
type:
|
|
3688
|
-
id:
|
|
3689
|
-
status:
|
|
3772
|
+
z22.object({
|
|
3773
|
+
type: z22.literal("computer_call"),
|
|
3774
|
+
id: z22.string(),
|
|
3775
|
+
status: z22.literal("completed")
|
|
3690
3776
|
}),
|
|
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:
|
|
3777
|
+
z22.object({
|
|
3778
|
+
type: z22.literal("mcp_call"),
|
|
3779
|
+
id: z22.string(),
|
|
3780
|
+
status: z22.string(),
|
|
3781
|
+
arguments: z22.string(),
|
|
3782
|
+
name: z22.string(),
|
|
3783
|
+
server_label: z22.string(),
|
|
3784
|
+
output: z22.string().nullish(),
|
|
3785
|
+
error: z22.union([
|
|
3786
|
+
z22.string(),
|
|
3787
|
+
z22.object({
|
|
3788
|
+
type: z22.string().optional(),
|
|
3789
|
+
code: z22.union([z22.number(), z22.string()]).optional(),
|
|
3790
|
+
message: z22.string().optional()
|
|
3705
3791
|
}).loose()
|
|
3706
3792
|
]).nullish(),
|
|
3707
|
-
approval_request_id:
|
|
3793
|
+
approval_request_id: z22.string().nullish()
|
|
3708
3794
|
}),
|
|
3709
|
-
|
|
3710
|
-
type:
|
|
3711
|
-
id:
|
|
3712
|
-
server_label:
|
|
3713
|
-
tools:
|
|
3714
|
-
|
|
3715
|
-
name:
|
|
3716
|
-
description:
|
|
3717
|
-
input_schema:
|
|
3718
|
-
annotations:
|
|
3795
|
+
z22.object({
|
|
3796
|
+
type: z22.literal("mcp_list_tools"),
|
|
3797
|
+
id: z22.string(),
|
|
3798
|
+
server_label: z22.string(),
|
|
3799
|
+
tools: z22.array(
|
|
3800
|
+
z22.object({
|
|
3801
|
+
name: z22.string(),
|
|
3802
|
+
description: z22.string().optional(),
|
|
3803
|
+
input_schema: z22.any(),
|
|
3804
|
+
annotations: z22.record(z22.string(), z22.unknown()).optional()
|
|
3719
3805
|
})
|
|
3720
3806
|
),
|
|
3721
|
-
error:
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
type:
|
|
3725
|
-
code:
|
|
3726
|
-
message:
|
|
3807
|
+
error: z22.union([
|
|
3808
|
+
z22.string(),
|
|
3809
|
+
z22.object({
|
|
3810
|
+
type: z22.string().optional(),
|
|
3811
|
+
code: z22.union([z22.number(), z22.string()]).optional(),
|
|
3812
|
+
message: z22.string().optional()
|
|
3727
3813
|
}).loose()
|
|
3728
3814
|
]).optional()
|
|
3729
3815
|
}),
|
|
3730
|
-
|
|
3731
|
-
type:
|
|
3732
|
-
id:
|
|
3733
|
-
server_label:
|
|
3734
|
-
name:
|
|
3735
|
-
arguments:
|
|
3736
|
-
approval_request_id:
|
|
3816
|
+
z22.object({
|
|
3817
|
+
type: z22.literal("mcp_approval_request"),
|
|
3818
|
+
id: z22.string(),
|
|
3819
|
+
server_label: z22.string(),
|
|
3820
|
+
name: z22.string(),
|
|
3821
|
+
arguments: z22.string(),
|
|
3822
|
+
approval_request_id: z22.string().optional()
|
|
3737
3823
|
}),
|
|
3738
|
-
|
|
3739
|
-
type:
|
|
3740
|
-
id:
|
|
3741
|
-
call_id:
|
|
3742
|
-
status:
|
|
3743
|
-
operation:
|
|
3744
|
-
|
|
3745
|
-
type:
|
|
3746
|
-
path:
|
|
3747
|
-
diff:
|
|
3824
|
+
z22.object({
|
|
3825
|
+
type: z22.literal("apply_patch_call"),
|
|
3826
|
+
id: z22.string(),
|
|
3827
|
+
call_id: z22.string(),
|
|
3828
|
+
status: z22.enum(["in_progress", "completed"]),
|
|
3829
|
+
operation: z22.discriminatedUnion("type", [
|
|
3830
|
+
z22.object({
|
|
3831
|
+
type: z22.literal("create_file"),
|
|
3832
|
+
path: z22.string(),
|
|
3833
|
+
diff: z22.string()
|
|
3748
3834
|
}),
|
|
3749
|
-
|
|
3750
|
-
type:
|
|
3751
|
-
path:
|
|
3835
|
+
z22.object({
|
|
3836
|
+
type: z22.literal("delete_file"),
|
|
3837
|
+
path: z22.string()
|
|
3752
3838
|
}),
|
|
3753
|
-
|
|
3754
|
-
type:
|
|
3755
|
-
path:
|
|
3756
|
-
diff:
|
|
3839
|
+
z22.object({
|
|
3840
|
+
type: z22.literal("update_file"),
|
|
3841
|
+
path: z22.string(),
|
|
3842
|
+
diff: z22.string()
|
|
3757
3843
|
})
|
|
3758
3844
|
])
|
|
3759
3845
|
}),
|
|
3760
|
-
|
|
3761
|
-
type:
|
|
3762
|
-
id:
|
|
3763
|
-
call_id:
|
|
3764
|
-
status:
|
|
3765
|
-
action:
|
|
3766
|
-
commands:
|
|
3846
|
+
z22.object({
|
|
3847
|
+
type: z22.literal("shell_call"),
|
|
3848
|
+
id: z22.string(),
|
|
3849
|
+
call_id: z22.string(),
|
|
3850
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3851
|
+
action: z22.object({
|
|
3852
|
+
commands: z22.array(z22.string())
|
|
3767
3853
|
})
|
|
3768
3854
|
}),
|
|
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:
|
|
3855
|
+
z22.object({
|
|
3856
|
+
type: z22.literal("shell_call_output"),
|
|
3857
|
+
id: z22.string(),
|
|
3858
|
+
call_id: z22.string(),
|
|
3859
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3860
|
+
output: z22.array(
|
|
3861
|
+
z22.object({
|
|
3862
|
+
stdout: z22.string(),
|
|
3863
|
+
stderr: z22.string(),
|
|
3864
|
+
outcome: z22.discriminatedUnion("type", [
|
|
3865
|
+
z22.object({ type: z22.literal("timeout") }),
|
|
3866
|
+
z22.object({
|
|
3867
|
+
type: z22.literal("exit"),
|
|
3868
|
+
exit_code: z22.number()
|
|
3783
3869
|
})
|
|
3784
3870
|
])
|
|
3785
3871
|
})
|
|
3786
3872
|
)
|
|
3787
3873
|
}),
|
|
3788
|
-
|
|
3789
|
-
type:
|
|
3790
|
-
id:
|
|
3791
|
-
execution:
|
|
3792
|
-
call_id:
|
|
3793
|
-
status:
|
|
3794
|
-
arguments:
|
|
3874
|
+
z22.object({
|
|
3875
|
+
type: z22.literal("tool_search_call"),
|
|
3876
|
+
id: z22.string(),
|
|
3877
|
+
execution: z22.enum(["server", "client"]),
|
|
3878
|
+
call_id: z22.string().nullable(),
|
|
3879
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3880
|
+
arguments: z22.unknown()
|
|
3795
3881
|
}),
|
|
3796
|
-
|
|
3797
|
-
type:
|
|
3798
|
-
id:
|
|
3799
|
-
execution:
|
|
3800
|
-
call_id:
|
|
3801
|
-
status:
|
|
3802
|
-
tools:
|
|
3882
|
+
z22.object({
|
|
3883
|
+
type: z22.literal("tool_search_output"),
|
|
3884
|
+
id: z22.string(),
|
|
3885
|
+
execution: z22.enum(["server", "client"]),
|
|
3886
|
+
call_id: z22.string().nullable(),
|
|
3887
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
3888
|
+
tools: z22.array(z22.record(z22.string(), jsonValueSchema2.optional()))
|
|
3803
3889
|
})
|
|
3804
3890
|
])
|
|
3805
3891
|
}),
|
|
3806
|
-
|
|
3807
|
-
type:
|
|
3808
|
-
item_id:
|
|
3809
|
-
output_index:
|
|
3810
|
-
delta:
|
|
3892
|
+
z22.object({
|
|
3893
|
+
type: z22.literal("response.function_call_arguments.delta"),
|
|
3894
|
+
item_id: z22.string(),
|
|
3895
|
+
output_index: z22.number(),
|
|
3896
|
+
delta: z22.string()
|
|
3811
3897
|
}),
|
|
3812
|
-
|
|
3813
|
-
type:
|
|
3814
|
-
item_id:
|
|
3815
|
-
output_index:
|
|
3816
|
-
delta:
|
|
3898
|
+
z22.object({
|
|
3899
|
+
type: z22.literal("response.custom_tool_call_input.delta"),
|
|
3900
|
+
item_id: z22.string(),
|
|
3901
|
+
output_index: z22.number(),
|
|
3902
|
+
delta: z22.string()
|
|
3817
3903
|
}),
|
|
3818
|
-
|
|
3819
|
-
type:
|
|
3820
|
-
item_id:
|
|
3821
|
-
output_index:
|
|
3822
|
-
partial_image_b64:
|
|
3904
|
+
z22.object({
|
|
3905
|
+
type: z22.literal("response.image_generation_call.partial_image"),
|
|
3906
|
+
item_id: z22.string(),
|
|
3907
|
+
output_index: z22.number(),
|
|
3908
|
+
partial_image_b64: z22.string()
|
|
3823
3909
|
}),
|
|
3824
|
-
|
|
3825
|
-
type:
|
|
3826
|
-
item_id:
|
|
3827
|
-
output_index:
|
|
3828
|
-
delta:
|
|
3910
|
+
z22.object({
|
|
3911
|
+
type: z22.literal("response.code_interpreter_call_code.delta"),
|
|
3912
|
+
item_id: z22.string(),
|
|
3913
|
+
output_index: z22.number(),
|
|
3914
|
+
delta: z22.string()
|
|
3829
3915
|
}),
|
|
3830
|
-
|
|
3831
|
-
type:
|
|
3832
|
-
item_id:
|
|
3833
|
-
output_index:
|
|
3834
|
-
code:
|
|
3916
|
+
z22.object({
|
|
3917
|
+
type: z22.literal("response.code_interpreter_call_code.done"),
|
|
3918
|
+
item_id: z22.string(),
|
|
3919
|
+
output_index: z22.number(),
|
|
3920
|
+
code: z22.string()
|
|
3835
3921
|
}),
|
|
3836
|
-
|
|
3837
|
-
type:
|
|
3838
|
-
annotation:
|
|
3839
|
-
|
|
3840
|
-
type:
|
|
3841
|
-
start_index:
|
|
3842
|
-
end_index:
|
|
3843
|
-
url:
|
|
3844
|
-
title:
|
|
3922
|
+
z22.object({
|
|
3923
|
+
type: z22.literal("response.output_text.annotation.added"),
|
|
3924
|
+
annotation: z22.discriminatedUnion("type", [
|
|
3925
|
+
z22.object({
|
|
3926
|
+
type: z22.literal("url_citation"),
|
|
3927
|
+
start_index: z22.number(),
|
|
3928
|
+
end_index: z22.number(),
|
|
3929
|
+
url: z22.string(),
|
|
3930
|
+
title: z22.string()
|
|
3845
3931
|
}),
|
|
3846
|
-
|
|
3847
|
-
type:
|
|
3848
|
-
file_id:
|
|
3849
|
-
filename:
|
|
3850
|
-
index:
|
|
3932
|
+
z22.object({
|
|
3933
|
+
type: z22.literal("file_citation"),
|
|
3934
|
+
file_id: z22.string(),
|
|
3935
|
+
filename: z22.string(),
|
|
3936
|
+
index: z22.number()
|
|
3851
3937
|
}),
|
|
3852
|
-
|
|
3853
|
-
type:
|
|
3854
|
-
container_id:
|
|
3855
|
-
file_id:
|
|
3856
|
-
filename:
|
|
3857
|
-
start_index:
|
|
3858
|
-
end_index:
|
|
3938
|
+
z22.object({
|
|
3939
|
+
type: z22.literal("container_file_citation"),
|
|
3940
|
+
container_id: z22.string(),
|
|
3941
|
+
file_id: z22.string(),
|
|
3942
|
+
filename: z22.string(),
|
|
3943
|
+
start_index: z22.number(),
|
|
3944
|
+
end_index: z22.number()
|
|
3859
3945
|
}),
|
|
3860
|
-
|
|
3861
|
-
type:
|
|
3862
|
-
file_id:
|
|
3863
|
-
index:
|
|
3946
|
+
z22.object({
|
|
3947
|
+
type: z22.literal("file_path"),
|
|
3948
|
+
file_id: z22.string(),
|
|
3949
|
+
index: z22.number()
|
|
3864
3950
|
})
|
|
3865
3951
|
])
|
|
3866
3952
|
}),
|
|
3867
|
-
|
|
3868
|
-
type:
|
|
3869
|
-
item_id:
|
|
3870
|
-
summary_index:
|
|
3953
|
+
z22.object({
|
|
3954
|
+
type: z22.literal("response.reasoning_summary_part.added"),
|
|
3955
|
+
item_id: z22.string(),
|
|
3956
|
+
summary_index: z22.number()
|
|
3871
3957
|
}),
|
|
3872
|
-
|
|
3873
|
-
type:
|
|
3874
|
-
item_id:
|
|
3875
|
-
summary_index:
|
|
3876
|
-
delta:
|
|
3958
|
+
z22.object({
|
|
3959
|
+
type: z22.literal("response.reasoning_summary_text.delta"),
|
|
3960
|
+
item_id: z22.string(),
|
|
3961
|
+
summary_index: z22.number(),
|
|
3962
|
+
delta: z22.string()
|
|
3877
3963
|
}),
|
|
3878
|
-
|
|
3879
|
-
type:
|
|
3880
|
-
item_id:
|
|
3881
|
-
summary_index:
|
|
3964
|
+
z22.object({
|
|
3965
|
+
type: z22.literal("response.reasoning_summary_part.done"),
|
|
3966
|
+
item_id: z22.string(),
|
|
3967
|
+
summary_index: z22.number()
|
|
3882
3968
|
}),
|
|
3883
|
-
|
|
3884
|
-
type:
|
|
3885
|
-
item_id:
|
|
3886
|
-
output_index:
|
|
3887
|
-
delta:
|
|
3888
|
-
obfuscation:
|
|
3969
|
+
z22.object({
|
|
3970
|
+
type: z22.literal("response.apply_patch_call_operation_diff.delta"),
|
|
3971
|
+
item_id: z22.string(),
|
|
3972
|
+
output_index: z22.number(),
|
|
3973
|
+
delta: z22.string(),
|
|
3974
|
+
obfuscation: z22.string().nullish()
|
|
3889
3975
|
}),
|
|
3890
|
-
|
|
3891
|
-
type:
|
|
3892
|
-
item_id:
|
|
3893
|
-
output_index:
|
|
3894
|
-
diff:
|
|
3976
|
+
z22.object({
|
|
3977
|
+
type: z22.literal("response.apply_patch_call_operation_diff.done"),
|
|
3978
|
+
item_id: z22.string(),
|
|
3979
|
+
output_index: z22.number(),
|
|
3980
|
+
diff: z22.string()
|
|
3895
3981
|
}),
|
|
3896
|
-
|
|
3897
|
-
type:
|
|
3898
|
-
sequence_number:
|
|
3899
|
-
error:
|
|
3900
|
-
type:
|
|
3901
|
-
code:
|
|
3902
|
-
message:
|
|
3903
|
-
param:
|
|
3982
|
+
z22.object({
|
|
3983
|
+
type: z22.literal("error"),
|
|
3984
|
+
sequence_number: z22.number(),
|
|
3985
|
+
error: z22.object({
|
|
3986
|
+
type: z22.string(),
|
|
3987
|
+
code: z22.string(),
|
|
3988
|
+
message: z22.string(),
|
|
3989
|
+
param: z22.string().nullish()
|
|
3904
3990
|
})
|
|
3905
3991
|
}),
|
|
3906
|
-
|
|
3992
|
+
z22.object({ type: z22.string() }).loose().transform((value) => ({
|
|
3907
3993
|
type: "unknown_chunk",
|
|
3908
3994
|
message: value.type
|
|
3909
3995
|
}))
|
|
@@ -3911,302 +3997,302 @@ var openaiResponsesChunkSchema = lazySchema19(
|
|
|
3911
3997
|
])
|
|
3912
3998
|
)
|
|
3913
3999
|
);
|
|
3914
|
-
var openaiResponsesResponseSchema =
|
|
3915
|
-
() =>
|
|
3916
|
-
|
|
3917
|
-
id:
|
|
3918
|
-
created_at:
|
|
3919
|
-
error:
|
|
3920
|
-
message:
|
|
3921
|
-
type:
|
|
3922
|
-
param:
|
|
3923
|
-
code:
|
|
4000
|
+
var openaiResponsesResponseSchema = lazySchema20(
|
|
4001
|
+
() => zodSchema20(
|
|
4002
|
+
z22.object({
|
|
4003
|
+
id: z22.string().optional(),
|
|
4004
|
+
created_at: z22.number().optional(),
|
|
4005
|
+
error: z22.object({
|
|
4006
|
+
message: z22.string(),
|
|
4007
|
+
type: z22.string(),
|
|
4008
|
+
param: z22.string().nullish(),
|
|
4009
|
+
code: z22.string()
|
|
3924
4010
|
}).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:
|
|
4011
|
+
model: z22.string().optional(),
|
|
4012
|
+
output: z22.array(
|
|
4013
|
+
z22.discriminatedUnion("type", [
|
|
4014
|
+
z22.object({
|
|
4015
|
+
type: z22.literal("message"),
|
|
4016
|
+
role: z22.literal("assistant"),
|
|
4017
|
+
id: z22.string(),
|
|
4018
|
+
phase: z22.enum(["commentary", "final_answer"]).nullish(),
|
|
4019
|
+
content: z22.array(
|
|
4020
|
+
z22.object({
|
|
4021
|
+
type: z22.literal("output_text"),
|
|
4022
|
+
text: z22.string(),
|
|
4023
|
+
logprobs: z22.array(
|
|
4024
|
+
z22.object({
|
|
4025
|
+
token: z22.string(),
|
|
4026
|
+
logprob: z22.number(),
|
|
4027
|
+
top_logprobs: z22.array(
|
|
4028
|
+
z22.object({
|
|
4029
|
+
token: z22.string(),
|
|
4030
|
+
logprob: z22.number()
|
|
3945
4031
|
})
|
|
3946
4032
|
)
|
|
3947
4033
|
})
|
|
3948
4034
|
).nullish(),
|
|
3949
|
-
annotations:
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
type:
|
|
3953
|
-
start_index:
|
|
3954
|
-
end_index:
|
|
3955
|
-
url:
|
|
3956
|
-
title:
|
|
4035
|
+
annotations: z22.array(
|
|
4036
|
+
z22.discriminatedUnion("type", [
|
|
4037
|
+
z22.object({
|
|
4038
|
+
type: z22.literal("url_citation"),
|
|
4039
|
+
start_index: z22.number(),
|
|
4040
|
+
end_index: z22.number(),
|
|
4041
|
+
url: z22.string(),
|
|
4042
|
+
title: z22.string()
|
|
3957
4043
|
}),
|
|
3958
|
-
|
|
3959
|
-
type:
|
|
3960
|
-
file_id:
|
|
3961
|
-
filename:
|
|
3962
|
-
index:
|
|
4044
|
+
z22.object({
|
|
4045
|
+
type: z22.literal("file_citation"),
|
|
4046
|
+
file_id: z22.string(),
|
|
4047
|
+
filename: z22.string(),
|
|
4048
|
+
index: z22.number()
|
|
3963
4049
|
}),
|
|
3964
|
-
|
|
3965
|
-
type:
|
|
3966
|
-
container_id:
|
|
3967
|
-
file_id:
|
|
3968
|
-
filename:
|
|
3969
|
-
start_index:
|
|
3970
|
-
end_index:
|
|
4050
|
+
z22.object({
|
|
4051
|
+
type: z22.literal("container_file_citation"),
|
|
4052
|
+
container_id: z22.string(),
|
|
4053
|
+
file_id: z22.string(),
|
|
4054
|
+
filename: z22.string(),
|
|
4055
|
+
start_index: z22.number(),
|
|
4056
|
+
end_index: z22.number()
|
|
3971
4057
|
}),
|
|
3972
|
-
|
|
3973
|
-
type:
|
|
3974
|
-
file_id:
|
|
3975
|
-
index:
|
|
4058
|
+
z22.object({
|
|
4059
|
+
type: z22.literal("file_path"),
|
|
4060
|
+
file_id: z22.string(),
|
|
4061
|
+
index: z22.number()
|
|
3976
4062
|
})
|
|
3977
4063
|
])
|
|
3978
4064
|
)
|
|
3979
4065
|
})
|
|
3980
4066
|
)
|
|
3981
4067
|
}),
|
|
3982
|
-
|
|
3983
|
-
type:
|
|
3984
|
-
id:
|
|
3985
|
-
status:
|
|
3986
|
-
action:
|
|
3987
|
-
|
|
3988
|
-
type:
|
|
3989
|
-
query:
|
|
3990
|
-
sources:
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
type:
|
|
3995
|
-
name:
|
|
4068
|
+
z22.object({
|
|
4069
|
+
type: z22.literal("web_search_call"),
|
|
4070
|
+
id: z22.string(),
|
|
4071
|
+
status: z22.string(),
|
|
4072
|
+
action: z22.discriminatedUnion("type", [
|
|
4073
|
+
z22.object({
|
|
4074
|
+
type: z22.literal("search"),
|
|
4075
|
+
query: z22.string().nullish(),
|
|
4076
|
+
sources: z22.array(
|
|
4077
|
+
z22.discriminatedUnion("type", [
|
|
4078
|
+
z22.object({ type: z22.literal("url"), url: z22.string() }),
|
|
4079
|
+
z22.object({
|
|
4080
|
+
type: z22.literal("api"),
|
|
4081
|
+
name: z22.string()
|
|
3996
4082
|
})
|
|
3997
4083
|
])
|
|
3998
4084
|
).nullish()
|
|
3999
4085
|
}),
|
|
4000
|
-
|
|
4001
|
-
type:
|
|
4002
|
-
url:
|
|
4086
|
+
z22.object({
|
|
4087
|
+
type: z22.literal("open_page"),
|
|
4088
|
+
url: z22.string().nullish()
|
|
4003
4089
|
}),
|
|
4004
|
-
|
|
4005
|
-
type:
|
|
4006
|
-
url:
|
|
4007
|
-
pattern:
|
|
4090
|
+
z22.object({
|
|
4091
|
+
type: z22.literal("find_in_page"),
|
|
4092
|
+
url: z22.string().nullish(),
|
|
4093
|
+
pattern: z22.string().nullish()
|
|
4008
4094
|
})
|
|
4009
4095
|
]).nullish()
|
|
4010
4096
|
}),
|
|
4011
|
-
|
|
4012
|
-
type:
|
|
4013
|
-
id:
|
|
4014
|
-
queries:
|
|
4015
|
-
results:
|
|
4016
|
-
|
|
4017
|
-
attributes:
|
|
4018
|
-
|
|
4019
|
-
|
|
4097
|
+
z22.object({
|
|
4098
|
+
type: z22.literal("file_search_call"),
|
|
4099
|
+
id: z22.string(),
|
|
4100
|
+
queries: z22.array(z22.string()),
|
|
4101
|
+
results: z22.array(
|
|
4102
|
+
z22.object({
|
|
4103
|
+
attributes: z22.record(
|
|
4104
|
+
z22.string(),
|
|
4105
|
+
z22.union([z22.string(), z22.number(), z22.boolean()])
|
|
4020
4106
|
),
|
|
4021
|
-
file_id:
|
|
4022
|
-
filename:
|
|
4023
|
-
score:
|
|
4024
|
-
text:
|
|
4107
|
+
file_id: z22.string(),
|
|
4108
|
+
filename: z22.string(),
|
|
4109
|
+
score: z22.number(),
|
|
4110
|
+
text: z22.string()
|
|
4025
4111
|
})
|
|
4026
4112
|
).nullish()
|
|
4027
4113
|
}),
|
|
4028
|
-
|
|
4029
|
-
type:
|
|
4030
|
-
id:
|
|
4031
|
-
code:
|
|
4032
|
-
container_id:
|
|
4033
|
-
outputs:
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4114
|
+
z22.object({
|
|
4115
|
+
type: z22.literal("code_interpreter_call"),
|
|
4116
|
+
id: z22.string(),
|
|
4117
|
+
code: z22.string().nullable(),
|
|
4118
|
+
container_id: z22.string(),
|
|
4119
|
+
outputs: z22.array(
|
|
4120
|
+
z22.discriminatedUnion("type", [
|
|
4121
|
+
z22.object({ type: z22.literal("logs"), logs: z22.string() }),
|
|
4122
|
+
z22.object({ type: z22.literal("image"), url: z22.string() })
|
|
4037
4123
|
])
|
|
4038
4124
|
).nullable()
|
|
4039
4125
|
}),
|
|
4040
|
-
|
|
4041
|
-
type:
|
|
4042
|
-
id:
|
|
4043
|
-
result:
|
|
4126
|
+
z22.object({
|
|
4127
|
+
type: z22.literal("image_generation_call"),
|
|
4128
|
+
id: z22.string(),
|
|
4129
|
+
result: z22.string()
|
|
4044
4130
|
}),
|
|
4045
|
-
|
|
4046
|
-
type:
|
|
4047
|
-
id:
|
|
4048
|
-
call_id:
|
|
4049
|
-
action:
|
|
4050
|
-
type:
|
|
4051
|
-
command:
|
|
4052
|
-
timeout_ms:
|
|
4053
|
-
user:
|
|
4054
|
-
working_directory:
|
|
4055
|
-
env:
|
|
4131
|
+
z22.object({
|
|
4132
|
+
type: z22.literal("local_shell_call"),
|
|
4133
|
+
id: z22.string(),
|
|
4134
|
+
call_id: z22.string(),
|
|
4135
|
+
action: z22.object({
|
|
4136
|
+
type: z22.literal("exec"),
|
|
4137
|
+
command: z22.array(z22.string()),
|
|
4138
|
+
timeout_ms: z22.number().optional(),
|
|
4139
|
+
user: z22.string().optional(),
|
|
4140
|
+
working_directory: z22.string().optional(),
|
|
4141
|
+
env: z22.record(z22.string(), z22.string()).optional()
|
|
4056
4142
|
})
|
|
4057
4143
|
}),
|
|
4058
|
-
|
|
4059
|
-
type:
|
|
4060
|
-
call_id:
|
|
4061
|
-
name:
|
|
4062
|
-
arguments:
|
|
4063
|
-
id:
|
|
4144
|
+
z22.object({
|
|
4145
|
+
type: z22.literal("function_call"),
|
|
4146
|
+
call_id: z22.string(),
|
|
4147
|
+
name: z22.string(),
|
|
4148
|
+
arguments: z22.string(),
|
|
4149
|
+
id: z22.string()
|
|
4064
4150
|
}),
|
|
4065
|
-
|
|
4066
|
-
type:
|
|
4067
|
-
call_id:
|
|
4068
|
-
name:
|
|
4069
|
-
input:
|
|
4070
|
-
id:
|
|
4151
|
+
z22.object({
|
|
4152
|
+
type: z22.literal("custom_tool_call"),
|
|
4153
|
+
call_id: z22.string(),
|
|
4154
|
+
name: z22.string(),
|
|
4155
|
+
input: z22.string(),
|
|
4156
|
+
id: z22.string()
|
|
4071
4157
|
}),
|
|
4072
|
-
|
|
4073
|
-
type:
|
|
4074
|
-
id:
|
|
4075
|
-
status:
|
|
4158
|
+
z22.object({
|
|
4159
|
+
type: z22.literal("computer_call"),
|
|
4160
|
+
id: z22.string(),
|
|
4161
|
+
status: z22.string().optional()
|
|
4076
4162
|
}),
|
|
4077
|
-
|
|
4078
|
-
type:
|
|
4079
|
-
id:
|
|
4080
|
-
encrypted_content:
|
|
4081
|
-
summary:
|
|
4082
|
-
|
|
4083
|
-
type:
|
|
4084
|
-
text:
|
|
4163
|
+
z22.object({
|
|
4164
|
+
type: z22.literal("reasoning"),
|
|
4165
|
+
id: z22.string(),
|
|
4166
|
+
encrypted_content: z22.string().nullish(),
|
|
4167
|
+
summary: z22.array(
|
|
4168
|
+
z22.object({
|
|
4169
|
+
type: z22.literal("summary_text"),
|
|
4170
|
+
text: z22.string()
|
|
4085
4171
|
})
|
|
4086
4172
|
)
|
|
4087
4173
|
}),
|
|
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:
|
|
4174
|
+
z22.object({
|
|
4175
|
+
type: z22.literal("mcp_call"),
|
|
4176
|
+
id: z22.string(),
|
|
4177
|
+
status: z22.string(),
|
|
4178
|
+
arguments: z22.string(),
|
|
4179
|
+
name: z22.string(),
|
|
4180
|
+
server_label: z22.string(),
|
|
4181
|
+
output: z22.string().nullish(),
|
|
4182
|
+
error: z22.union([
|
|
4183
|
+
z22.string(),
|
|
4184
|
+
z22.object({
|
|
4185
|
+
type: z22.string().optional(),
|
|
4186
|
+
code: z22.union([z22.number(), z22.string()]).optional(),
|
|
4187
|
+
message: z22.string().optional()
|
|
4102
4188
|
}).loose()
|
|
4103
4189
|
]).nullish(),
|
|
4104
|
-
approval_request_id:
|
|
4190
|
+
approval_request_id: z22.string().nullish()
|
|
4105
4191
|
}),
|
|
4106
|
-
|
|
4107
|
-
type:
|
|
4108
|
-
id:
|
|
4109
|
-
server_label:
|
|
4110
|
-
tools:
|
|
4111
|
-
|
|
4112
|
-
name:
|
|
4113
|
-
description:
|
|
4114
|
-
input_schema:
|
|
4115
|
-
annotations:
|
|
4192
|
+
z22.object({
|
|
4193
|
+
type: z22.literal("mcp_list_tools"),
|
|
4194
|
+
id: z22.string(),
|
|
4195
|
+
server_label: z22.string(),
|
|
4196
|
+
tools: z22.array(
|
|
4197
|
+
z22.object({
|
|
4198
|
+
name: z22.string(),
|
|
4199
|
+
description: z22.string().optional(),
|
|
4200
|
+
input_schema: z22.any(),
|
|
4201
|
+
annotations: z22.record(z22.string(), z22.unknown()).optional()
|
|
4116
4202
|
})
|
|
4117
4203
|
),
|
|
4118
|
-
error:
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
type:
|
|
4122
|
-
code:
|
|
4123
|
-
message:
|
|
4204
|
+
error: z22.union([
|
|
4205
|
+
z22.string(),
|
|
4206
|
+
z22.object({
|
|
4207
|
+
type: z22.string().optional(),
|
|
4208
|
+
code: z22.union([z22.number(), z22.string()]).optional(),
|
|
4209
|
+
message: z22.string().optional()
|
|
4124
4210
|
}).loose()
|
|
4125
4211
|
]).optional()
|
|
4126
4212
|
}),
|
|
4127
|
-
|
|
4128
|
-
type:
|
|
4129
|
-
id:
|
|
4130
|
-
server_label:
|
|
4131
|
-
name:
|
|
4132
|
-
arguments:
|
|
4133
|
-
approval_request_id:
|
|
4213
|
+
z22.object({
|
|
4214
|
+
type: z22.literal("mcp_approval_request"),
|
|
4215
|
+
id: z22.string(),
|
|
4216
|
+
server_label: z22.string(),
|
|
4217
|
+
name: z22.string(),
|
|
4218
|
+
arguments: z22.string(),
|
|
4219
|
+
approval_request_id: z22.string().optional()
|
|
4134
4220
|
}),
|
|
4135
|
-
|
|
4136
|
-
type:
|
|
4137
|
-
id:
|
|
4138
|
-
call_id:
|
|
4139
|
-
status:
|
|
4140
|
-
operation:
|
|
4141
|
-
|
|
4142
|
-
type:
|
|
4143
|
-
path:
|
|
4144
|
-
diff:
|
|
4221
|
+
z22.object({
|
|
4222
|
+
type: z22.literal("apply_patch_call"),
|
|
4223
|
+
id: z22.string(),
|
|
4224
|
+
call_id: z22.string(),
|
|
4225
|
+
status: z22.enum(["in_progress", "completed"]),
|
|
4226
|
+
operation: z22.discriminatedUnion("type", [
|
|
4227
|
+
z22.object({
|
|
4228
|
+
type: z22.literal("create_file"),
|
|
4229
|
+
path: z22.string(),
|
|
4230
|
+
diff: z22.string()
|
|
4145
4231
|
}),
|
|
4146
|
-
|
|
4147
|
-
type:
|
|
4148
|
-
path:
|
|
4232
|
+
z22.object({
|
|
4233
|
+
type: z22.literal("delete_file"),
|
|
4234
|
+
path: z22.string()
|
|
4149
4235
|
}),
|
|
4150
|
-
|
|
4151
|
-
type:
|
|
4152
|
-
path:
|
|
4153
|
-
diff:
|
|
4236
|
+
z22.object({
|
|
4237
|
+
type: z22.literal("update_file"),
|
|
4238
|
+
path: z22.string(),
|
|
4239
|
+
diff: z22.string()
|
|
4154
4240
|
})
|
|
4155
4241
|
])
|
|
4156
4242
|
}),
|
|
4157
|
-
|
|
4158
|
-
type:
|
|
4159
|
-
id:
|
|
4160
|
-
call_id:
|
|
4161
|
-
status:
|
|
4162
|
-
action:
|
|
4163
|
-
commands:
|
|
4243
|
+
z22.object({
|
|
4244
|
+
type: z22.literal("shell_call"),
|
|
4245
|
+
id: z22.string(),
|
|
4246
|
+
call_id: z22.string(),
|
|
4247
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
4248
|
+
action: z22.object({
|
|
4249
|
+
commands: z22.array(z22.string())
|
|
4164
4250
|
})
|
|
4165
4251
|
}),
|
|
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:
|
|
4252
|
+
z22.object({
|
|
4253
|
+
type: z22.literal("shell_call_output"),
|
|
4254
|
+
id: z22.string(),
|
|
4255
|
+
call_id: z22.string(),
|
|
4256
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
4257
|
+
output: z22.array(
|
|
4258
|
+
z22.object({
|
|
4259
|
+
stdout: z22.string(),
|
|
4260
|
+
stderr: z22.string(),
|
|
4261
|
+
outcome: z22.discriminatedUnion("type", [
|
|
4262
|
+
z22.object({ type: z22.literal("timeout") }),
|
|
4263
|
+
z22.object({
|
|
4264
|
+
type: z22.literal("exit"),
|
|
4265
|
+
exit_code: z22.number()
|
|
4180
4266
|
})
|
|
4181
4267
|
])
|
|
4182
4268
|
})
|
|
4183
4269
|
)
|
|
4184
4270
|
}),
|
|
4185
|
-
|
|
4186
|
-
type:
|
|
4187
|
-
id:
|
|
4188
|
-
execution:
|
|
4189
|
-
call_id:
|
|
4190
|
-
status:
|
|
4191
|
-
arguments:
|
|
4271
|
+
z22.object({
|
|
4272
|
+
type: z22.literal("tool_search_call"),
|
|
4273
|
+
id: z22.string(),
|
|
4274
|
+
execution: z22.enum(["server", "client"]),
|
|
4275
|
+
call_id: z22.string().nullable(),
|
|
4276
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
4277
|
+
arguments: z22.unknown()
|
|
4192
4278
|
}),
|
|
4193
|
-
|
|
4194
|
-
type:
|
|
4195
|
-
id:
|
|
4196
|
-
execution:
|
|
4197
|
-
call_id:
|
|
4198
|
-
status:
|
|
4199
|
-
tools:
|
|
4279
|
+
z22.object({
|
|
4280
|
+
type: z22.literal("tool_search_output"),
|
|
4281
|
+
id: z22.string(),
|
|
4282
|
+
execution: z22.enum(["server", "client"]),
|
|
4283
|
+
call_id: z22.string().nullable(),
|
|
4284
|
+
status: z22.enum(["in_progress", "completed", "incomplete"]),
|
|
4285
|
+
tools: z22.array(z22.record(z22.string(), jsonValueSchema2.optional()))
|
|
4200
4286
|
})
|
|
4201
4287
|
])
|
|
4202
4288
|
).optional(),
|
|
4203
|
-
service_tier:
|
|
4204
|
-
incomplete_details:
|
|
4205
|
-
usage:
|
|
4206
|
-
input_tokens:
|
|
4207
|
-
input_tokens_details:
|
|
4208
|
-
output_tokens:
|
|
4209
|
-
output_tokens_details:
|
|
4289
|
+
service_tier: z22.string().nullish(),
|
|
4290
|
+
incomplete_details: z22.object({ reason: z22.string() }).nullish(),
|
|
4291
|
+
usage: z22.object({
|
|
4292
|
+
input_tokens: z22.number(),
|
|
4293
|
+
input_tokens_details: z22.object({ cached_tokens: z22.number().nullish() }).nullish(),
|
|
4294
|
+
output_tokens: z22.number(),
|
|
4295
|
+
output_tokens_details: z22.object({ reasoning_tokens: z22.number().nullish() }).nullish()
|
|
4210
4296
|
}).optional()
|
|
4211
4297
|
})
|
|
4212
4298
|
)
|
|
@@ -4214,10 +4300,10 @@ var openaiResponsesResponseSchema = lazySchema19(
|
|
|
4214
4300
|
|
|
4215
4301
|
// src/responses/openai-responses-options.ts
|
|
4216
4302
|
import {
|
|
4217
|
-
lazySchema as
|
|
4218
|
-
zodSchema as
|
|
4303
|
+
lazySchema as lazySchema21,
|
|
4304
|
+
zodSchema as zodSchema21
|
|
4219
4305
|
} from "@ai-sdk/provider-utils";
|
|
4220
|
-
import { z as
|
|
4306
|
+
import { z as z23 } from "zod/v4";
|
|
4221
4307
|
var TOP_LOGPROBS_MAX = 20;
|
|
4222
4308
|
var openaiResponsesReasoningModelIds = [
|
|
4223
4309
|
"o1",
|
|
@@ -4282,9 +4368,9 @@ var openaiResponsesModelIds = [
|
|
|
4282
4368
|
"gpt-5-chat-latest",
|
|
4283
4369
|
...openaiResponsesReasoningModelIds
|
|
4284
4370
|
];
|
|
4285
|
-
var openaiLanguageModelResponsesOptionsSchema =
|
|
4286
|
-
() =>
|
|
4287
|
-
|
|
4371
|
+
var openaiLanguageModelResponsesOptionsSchema = lazySchema21(
|
|
4372
|
+
() => zodSchema21(
|
|
4373
|
+
z23.object({
|
|
4288
4374
|
/**
|
|
4289
4375
|
* The ID of the OpenAI Conversation to continue.
|
|
4290
4376
|
* You must create a conversation first via the OpenAI API.
|
|
@@ -4292,13 +4378,13 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4292
4378
|
* Defaults to `undefined`.
|
|
4293
4379
|
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
4294
4380
|
*/
|
|
4295
|
-
conversation:
|
|
4381
|
+
conversation: z23.string().nullish(),
|
|
4296
4382
|
/**
|
|
4297
4383
|
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
4298
4384
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
|
|
4299
4385
|
*/
|
|
4300
|
-
include:
|
|
4301
|
-
|
|
4386
|
+
include: z23.array(
|
|
4387
|
+
z23.enum([
|
|
4302
4388
|
"reasoning.encrypted_content",
|
|
4303
4389
|
// handled internally by default, only needed for unknown reasoning models
|
|
4304
4390
|
"file_search_call.results",
|
|
@@ -4310,7 +4396,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4310
4396
|
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
4311
4397
|
* Defaults to `undefined`.
|
|
4312
4398
|
*/
|
|
4313
|
-
instructions:
|
|
4399
|
+
instructions: z23.string().nullish(),
|
|
4314
4400
|
/**
|
|
4315
4401
|
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
4316
4402
|
* the response size and can slow down response times. However, it can
|
|
@@ -4325,30 +4411,30 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4325
4411
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
4326
4412
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
4327
4413
|
*/
|
|
4328
|
-
logprobs:
|
|
4414
|
+
logprobs: z23.union([z23.boolean(), z23.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
4329
4415
|
/**
|
|
4330
4416
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
4331
4417
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
4332
4418
|
* Any further attempts to call a tool by the model will be ignored.
|
|
4333
4419
|
*/
|
|
4334
|
-
maxToolCalls:
|
|
4420
|
+
maxToolCalls: z23.number().nullish(),
|
|
4335
4421
|
/**
|
|
4336
4422
|
* Additional metadata to store with the generation.
|
|
4337
4423
|
*/
|
|
4338
|
-
metadata:
|
|
4424
|
+
metadata: z23.any().nullish(),
|
|
4339
4425
|
/**
|
|
4340
4426
|
* Whether to use parallel tool calls. Defaults to `true`.
|
|
4341
4427
|
*/
|
|
4342
|
-
parallelToolCalls:
|
|
4428
|
+
parallelToolCalls: z23.boolean().nullish(),
|
|
4343
4429
|
/**
|
|
4344
4430
|
* The ID of the previous response. You can use it to continue a conversation.
|
|
4345
4431
|
* Defaults to `undefined`.
|
|
4346
4432
|
*/
|
|
4347
|
-
previousResponseId:
|
|
4433
|
+
previousResponseId: z23.string().nullish(),
|
|
4348
4434
|
/**
|
|
4349
4435
|
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
4350
4436
|
*/
|
|
4351
|
-
promptCacheKey:
|
|
4437
|
+
promptCacheKey: z23.string().nullish(),
|
|
4352
4438
|
/**
|
|
4353
4439
|
* The retention policy for the prompt cache.
|
|
4354
4440
|
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
@@ -4357,7 +4443,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4357
4443
|
*
|
|
4358
4444
|
* @default 'in_memory'
|
|
4359
4445
|
*/
|
|
4360
|
-
promptCacheRetention:
|
|
4446
|
+
promptCacheRetention: z23.enum(["in_memory", "24h"]).nullish(),
|
|
4361
4447
|
/**
|
|
4362
4448
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
4363
4449
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
@@ -4368,17 +4454,17 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4368
4454
|
* OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
|
|
4369
4455
|
* an error.
|
|
4370
4456
|
*/
|
|
4371
|
-
reasoningEffort:
|
|
4457
|
+
reasoningEffort: z23.string().nullish(),
|
|
4372
4458
|
/**
|
|
4373
4459
|
* Controls reasoning summary output from the model.
|
|
4374
4460
|
* Set to "auto" to automatically receive the richest level available,
|
|
4375
4461
|
* or "detailed" for comprehensive summaries.
|
|
4376
4462
|
*/
|
|
4377
|
-
reasoningSummary:
|
|
4463
|
+
reasoningSummary: z23.string().nullish(),
|
|
4378
4464
|
/**
|
|
4379
4465
|
* The identifier for safety monitoring and tracking.
|
|
4380
4466
|
*/
|
|
4381
|
-
safetyIdentifier:
|
|
4467
|
+
safetyIdentifier: z23.string().nullish(),
|
|
4382
4468
|
/**
|
|
4383
4469
|
* Service tier for the request.
|
|
4384
4470
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
@@ -4386,34 +4472,34 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4386
4472
|
*
|
|
4387
4473
|
* Defaults to 'auto'.
|
|
4388
4474
|
*/
|
|
4389
|
-
serviceTier:
|
|
4475
|
+
serviceTier: z23.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
4390
4476
|
/**
|
|
4391
4477
|
* Whether to store the generation. Defaults to `true`.
|
|
4392
4478
|
*/
|
|
4393
|
-
store:
|
|
4479
|
+
store: z23.boolean().nullish(),
|
|
4394
4480
|
/**
|
|
4395
4481
|
* Whether to use strict JSON schema validation.
|
|
4396
4482
|
* Defaults to `true`.
|
|
4397
4483
|
*/
|
|
4398
|
-
strictJsonSchema:
|
|
4484
|
+
strictJsonSchema: z23.boolean().nullish(),
|
|
4399
4485
|
/**
|
|
4400
4486
|
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
4401
4487
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
4402
4488
|
* Valid values: 'low', 'medium', 'high'.
|
|
4403
4489
|
*/
|
|
4404
|
-
textVerbosity:
|
|
4490
|
+
textVerbosity: z23.enum(["low", "medium", "high"]).nullish(),
|
|
4405
4491
|
/**
|
|
4406
4492
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
4407
4493
|
* 'disabled' turns truncation off.
|
|
4408
4494
|
*/
|
|
4409
|
-
truncation:
|
|
4495
|
+
truncation: z23.enum(["auto", "disabled"]).nullish(),
|
|
4410
4496
|
/**
|
|
4411
4497
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
4412
4498
|
* monitor and detect abuse.
|
|
4413
4499
|
* Defaults to `undefined`.
|
|
4414
4500
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
4415
4501
|
*/
|
|
4416
|
-
user:
|
|
4502
|
+
user: z23.string().nullish(),
|
|
4417
4503
|
/**
|
|
4418
4504
|
* Override the system message mode for this model.
|
|
4419
4505
|
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
@@ -4422,7 +4508,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4422
4508
|
*
|
|
4423
4509
|
* If not specified, the mode is automatically determined based on the model.
|
|
4424
4510
|
*/
|
|
4425
|
-
systemMessageMode:
|
|
4511
|
+
systemMessageMode: z23.enum(["system", "developer", "remove"]).optional(),
|
|
4426
4512
|
/**
|
|
4427
4513
|
* Force treating this model as a reasoning model.
|
|
4428
4514
|
*
|
|
@@ -4432,7 +4518,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
|
4432
4518
|
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
4433
4519
|
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
4434
4520
|
*/
|
|
4435
|
-
forceReasoning:
|
|
4521
|
+
forceReasoning: z23.boolean().optional()
|
|
4436
4522
|
})
|
|
4437
4523
|
)
|
|
4438
4524
|
);
|
|
@@ -4774,13 +4860,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4774
4860
|
warnings.push({ type: "unsupported", feature: "stopSequences" });
|
|
4775
4861
|
}
|
|
4776
4862
|
const providerOptionsName = this.config.provider.includes("azure") ? "azure" : "openai";
|
|
4777
|
-
let openaiOptions = await
|
|
4863
|
+
let openaiOptions = await parseProviderOptions6({
|
|
4778
4864
|
provider: providerOptionsName,
|
|
4779
4865
|
providerOptions,
|
|
4780
4866
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
4781
4867
|
});
|
|
4782
4868
|
if (openaiOptions == null && providerOptionsName !== "openai") {
|
|
4783
|
-
openaiOptions = await
|
|
4869
|
+
openaiOptions = await parseProviderOptions6({
|
|
4784
4870
|
provider: "openai",
|
|
4785
4871
|
providerOptions,
|
|
4786
4872
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
@@ -6406,21 +6492,21 @@ function escapeJSONDelta(delta) {
|
|
|
6406
6492
|
import {
|
|
6407
6493
|
combineHeaders as combineHeaders6,
|
|
6408
6494
|
createBinaryResponseHandler,
|
|
6409
|
-
parseProviderOptions as
|
|
6495
|
+
parseProviderOptions as parseProviderOptions7,
|
|
6410
6496
|
postJsonToApi as postJsonToApi6
|
|
6411
6497
|
} from "@ai-sdk/provider-utils";
|
|
6412
6498
|
|
|
6413
6499
|
// src/speech/openai-speech-options.ts
|
|
6414
6500
|
import {
|
|
6415
|
-
lazySchema as
|
|
6416
|
-
zodSchema as
|
|
6501
|
+
lazySchema as lazySchema22,
|
|
6502
|
+
zodSchema as zodSchema22
|
|
6417
6503
|
} from "@ai-sdk/provider-utils";
|
|
6418
|
-
import { z as
|
|
6419
|
-
var openaiSpeechModelOptionsSchema =
|
|
6420
|
-
() =>
|
|
6421
|
-
|
|
6422
|
-
instructions:
|
|
6423
|
-
speed:
|
|
6504
|
+
import { z as z24 } from "zod/v4";
|
|
6505
|
+
var openaiSpeechModelOptionsSchema = lazySchema22(
|
|
6506
|
+
() => zodSchema22(
|
|
6507
|
+
z24.object({
|
|
6508
|
+
instructions: z24.string().nullish(),
|
|
6509
|
+
speed: z24.number().min(0.25).max(4).default(1).nullish()
|
|
6424
6510
|
})
|
|
6425
6511
|
)
|
|
6426
6512
|
);
|
|
@@ -6445,7 +6531,7 @@ var OpenAISpeechModel = class {
|
|
|
6445
6531
|
providerOptions
|
|
6446
6532
|
}) {
|
|
6447
6533
|
const warnings = [];
|
|
6448
|
-
const openAIOptions = await
|
|
6534
|
+
const openAIOptions = await parseProviderOptions7({
|
|
6449
6535
|
provider: "openai",
|
|
6450
6536
|
providerOptions,
|
|
6451
6537
|
schema: openaiSpeechModelOptionsSchema
|
|
@@ -6532,38 +6618,38 @@ import {
|
|
|
6532
6618
|
convertBase64ToUint8Array as convertBase64ToUint8Array2,
|
|
6533
6619
|
createJsonResponseHandler as createJsonResponseHandler6,
|
|
6534
6620
|
mediaTypeToExtension,
|
|
6535
|
-
parseProviderOptions as
|
|
6621
|
+
parseProviderOptions as parseProviderOptions8,
|
|
6536
6622
|
postFormDataToApi as postFormDataToApi2
|
|
6537
6623
|
} from "@ai-sdk/provider-utils";
|
|
6538
6624
|
|
|
6539
6625
|
// 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:
|
|
6626
|
+
import { lazySchema as lazySchema23, zodSchema as zodSchema23 } from "@ai-sdk/provider-utils";
|
|
6627
|
+
import { z as z25 } from "zod/v4";
|
|
6628
|
+
var openaiTranscriptionResponseSchema = lazySchema23(
|
|
6629
|
+
() => zodSchema23(
|
|
6630
|
+
z25.object({
|
|
6631
|
+
text: z25.string(),
|
|
6632
|
+
language: z25.string().nullish(),
|
|
6633
|
+
duration: z25.number().nullish(),
|
|
6634
|
+
words: z25.array(
|
|
6635
|
+
z25.object({
|
|
6636
|
+
word: z25.string(),
|
|
6637
|
+
start: z25.number(),
|
|
6638
|
+
end: z25.number()
|
|
6553
6639
|
})
|
|
6554
6640
|
).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:
|
|
6641
|
+
segments: z25.array(
|
|
6642
|
+
z25.object({
|
|
6643
|
+
id: z25.number(),
|
|
6644
|
+
seek: z25.number(),
|
|
6645
|
+
start: z25.number(),
|
|
6646
|
+
end: z25.number(),
|
|
6647
|
+
text: z25.string(),
|
|
6648
|
+
tokens: z25.array(z25.number()),
|
|
6649
|
+
temperature: z25.number(),
|
|
6650
|
+
avg_logprob: z25.number(),
|
|
6651
|
+
compression_ratio: z25.number(),
|
|
6652
|
+
no_speech_prob: z25.number()
|
|
6567
6653
|
})
|
|
6568
6654
|
).nullish()
|
|
6569
6655
|
})
|
|
@@ -6572,35 +6658,35 @@ var openaiTranscriptionResponseSchema = lazySchema22(
|
|
|
6572
6658
|
|
|
6573
6659
|
// src/transcription/openai-transcription-options.ts
|
|
6574
6660
|
import {
|
|
6575
|
-
lazySchema as
|
|
6576
|
-
zodSchema as
|
|
6661
|
+
lazySchema as lazySchema24,
|
|
6662
|
+
zodSchema as zodSchema24
|
|
6577
6663
|
} from "@ai-sdk/provider-utils";
|
|
6578
|
-
import { z as
|
|
6579
|
-
var openAITranscriptionModelOptions =
|
|
6580
|
-
() =>
|
|
6581
|
-
|
|
6664
|
+
import { z as z26 } from "zod/v4";
|
|
6665
|
+
var openAITranscriptionModelOptions = lazySchema24(
|
|
6666
|
+
() => zodSchema24(
|
|
6667
|
+
z26.object({
|
|
6582
6668
|
/**
|
|
6583
6669
|
* Additional information to include in the transcription response.
|
|
6584
6670
|
*/
|
|
6585
|
-
include:
|
|
6671
|
+
include: z26.array(z26.string()).optional(),
|
|
6586
6672
|
/**
|
|
6587
6673
|
* The language of the input audio in ISO-639-1 format.
|
|
6588
6674
|
*/
|
|
6589
|
-
language:
|
|
6675
|
+
language: z26.string().optional(),
|
|
6590
6676
|
/**
|
|
6591
6677
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
6592
6678
|
*/
|
|
6593
|
-
prompt:
|
|
6679
|
+
prompt: z26.string().optional(),
|
|
6594
6680
|
/**
|
|
6595
6681
|
* The sampling temperature, between 0 and 1.
|
|
6596
6682
|
* @default 0
|
|
6597
6683
|
*/
|
|
6598
|
-
temperature:
|
|
6684
|
+
temperature: z26.number().min(0).max(1).default(0).optional(),
|
|
6599
6685
|
/**
|
|
6600
6686
|
* The timestamp granularities to populate for this transcription.
|
|
6601
6687
|
* @default ['segment']
|
|
6602
6688
|
*/
|
|
6603
|
-
timestampGranularities:
|
|
6689
|
+
timestampGranularities: z26.array(z26.enum(["word", "segment"])).default(["segment"]).optional()
|
|
6604
6690
|
})
|
|
6605
6691
|
)
|
|
6606
6692
|
);
|
|
@@ -6680,7 +6766,7 @@ var OpenAITranscriptionModel = class {
|
|
|
6680
6766
|
providerOptions
|
|
6681
6767
|
}) {
|
|
6682
6768
|
const warnings = [];
|
|
6683
|
-
const openAIOptions = await
|
|
6769
|
+
const openAIOptions = await parseProviderOptions8({
|
|
6684
6770
|
provider: "openai",
|
|
6685
6771
|
providerOptions,
|
|
6686
6772
|
schema: openAITranscriptionModelOptions
|
|
@@ -6773,7 +6859,7 @@ var OpenAITranscriptionModel = class {
|
|
|
6773
6859
|
};
|
|
6774
6860
|
|
|
6775
6861
|
// src/version.ts
|
|
6776
|
-
var VERSION = true ? "3.0.
|
|
6862
|
+
var VERSION = true ? "3.0.57" : "0.0.0-test";
|
|
6777
6863
|
|
|
6778
6864
|
// src/openai-provider.ts
|
|
6779
6865
|
function createOpenAI(options = {}) {
|