@ai-sdk/openai 3.0.36 → 3.0.38
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 +14 -0
- package/README.md +1 -1
- package/dist/index.d.mts +53 -3
- package/dist/index.d.ts +53 -3
- package/dist/index.js +1168 -966
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1118 -912
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +20 -2
- package/dist/internal/index.d.ts +20 -2
- package/dist/internal/index.js +349 -158
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +327 -132
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +79 -1
- package/package.json +2 -2
- package/src/chat/openai-chat-options.ts +0 -5
- package/src/openai-language-model-capabilities.ts +0 -2
- package/src/openai-tools.ts +13 -1
- package/src/responses/convert-to-openai-responses-input.ts +74 -0
- package/src/responses/openai-responses-api.ts +58 -0
- package/src/responses/openai-responses-language-model.ts +94 -9
- package/src/responses/openai-responses-options.ts +0 -22
- package/src/responses/openai-responses-prepare-tools.ts +41 -11
- package/src/tool/custom.ts +64 -0
package/dist/index.mjs
CHANGED
|
@@ -43,7 +43,7 @@ var openaiFailedResponseHandler = createJsonErrorResponseHandler({
|
|
|
43
43
|
function getOpenAILanguageModelCapabilities(modelId) {
|
|
44
44
|
const supportsFlexProcessing = modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
|
|
45
45
|
const supportsPriorityProcessing = modelId.startsWith("gpt-4") || modelId.startsWith("gpt-5-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-nano") && !modelId.startsWith("gpt-5-chat") || modelId.startsWith("o3") || modelId.startsWith("o4-mini");
|
|
46
|
-
const isReasoningModel = modelId.startsWith("o1") || modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("
|
|
46
|
+
const isReasoningModel = modelId.startsWith("o1") || modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
|
|
47
47
|
const supportsNonReasoningParameters = modelId.startsWith("gpt-5.1") || modelId.startsWith("gpt-5.2");
|
|
48
48
|
const systemMessageMode = isReasoningModel ? "developer" : "system";
|
|
49
49
|
return {
|
|
@@ -2066,48 +2066,80 @@ var codeInterpreter = (args = {}) => {
|
|
|
2066
2066
|
return codeInterpreterToolFactory(args);
|
|
2067
2067
|
};
|
|
2068
2068
|
|
|
2069
|
-
// src/tool/
|
|
2069
|
+
// src/tool/custom.ts
|
|
2070
2070
|
import {
|
|
2071
|
-
|
|
2071
|
+
createProviderToolFactory,
|
|
2072
2072
|
lazySchema as lazySchema10,
|
|
2073
2073
|
zodSchema as zodSchema10
|
|
2074
2074
|
} from "@ai-sdk/provider-utils";
|
|
2075
2075
|
import { z as z11 } from "zod/v4";
|
|
2076
|
-
var
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2076
|
+
var customArgsSchema = lazySchema10(
|
|
2077
|
+
() => zodSchema10(
|
|
2078
|
+
z11.object({
|
|
2079
|
+
name: z11.string(),
|
|
2080
|
+
description: z11.string().optional(),
|
|
2081
|
+
format: z11.union([
|
|
2082
|
+
z11.object({
|
|
2083
|
+
type: z11.literal("grammar"),
|
|
2084
|
+
syntax: z11.enum(["regex", "lark"]),
|
|
2085
|
+
definition: z11.string()
|
|
2086
|
+
}),
|
|
2087
|
+
z11.object({
|
|
2088
|
+
type: z11.literal("text")
|
|
2089
|
+
})
|
|
2090
|
+
]).optional()
|
|
2091
|
+
})
|
|
2092
|
+
)
|
|
2093
|
+
);
|
|
2094
|
+
var customInputSchema = lazySchema10(() => zodSchema10(z11.string()));
|
|
2095
|
+
var customToolFactory = createProviderToolFactory({
|
|
2096
|
+
id: "openai.custom",
|
|
2097
|
+
inputSchema: customInputSchema
|
|
2080
2098
|
});
|
|
2081
|
-
var
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2099
|
+
var customTool = (args) => customToolFactory(args);
|
|
2100
|
+
|
|
2101
|
+
// src/tool/file-search.ts
|
|
2102
|
+
import {
|
|
2103
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
|
|
2104
|
+
lazySchema as lazySchema11,
|
|
2105
|
+
zodSchema as zodSchema11
|
|
2106
|
+
} from "@ai-sdk/provider-utils";
|
|
2107
|
+
import { z as z12 } from "zod/v4";
|
|
2108
|
+
var comparisonFilterSchema = z12.object({
|
|
2109
|
+
key: z12.string(),
|
|
2110
|
+
type: z12.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
2111
|
+
value: z12.union([z12.string(), z12.number(), z12.boolean(), z12.array(z12.string())])
|
|
2112
|
+
});
|
|
2113
|
+
var compoundFilterSchema = z12.object({
|
|
2114
|
+
type: z12.enum(["and", "or"]),
|
|
2115
|
+
filters: z12.array(
|
|
2116
|
+
z12.union([comparisonFilterSchema, z12.lazy(() => compoundFilterSchema)])
|
|
2085
2117
|
)
|
|
2086
2118
|
});
|
|
2087
|
-
var fileSearchArgsSchema =
|
|
2088
|
-
() =>
|
|
2089
|
-
|
|
2090
|
-
vectorStoreIds:
|
|
2091
|
-
maxNumResults:
|
|
2092
|
-
ranking:
|
|
2093
|
-
ranker:
|
|
2094
|
-
scoreThreshold:
|
|
2119
|
+
var fileSearchArgsSchema = lazySchema11(
|
|
2120
|
+
() => zodSchema11(
|
|
2121
|
+
z12.object({
|
|
2122
|
+
vectorStoreIds: z12.array(z12.string()),
|
|
2123
|
+
maxNumResults: z12.number().optional(),
|
|
2124
|
+
ranking: z12.object({
|
|
2125
|
+
ranker: z12.string().optional(),
|
|
2126
|
+
scoreThreshold: z12.number().optional()
|
|
2095
2127
|
}).optional(),
|
|
2096
|
-
filters:
|
|
2128
|
+
filters: z12.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
2097
2129
|
})
|
|
2098
2130
|
)
|
|
2099
2131
|
);
|
|
2100
|
-
var fileSearchOutputSchema =
|
|
2101
|
-
() =>
|
|
2102
|
-
|
|
2103
|
-
queries:
|
|
2104
|
-
results:
|
|
2105
|
-
|
|
2106
|
-
attributes:
|
|
2107
|
-
fileId:
|
|
2108
|
-
filename:
|
|
2109
|
-
score:
|
|
2110
|
-
text:
|
|
2132
|
+
var fileSearchOutputSchema = lazySchema11(
|
|
2133
|
+
() => zodSchema11(
|
|
2134
|
+
z12.object({
|
|
2135
|
+
queries: z12.array(z12.string()),
|
|
2136
|
+
results: z12.array(
|
|
2137
|
+
z12.object({
|
|
2138
|
+
attributes: z12.record(z12.string(), z12.unknown()),
|
|
2139
|
+
fileId: z12.string(),
|
|
2140
|
+
filename: z12.string(),
|
|
2141
|
+
score: z12.number(),
|
|
2142
|
+
text: z12.string()
|
|
2111
2143
|
})
|
|
2112
2144
|
).nullable()
|
|
2113
2145
|
})
|
|
@@ -2115,39 +2147,39 @@ var fileSearchOutputSchema = lazySchema10(
|
|
|
2115
2147
|
);
|
|
2116
2148
|
var fileSearch = createProviderToolFactoryWithOutputSchema3({
|
|
2117
2149
|
id: "openai.file_search",
|
|
2118
|
-
inputSchema:
|
|
2150
|
+
inputSchema: z12.object({}),
|
|
2119
2151
|
outputSchema: fileSearchOutputSchema
|
|
2120
2152
|
});
|
|
2121
2153
|
|
|
2122
2154
|
// src/tool/image-generation.ts
|
|
2123
2155
|
import {
|
|
2124
2156
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
|
|
2125
|
-
lazySchema as
|
|
2126
|
-
zodSchema as
|
|
2157
|
+
lazySchema as lazySchema12,
|
|
2158
|
+
zodSchema as zodSchema12
|
|
2127
2159
|
} from "@ai-sdk/provider-utils";
|
|
2128
|
-
import { z as
|
|
2129
|
-
var imageGenerationArgsSchema =
|
|
2130
|
-
() =>
|
|
2131
|
-
|
|
2132
|
-
background:
|
|
2133
|
-
inputFidelity:
|
|
2134
|
-
inputImageMask:
|
|
2135
|
-
fileId:
|
|
2136
|
-
imageUrl:
|
|
2160
|
+
import { z as z13 } from "zod/v4";
|
|
2161
|
+
var imageGenerationArgsSchema = lazySchema12(
|
|
2162
|
+
() => zodSchema12(
|
|
2163
|
+
z13.object({
|
|
2164
|
+
background: z13.enum(["auto", "opaque", "transparent"]).optional(),
|
|
2165
|
+
inputFidelity: z13.enum(["low", "high"]).optional(),
|
|
2166
|
+
inputImageMask: z13.object({
|
|
2167
|
+
fileId: z13.string().optional(),
|
|
2168
|
+
imageUrl: z13.string().optional()
|
|
2137
2169
|
}).optional(),
|
|
2138
|
-
model:
|
|
2139
|
-
moderation:
|
|
2140
|
-
outputCompression:
|
|
2141
|
-
outputFormat:
|
|
2142
|
-
partialImages:
|
|
2143
|
-
quality:
|
|
2144
|
-
size:
|
|
2170
|
+
model: z13.string().optional(),
|
|
2171
|
+
moderation: z13.enum(["auto"]).optional(),
|
|
2172
|
+
outputCompression: z13.number().int().min(0).max(100).optional(),
|
|
2173
|
+
outputFormat: z13.enum(["png", "jpeg", "webp"]).optional(),
|
|
2174
|
+
partialImages: z13.number().int().min(0).max(3).optional(),
|
|
2175
|
+
quality: z13.enum(["auto", "low", "medium", "high"]).optional(),
|
|
2176
|
+
size: z13.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
2145
2177
|
}).strict()
|
|
2146
2178
|
)
|
|
2147
2179
|
);
|
|
2148
|
-
var imageGenerationInputSchema =
|
|
2149
|
-
var imageGenerationOutputSchema =
|
|
2150
|
-
() =>
|
|
2180
|
+
var imageGenerationInputSchema = lazySchema12(() => zodSchema12(z13.object({})));
|
|
2181
|
+
var imageGenerationOutputSchema = lazySchema12(
|
|
2182
|
+
() => zodSchema12(z13.object({ result: z13.string() }))
|
|
2151
2183
|
);
|
|
2152
2184
|
var imageGenerationToolFactory = createProviderToolFactoryWithOutputSchema4({
|
|
2153
2185
|
id: "openai.image_generation",
|
|
@@ -2161,26 +2193,26 @@ var imageGeneration = (args = {}) => {
|
|
|
2161
2193
|
// src/tool/local-shell.ts
|
|
2162
2194
|
import {
|
|
2163
2195
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
|
|
2164
|
-
lazySchema as
|
|
2165
|
-
zodSchema as
|
|
2196
|
+
lazySchema as lazySchema13,
|
|
2197
|
+
zodSchema as zodSchema13
|
|
2166
2198
|
} from "@ai-sdk/provider-utils";
|
|
2167
|
-
import { z as
|
|
2168
|
-
var localShellInputSchema =
|
|
2169
|
-
() =>
|
|
2170
|
-
|
|
2171
|
-
action:
|
|
2172
|
-
type:
|
|
2173
|
-
command:
|
|
2174
|
-
timeoutMs:
|
|
2175
|
-
user:
|
|
2176
|
-
workingDirectory:
|
|
2177
|
-
env:
|
|
2199
|
+
import { z as z14 } from "zod/v4";
|
|
2200
|
+
var localShellInputSchema = lazySchema13(
|
|
2201
|
+
() => zodSchema13(
|
|
2202
|
+
z14.object({
|
|
2203
|
+
action: z14.object({
|
|
2204
|
+
type: z14.literal("exec"),
|
|
2205
|
+
command: z14.array(z14.string()),
|
|
2206
|
+
timeoutMs: z14.number().optional(),
|
|
2207
|
+
user: z14.string().optional(),
|
|
2208
|
+
workingDirectory: z14.string().optional(),
|
|
2209
|
+
env: z14.record(z14.string(), z14.string()).optional()
|
|
2178
2210
|
})
|
|
2179
2211
|
})
|
|
2180
2212
|
)
|
|
2181
2213
|
);
|
|
2182
|
-
var localShellOutputSchema =
|
|
2183
|
-
() =>
|
|
2214
|
+
var localShellOutputSchema = lazySchema13(
|
|
2215
|
+
() => zodSchema13(z14.object({ output: z14.string() }))
|
|
2184
2216
|
);
|
|
2185
2217
|
var localShell = createProviderToolFactoryWithOutputSchema5({
|
|
2186
2218
|
id: "openai.local_shell",
|
|
@@ -2191,91 +2223,91 @@ var localShell = createProviderToolFactoryWithOutputSchema5({
|
|
|
2191
2223
|
// src/tool/shell.ts
|
|
2192
2224
|
import {
|
|
2193
2225
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
|
|
2194
|
-
lazySchema as
|
|
2195
|
-
zodSchema as
|
|
2226
|
+
lazySchema as lazySchema14,
|
|
2227
|
+
zodSchema as zodSchema14
|
|
2196
2228
|
} from "@ai-sdk/provider-utils";
|
|
2197
|
-
import { z as
|
|
2198
|
-
var shellInputSchema =
|
|
2199
|
-
() =>
|
|
2200
|
-
|
|
2201
|
-
action:
|
|
2202
|
-
commands:
|
|
2203
|
-
timeoutMs:
|
|
2204
|
-
maxOutputLength:
|
|
2229
|
+
import { z as z15 } from "zod/v4";
|
|
2230
|
+
var shellInputSchema = lazySchema14(
|
|
2231
|
+
() => zodSchema14(
|
|
2232
|
+
z15.object({
|
|
2233
|
+
action: z15.object({
|
|
2234
|
+
commands: z15.array(z15.string()),
|
|
2235
|
+
timeoutMs: z15.number().optional(),
|
|
2236
|
+
maxOutputLength: z15.number().optional()
|
|
2205
2237
|
})
|
|
2206
2238
|
})
|
|
2207
2239
|
)
|
|
2208
2240
|
);
|
|
2209
|
-
var shellOutputSchema =
|
|
2210
|
-
() =>
|
|
2211
|
-
|
|
2212
|
-
output:
|
|
2213
|
-
|
|
2214
|
-
stdout:
|
|
2215
|
-
stderr:
|
|
2216
|
-
outcome:
|
|
2217
|
-
|
|
2218
|
-
|
|
2241
|
+
var shellOutputSchema = lazySchema14(
|
|
2242
|
+
() => zodSchema14(
|
|
2243
|
+
z15.object({
|
|
2244
|
+
output: z15.array(
|
|
2245
|
+
z15.object({
|
|
2246
|
+
stdout: z15.string(),
|
|
2247
|
+
stderr: z15.string(),
|
|
2248
|
+
outcome: z15.discriminatedUnion("type", [
|
|
2249
|
+
z15.object({ type: z15.literal("timeout") }),
|
|
2250
|
+
z15.object({ type: z15.literal("exit"), exitCode: z15.number() })
|
|
2219
2251
|
])
|
|
2220
2252
|
})
|
|
2221
2253
|
)
|
|
2222
2254
|
})
|
|
2223
2255
|
)
|
|
2224
2256
|
);
|
|
2225
|
-
var shellSkillsSchema =
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
type:
|
|
2229
|
-
skillId:
|
|
2230
|
-
version:
|
|
2257
|
+
var shellSkillsSchema = z15.array(
|
|
2258
|
+
z15.discriminatedUnion("type", [
|
|
2259
|
+
z15.object({
|
|
2260
|
+
type: z15.literal("skillReference"),
|
|
2261
|
+
skillId: z15.string(),
|
|
2262
|
+
version: z15.string().optional()
|
|
2231
2263
|
}),
|
|
2232
|
-
|
|
2233
|
-
type:
|
|
2234
|
-
name:
|
|
2235
|
-
description:
|
|
2236
|
-
source:
|
|
2237
|
-
type:
|
|
2238
|
-
mediaType:
|
|
2239
|
-
data:
|
|
2264
|
+
z15.object({
|
|
2265
|
+
type: z15.literal("inline"),
|
|
2266
|
+
name: z15.string(),
|
|
2267
|
+
description: z15.string(),
|
|
2268
|
+
source: z15.object({
|
|
2269
|
+
type: z15.literal("base64"),
|
|
2270
|
+
mediaType: z15.literal("application/zip"),
|
|
2271
|
+
data: z15.string()
|
|
2240
2272
|
})
|
|
2241
2273
|
})
|
|
2242
2274
|
])
|
|
2243
2275
|
).optional();
|
|
2244
|
-
var shellArgsSchema =
|
|
2245
|
-
() =>
|
|
2246
|
-
|
|
2247
|
-
environment:
|
|
2248
|
-
|
|
2249
|
-
type:
|
|
2250
|
-
fileIds:
|
|
2251
|
-
memoryLimit:
|
|
2252
|
-
networkPolicy:
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
type:
|
|
2256
|
-
allowedDomains:
|
|
2257
|
-
domainSecrets:
|
|
2258
|
-
|
|
2259
|
-
domain:
|
|
2260
|
-
name:
|
|
2261
|
-
value:
|
|
2276
|
+
var shellArgsSchema = lazySchema14(
|
|
2277
|
+
() => zodSchema14(
|
|
2278
|
+
z15.object({
|
|
2279
|
+
environment: z15.union([
|
|
2280
|
+
z15.object({
|
|
2281
|
+
type: z15.literal("containerAuto"),
|
|
2282
|
+
fileIds: z15.array(z15.string()).optional(),
|
|
2283
|
+
memoryLimit: z15.enum(["1g", "4g", "16g", "64g"]).optional(),
|
|
2284
|
+
networkPolicy: z15.discriminatedUnion("type", [
|
|
2285
|
+
z15.object({ type: z15.literal("disabled") }),
|
|
2286
|
+
z15.object({
|
|
2287
|
+
type: z15.literal("allowlist"),
|
|
2288
|
+
allowedDomains: z15.array(z15.string()),
|
|
2289
|
+
domainSecrets: z15.array(
|
|
2290
|
+
z15.object({
|
|
2291
|
+
domain: z15.string(),
|
|
2292
|
+
name: z15.string(),
|
|
2293
|
+
value: z15.string()
|
|
2262
2294
|
})
|
|
2263
2295
|
).optional()
|
|
2264
2296
|
})
|
|
2265
2297
|
]).optional(),
|
|
2266
2298
|
skills: shellSkillsSchema
|
|
2267
2299
|
}),
|
|
2268
|
-
|
|
2269
|
-
type:
|
|
2270
|
-
containerId:
|
|
2300
|
+
z15.object({
|
|
2301
|
+
type: z15.literal("containerReference"),
|
|
2302
|
+
containerId: z15.string()
|
|
2271
2303
|
}),
|
|
2272
|
-
|
|
2273
|
-
type:
|
|
2274
|
-
skills:
|
|
2275
|
-
|
|
2276
|
-
name:
|
|
2277
|
-
description:
|
|
2278
|
-
path:
|
|
2304
|
+
z15.object({
|
|
2305
|
+
type: z15.literal("local").optional(),
|
|
2306
|
+
skills: z15.array(
|
|
2307
|
+
z15.object({
|
|
2308
|
+
name: z15.string(),
|
|
2309
|
+
description: z15.string(),
|
|
2310
|
+
path: z15.string()
|
|
2279
2311
|
})
|
|
2280
2312
|
).optional()
|
|
2281
2313
|
})
|
|
@@ -2292,71 +2324,15 @@ var shell = createProviderToolFactoryWithOutputSchema6({
|
|
|
2292
2324
|
// src/tool/web-search.ts
|
|
2293
2325
|
import {
|
|
2294
2326
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
|
|
2295
|
-
lazySchema as lazySchema14,
|
|
2296
|
-
zodSchema as zodSchema14
|
|
2297
|
-
} from "@ai-sdk/provider-utils";
|
|
2298
|
-
import { z as z15 } from "zod/v4";
|
|
2299
|
-
var webSearchArgsSchema = lazySchema14(
|
|
2300
|
-
() => zodSchema14(
|
|
2301
|
-
z15.object({
|
|
2302
|
-
externalWebAccess: z15.boolean().optional(),
|
|
2303
|
-
filters: z15.object({ allowedDomains: z15.array(z15.string()).optional() }).optional(),
|
|
2304
|
-
searchContextSize: z15.enum(["low", "medium", "high"]).optional(),
|
|
2305
|
-
userLocation: z15.object({
|
|
2306
|
-
type: z15.literal("approximate"),
|
|
2307
|
-
country: z15.string().optional(),
|
|
2308
|
-
city: z15.string().optional(),
|
|
2309
|
-
region: z15.string().optional(),
|
|
2310
|
-
timezone: z15.string().optional()
|
|
2311
|
-
}).optional()
|
|
2312
|
-
})
|
|
2313
|
-
)
|
|
2314
|
-
);
|
|
2315
|
-
var webSearchInputSchema = lazySchema14(() => zodSchema14(z15.object({})));
|
|
2316
|
-
var webSearchOutputSchema = lazySchema14(
|
|
2317
|
-
() => zodSchema14(
|
|
2318
|
-
z15.object({
|
|
2319
|
-
action: z15.discriminatedUnion("type", [
|
|
2320
|
-
z15.object({
|
|
2321
|
-
type: z15.literal("search"),
|
|
2322
|
-
query: z15.string().optional()
|
|
2323
|
-
}),
|
|
2324
|
-
z15.object({
|
|
2325
|
-
type: z15.literal("openPage"),
|
|
2326
|
-
url: z15.string().nullish()
|
|
2327
|
-
}),
|
|
2328
|
-
z15.object({
|
|
2329
|
-
type: z15.literal("findInPage"),
|
|
2330
|
-
url: z15.string().nullish(),
|
|
2331
|
-
pattern: z15.string().nullish()
|
|
2332
|
-
})
|
|
2333
|
-
]).optional(),
|
|
2334
|
-
sources: z15.array(
|
|
2335
|
-
z15.discriminatedUnion("type", [
|
|
2336
|
-
z15.object({ type: z15.literal("url"), url: z15.string() }),
|
|
2337
|
-
z15.object({ type: z15.literal("api"), name: z15.string() })
|
|
2338
|
-
])
|
|
2339
|
-
).optional()
|
|
2340
|
-
})
|
|
2341
|
-
)
|
|
2342
|
-
);
|
|
2343
|
-
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema7({
|
|
2344
|
-
id: "openai.web_search",
|
|
2345
|
-
inputSchema: webSearchInputSchema,
|
|
2346
|
-
outputSchema: webSearchOutputSchema
|
|
2347
|
-
});
|
|
2348
|
-
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
2349
|
-
|
|
2350
|
-
// src/tool/web-search-preview.ts
|
|
2351
|
-
import {
|
|
2352
|
-
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
|
|
2353
2327
|
lazySchema as lazySchema15,
|
|
2354
2328
|
zodSchema as zodSchema15
|
|
2355
2329
|
} from "@ai-sdk/provider-utils";
|
|
2356
2330
|
import { z as z16 } from "zod/v4";
|
|
2357
|
-
var
|
|
2331
|
+
var webSearchArgsSchema = lazySchema15(
|
|
2358
2332
|
() => zodSchema15(
|
|
2359
2333
|
z16.object({
|
|
2334
|
+
externalWebAccess: z16.boolean().optional(),
|
|
2335
|
+
filters: z16.object({ allowedDomains: z16.array(z16.string()).optional() }).optional(),
|
|
2360
2336
|
searchContextSize: z16.enum(["low", "medium", "high"]).optional(),
|
|
2361
2337
|
userLocation: z16.object({
|
|
2362
2338
|
type: z16.literal("approximate"),
|
|
@@ -2368,10 +2344,8 @@ var webSearchPreviewArgsSchema = lazySchema15(
|
|
|
2368
2344
|
})
|
|
2369
2345
|
)
|
|
2370
2346
|
);
|
|
2371
|
-
var
|
|
2372
|
-
|
|
2373
|
-
);
|
|
2374
|
-
var webSearchPreviewOutputSchema = lazySchema15(
|
|
2347
|
+
var webSearchInputSchema = lazySchema15(() => zodSchema15(z16.object({})));
|
|
2348
|
+
var webSearchOutputSchema = lazySchema15(
|
|
2375
2349
|
() => zodSchema15(
|
|
2376
2350
|
z16.object({
|
|
2377
2351
|
action: z16.discriminatedUnion("type", [
|
|
@@ -2388,6 +2362,64 @@ var webSearchPreviewOutputSchema = lazySchema15(
|
|
|
2388
2362
|
url: z16.string().nullish(),
|
|
2389
2363
|
pattern: z16.string().nullish()
|
|
2390
2364
|
})
|
|
2365
|
+
]).optional(),
|
|
2366
|
+
sources: z16.array(
|
|
2367
|
+
z16.discriminatedUnion("type", [
|
|
2368
|
+
z16.object({ type: z16.literal("url"), url: z16.string() }),
|
|
2369
|
+
z16.object({ type: z16.literal("api"), name: z16.string() })
|
|
2370
|
+
])
|
|
2371
|
+
).optional()
|
|
2372
|
+
})
|
|
2373
|
+
)
|
|
2374
|
+
);
|
|
2375
|
+
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema7({
|
|
2376
|
+
id: "openai.web_search",
|
|
2377
|
+
inputSchema: webSearchInputSchema,
|
|
2378
|
+
outputSchema: webSearchOutputSchema
|
|
2379
|
+
});
|
|
2380
|
+
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
2381
|
+
|
|
2382
|
+
// src/tool/web-search-preview.ts
|
|
2383
|
+
import {
|
|
2384
|
+
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 webSearchPreviewArgsSchema = lazySchema16(
|
|
2390
|
+
() => zodSchema16(
|
|
2391
|
+
z17.object({
|
|
2392
|
+
searchContextSize: z17.enum(["low", "medium", "high"]).optional(),
|
|
2393
|
+
userLocation: z17.object({
|
|
2394
|
+
type: z17.literal("approximate"),
|
|
2395
|
+
country: z17.string().optional(),
|
|
2396
|
+
city: z17.string().optional(),
|
|
2397
|
+
region: z17.string().optional(),
|
|
2398
|
+
timezone: z17.string().optional()
|
|
2399
|
+
}).optional()
|
|
2400
|
+
})
|
|
2401
|
+
)
|
|
2402
|
+
);
|
|
2403
|
+
var webSearchPreviewInputSchema = lazySchema16(
|
|
2404
|
+
() => zodSchema16(z17.object({}))
|
|
2405
|
+
);
|
|
2406
|
+
var webSearchPreviewOutputSchema = 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
|
+
})
|
|
2391
2423
|
]).optional()
|
|
2392
2424
|
})
|
|
2393
2425
|
)
|
|
@@ -2401,60 +2433,60 @@ var webSearchPreview = createProviderToolFactoryWithOutputSchema8({
|
|
|
2401
2433
|
// src/tool/mcp.ts
|
|
2402
2434
|
import {
|
|
2403
2435
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
|
|
2404
|
-
lazySchema as
|
|
2405
|
-
zodSchema as
|
|
2436
|
+
lazySchema as lazySchema17,
|
|
2437
|
+
zodSchema as zodSchema17
|
|
2406
2438
|
} from "@ai-sdk/provider-utils";
|
|
2407
|
-
import { z as
|
|
2408
|
-
var jsonValueSchema =
|
|
2409
|
-
() =>
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2439
|
+
import { z as z18 } from "zod/v4";
|
|
2440
|
+
var jsonValueSchema = z18.lazy(
|
|
2441
|
+
() => z18.union([
|
|
2442
|
+
z18.string(),
|
|
2443
|
+
z18.number(),
|
|
2444
|
+
z18.boolean(),
|
|
2445
|
+
z18.null(),
|
|
2446
|
+
z18.array(jsonValueSchema),
|
|
2447
|
+
z18.record(z18.string(), jsonValueSchema)
|
|
2416
2448
|
])
|
|
2417
2449
|
);
|
|
2418
|
-
var mcpArgsSchema =
|
|
2419
|
-
() =>
|
|
2420
|
-
|
|
2421
|
-
serverLabel:
|
|
2422
|
-
allowedTools:
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
readOnly:
|
|
2426
|
-
toolNames:
|
|
2450
|
+
var mcpArgsSchema = lazySchema17(
|
|
2451
|
+
() => zodSchema17(
|
|
2452
|
+
z18.object({
|
|
2453
|
+
serverLabel: z18.string(),
|
|
2454
|
+
allowedTools: z18.union([
|
|
2455
|
+
z18.array(z18.string()),
|
|
2456
|
+
z18.object({
|
|
2457
|
+
readOnly: z18.boolean().optional(),
|
|
2458
|
+
toolNames: z18.array(z18.string()).optional()
|
|
2427
2459
|
})
|
|
2428
2460
|
]).optional(),
|
|
2429
|
-
authorization:
|
|
2430
|
-
connectorId:
|
|
2431
|
-
headers:
|
|
2432
|
-
requireApproval:
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
never:
|
|
2436
|
-
toolNames:
|
|
2461
|
+
authorization: z18.string().optional(),
|
|
2462
|
+
connectorId: z18.string().optional(),
|
|
2463
|
+
headers: z18.record(z18.string(), z18.string()).optional(),
|
|
2464
|
+
requireApproval: z18.union([
|
|
2465
|
+
z18.enum(["always", "never"]),
|
|
2466
|
+
z18.object({
|
|
2467
|
+
never: z18.object({
|
|
2468
|
+
toolNames: z18.array(z18.string()).optional()
|
|
2437
2469
|
}).optional()
|
|
2438
2470
|
})
|
|
2439
2471
|
]).optional(),
|
|
2440
|
-
serverDescription:
|
|
2441
|
-
serverUrl:
|
|
2472
|
+
serverDescription: z18.string().optional(),
|
|
2473
|
+
serverUrl: z18.string().optional()
|
|
2442
2474
|
}).refine(
|
|
2443
2475
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
2444
2476
|
"One of serverUrl or connectorId must be provided."
|
|
2445
2477
|
)
|
|
2446
2478
|
)
|
|
2447
2479
|
);
|
|
2448
|
-
var mcpInputSchema =
|
|
2449
|
-
var mcpOutputSchema =
|
|
2450
|
-
() =>
|
|
2451
|
-
|
|
2452
|
-
type:
|
|
2453
|
-
serverLabel:
|
|
2454
|
-
name:
|
|
2455
|
-
arguments:
|
|
2456
|
-
output:
|
|
2457
|
-
error:
|
|
2480
|
+
var mcpInputSchema = lazySchema17(() => zodSchema17(z18.object({})));
|
|
2481
|
+
var mcpOutputSchema = lazySchema17(
|
|
2482
|
+
() => zodSchema17(
|
|
2483
|
+
z18.object({
|
|
2484
|
+
type: z18.literal("call"),
|
|
2485
|
+
serverLabel: z18.string(),
|
|
2486
|
+
name: z18.string(),
|
|
2487
|
+
arguments: z18.string(),
|
|
2488
|
+
output: z18.string().nullish(),
|
|
2489
|
+
error: z18.union([z18.string(), jsonValueSchema]).optional()
|
|
2458
2490
|
})
|
|
2459
2491
|
)
|
|
2460
2492
|
);
|
|
@@ -2475,6 +2507,16 @@ var openaiTools = {
|
|
|
2475
2507
|
*
|
|
2476
2508
|
*/
|
|
2477
2509
|
applyPatch,
|
|
2510
|
+
/**
|
|
2511
|
+
* Custom tools let callers constrain model output to a grammar (regex or
|
|
2512
|
+
* Lark syntax). The model returns a `custom_tool_call` output item whose
|
|
2513
|
+
* `input` field is a string matching the specified grammar.
|
|
2514
|
+
*
|
|
2515
|
+
* @param name - The name of the custom tool.
|
|
2516
|
+
* @param description - An optional description of the tool.
|
|
2517
|
+
* @param format - The output format constraint (grammar type, syntax, and definition).
|
|
2518
|
+
*/
|
|
2519
|
+
customTool,
|
|
2478
2520
|
/**
|
|
2479
2521
|
* The Code Interpreter tool allows models to write and run Python code in a
|
|
2480
2522
|
* sandboxed environment to solve complex problems in domains like data analysis,
|
|
@@ -2515,7 +2557,7 @@ var openaiTools = {
|
|
|
2515
2557
|
* Local shell is a tool that allows agents to run shell commands locally
|
|
2516
2558
|
* on a machine you or the user provides.
|
|
2517
2559
|
*
|
|
2518
|
-
* Supported models: `gpt-5-codex`
|
|
2560
|
+
* Supported models: `gpt-5-codex`
|
|
2519
2561
|
*/
|
|
2520
2562
|
localShell,
|
|
2521
2563
|
/**
|
|
@@ -2626,7 +2668,7 @@ import {
|
|
|
2626
2668
|
parseProviderOptions as parseProviderOptions4,
|
|
2627
2669
|
validateTypes
|
|
2628
2670
|
} from "@ai-sdk/provider-utils";
|
|
2629
|
-
import { z as
|
|
2671
|
+
import { z as z19 } from "zod/v4";
|
|
2630
2672
|
function isFileId(data, prefixes) {
|
|
2631
2673
|
if (!prefixes) return false;
|
|
2632
2674
|
return prefixes.some((prefix) => data.startsWith(prefix));
|
|
@@ -2641,9 +2683,10 @@ async function convertToOpenAIResponsesInput({
|
|
|
2641
2683
|
hasConversation = false,
|
|
2642
2684
|
hasLocalShellTool = false,
|
|
2643
2685
|
hasShellTool = false,
|
|
2644
|
-
hasApplyPatchTool = false
|
|
2686
|
+
hasApplyPatchTool = false,
|
|
2687
|
+
customProviderToolNames
|
|
2645
2688
|
}) {
|
|
2646
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
2689
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
2647
2690
|
const input = [];
|
|
2648
2691
|
const warnings = [];
|
|
2649
2692
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -2812,6 +2855,16 @@ async function convertToOpenAIResponsesInput({
|
|
|
2812
2855
|
});
|
|
2813
2856
|
break;
|
|
2814
2857
|
}
|
|
2858
|
+
if (customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) {
|
|
2859
|
+
input.push({
|
|
2860
|
+
type: "custom_tool_call",
|
|
2861
|
+
call_id: part.toolCallId,
|
|
2862
|
+
name: resolvedToolName,
|
|
2863
|
+
input: typeof part.input === "string" ? part.input : JSON.stringify(part.input),
|
|
2864
|
+
id
|
|
2865
|
+
});
|
|
2866
|
+
break;
|
|
2867
|
+
}
|
|
2815
2868
|
input.push({
|
|
2816
2869
|
type: "function_call",
|
|
2817
2870
|
call_id: part.toolCallId,
|
|
@@ -3016,6 +3069,61 @@ async function convertToOpenAIResponsesInput({
|
|
|
3016
3069
|
});
|
|
3017
3070
|
continue;
|
|
3018
3071
|
}
|
|
3072
|
+
if (customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) {
|
|
3073
|
+
let outputValue;
|
|
3074
|
+
switch (output.type) {
|
|
3075
|
+
case "text":
|
|
3076
|
+
case "error-text":
|
|
3077
|
+
outputValue = output.value;
|
|
3078
|
+
break;
|
|
3079
|
+
case "execution-denied":
|
|
3080
|
+
outputValue = (_l = output.reason) != null ? _l : "Tool execution denied.";
|
|
3081
|
+
break;
|
|
3082
|
+
case "json":
|
|
3083
|
+
case "error-json":
|
|
3084
|
+
outputValue = JSON.stringify(output.value);
|
|
3085
|
+
break;
|
|
3086
|
+
case "content":
|
|
3087
|
+
outputValue = output.value.map((item) => {
|
|
3088
|
+
var _a2;
|
|
3089
|
+
switch (item.type) {
|
|
3090
|
+
case "text":
|
|
3091
|
+
return { type: "input_text", text: item.text };
|
|
3092
|
+
case "image-data":
|
|
3093
|
+
return {
|
|
3094
|
+
type: "input_image",
|
|
3095
|
+
image_url: `data:${item.mediaType};base64,${item.data}`
|
|
3096
|
+
};
|
|
3097
|
+
case "image-url":
|
|
3098
|
+
return {
|
|
3099
|
+
type: "input_image",
|
|
3100
|
+
image_url: item.url
|
|
3101
|
+
};
|
|
3102
|
+
case "file-data":
|
|
3103
|
+
return {
|
|
3104
|
+
type: "input_file",
|
|
3105
|
+
filename: (_a2 = item.filename) != null ? _a2 : "data",
|
|
3106
|
+
file_data: `data:${item.mediaType};base64,${item.data}`
|
|
3107
|
+
};
|
|
3108
|
+
default:
|
|
3109
|
+
warnings.push({
|
|
3110
|
+
type: "other",
|
|
3111
|
+
message: `unsupported custom tool content part type: ${item.type}`
|
|
3112
|
+
});
|
|
3113
|
+
return void 0;
|
|
3114
|
+
}
|
|
3115
|
+
}).filter(isNonNullable);
|
|
3116
|
+
break;
|
|
3117
|
+
default:
|
|
3118
|
+
outputValue = "";
|
|
3119
|
+
}
|
|
3120
|
+
input.push({
|
|
3121
|
+
type: "custom_tool_call_output",
|
|
3122
|
+
call_id: part.toolCallId,
|
|
3123
|
+
output: outputValue
|
|
3124
|
+
});
|
|
3125
|
+
continue;
|
|
3126
|
+
}
|
|
3019
3127
|
let contentValue;
|
|
3020
3128
|
switch (output.type) {
|
|
3021
3129
|
case "text":
|
|
@@ -3023,7 +3131,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3023
3131
|
contentValue = output.value;
|
|
3024
3132
|
break;
|
|
3025
3133
|
case "execution-denied":
|
|
3026
|
-
contentValue = (
|
|
3134
|
+
contentValue = (_m = output.reason) != null ? _m : "Tool execution denied.";
|
|
3027
3135
|
break;
|
|
3028
3136
|
case "json":
|
|
3029
3137
|
case "error-json":
|
|
@@ -3082,9 +3190,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
3082
3190
|
}
|
|
3083
3191
|
return { input, warnings };
|
|
3084
3192
|
}
|
|
3085
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
3086
|
-
itemId:
|
|
3087
|
-
reasoningEncryptedContent:
|
|
3193
|
+
var openaiResponsesReasoningProviderOptionsSchema = z19.object({
|
|
3194
|
+
itemId: z19.string().nullish(),
|
|
3195
|
+
reasoningEncryptedContent: z19.string().nullish()
|
|
3088
3196
|
});
|
|
3089
3197
|
|
|
3090
3198
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -3106,161 +3214,168 @@ function mapOpenAIResponseFinishReason({
|
|
|
3106
3214
|
}
|
|
3107
3215
|
|
|
3108
3216
|
// src/responses/openai-responses-api.ts
|
|
3109
|
-
import { lazySchema as
|
|
3110
|
-
import { z as
|
|
3111
|
-
var openaiResponsesChunkSchema =
|
|
3112
|
-
() =>
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
type:
|
|
3116
|
-
item_id:
|
|
3117
|
-
delta:
|
|
3118
|
-
logprobs:
|
|
3119
|
-
|
|
3120
|
-
token:
|
|
3121
|
-
logprob:
|
|
3122
|
-
top_logprobs:
|
|
3123
|
-
|
|
3124
|
-
token:
|
|
3125
|
-
logprob:
|
|
3217
|
+
import { lazySchema as lazySchema18, zodSchema as zodSchema18 } from "@ai-sdk/provider-utils";
|
|
3218
|
+
import { z as z20 } from "zod/v4";
|
|
3219
|
+
var openaiResponsesChunkSchema = lazySchema18(
|
|
3220
|
+
() => zodSchema18(
|
|
3221
|
+
z20.union([
|
|
3222
|
+
z20.object({
|
|
3223
|
+
type: z20.literal("response.output_text.delta"),
|
|
3224
|
+
item_id: z20.string(),
|
|
3225
|
+
delta: z20.string(),
|
|
3226
|
+
logprobs: z20.array(
|
|
3227
|
+
z20.object({
|
|
3228
|
+
token: z20.string(),
|
|
3229
|
+
logprob: z20.number(),
|
|
3230
|
+
top_logprobs: z20.array(
|
|
3231
|
+
z20.object({
|
|
3232
|
+
token: z20.string(),
|
|
3233
|
+
logprob: z20.number()
|
|
3126
3234
|
})
|
|
3127
3235
|
)
|
|
3128
3236
|
})
|
|
3129
3237
|
).nullish()
|
|
3130
3238
|
}),
|
|
3131
|
-
|
|
3132
|
-
type:
|
|
3133
|
-
response:
|
|
3134
|
-
incomplete_details:
|
|
3135
|
-
usage:
|
|
3136
|
-
input_tokens:
|
|
3137
|
-
input_tokens_details:
|
|
3138
|
-
output_tokens:
|
|
3139
|
-
output_tokens_details:
|
|
3239
|
+
z20.object({
|
|
3240
|
+
type: z20.enum(["response.completed", "response.incomplete"]),
|
|
3241
|
+
response: z20.object({
|
|
3242
|
+
incomplete_details: z20.object({ reason: z20.string() }).nullish(),
|
|
3243
|
+
usage: z20.object({
|
|
3244
|
+
input_tokens: z20.number(),
|
|
3245
|
+
input_tokens_details: z20.object({ cached_tokens: z20.number().nullish() }).nullish(),
|
|
3246
|
+
output_tokens: z20.number(),
|
|
3247
|
+
output_tokens_details: z20.object({ reasoning_tokens: z20.number().nullish() }).nullish()
|
|
3140
3248
|
}),
|
|
3141
|
-
service_tier:
|
|
3249
|
+
service_tier: z20.string().nullish()
|
|
3142
3250
|
})
|
|
3143
3251
|
}),
|
|
3144
|
-
|
|
3145
|
-
type:
|
|
3146
|
-
response:
|
|
3147
|
-
id:
|
|
3148
|
-
created_at:
|
|
3149
|
-
model:
|
|
3150
|
-
service_tier:
|
|
3252
|
+
z20.object({
|
|
3253
|
+
type: z20.literal("response.created"),
|
|
3254
|
+
response: z20.object({
|
|
3255
|
+
id: z20.string(),
|
|
3256
|
+
created_at: z20.number(),
|
|
3257
|
+
model: z20.string(),
|
|
3258
|
+
service_tier: z20.string().nullish()
|
|
3151
3259
|
})
|
|
3152
3260
|
}),
|
|
3153
|
-
|
|
3154
|
-
type:
|
|
3155
|
-
output_index:
|
|
3156
|
-
item:
|
|
3157
|
-
|
|
3158
|
-
type:
|
|
3159
|
-
id:
|
|
3160
|
-
phase:
|
|
3261
|
+
z20.object({
|
|
3262
|
+
type: z20.literal("response.output_item.added"),
|
|
3263
|
+
output_index: z20.number(),
|
|
3264
|
+
item: z20.discriminatedUnion("type", [
|
|
3265
|
+
z20.object({
|
|
3266
|
+
type: z20.literal("message"),
|
|
3267
|
+
id: z20.string(),
|
|
3268
|
+
phase: z20.enum(["commentary", "final_answer"]).nullish()
|
|
3161
3269
|
}),
|
|
3162
|
-
|
|
3163
|
-
type:
|
|
3164
|
-
id:
|
|
3165
|
-
encrypted_content:
|
|
3270
|
+
z20.object({
|
|
3271
|
+
type: z20.literal("reasoning"),
|
|
3272
|
+
id: z20.string(),
|
|
3273
|
+
encrypted_content: z20.string().nullish()
|
|
3166
3274
|
}),
|
|
3167
|
-
|
|
3168
|
-
type:
|
|
3169
|
-
id:
|
|
3170
|
-
call_id:
|
|
3171
|
-
name:
|
|
3172
|
-
arguments:
|
|
3275
|
+
z20.object({
|
|
3276
|
+
type: z20.literal("function_call"),
|
|
3277
|
+
id: z20.string(),
|
|
3278
|
+
call_id: z20.string(),
|
|
3279
|
+
name: z20.string(),
|
|
3280
|
+
arguments: z20.string()
|
|
3173
3281
|
}),
|
|
3174
|
-
|
|
3175
|
-
type:
|
|
3176
|
-
id:
|
|
3177
|
-
status:
|
|
3282
|
+
z20.object({
|
|
3283
|
+
type: z20.literal("web_search_call"),
|
|
3284
|
+
id: z20.string(),
|
|
3285
|
+
status: z20.string()
|
|
3178
3286
|
}),
|
|
3179
|
-
|
|
3180
|
-
type:
|
|
3181
|
-
id:
|
|
3182
|
-
status:
|
|
3287
|
+
z20.object({
|
|
3288
|
+
type: z20.literal("computer_call"),
|
|
3289
|
+
id: z20.string(),
|
|
3290
|
+
status: z20.string()
|
|
3183
3291
|
}),
|
|
3184
|
-
|
|
3185
|
-
type:
|
|
3186
|
-
id:
|
|
3292
|
+
z20.object({
|
|
3293
|
+
type: z20.literal("file_search_call"),
|
|
3294
|
+
id: z20.string()
|
|
3187
3295
|
}),
|
|
3188
|
-
|
|
3189
|
-
type:
|
|
3190
|
-
id:
|
|
3296
|
+
z20.object({
|
|
3297
|
+
type: z20.literal("image_generation_call"),
|
|
3298
|
+
id: z20.string()
|
|
3191
3299
|
}),
|
|
3192
|
-
|
|
3193
|
-
type:
|
|
3194
|
-
id:
|
|
3195
|
-
container_id:
|
|
3196
|
-
code:
|
|
3197
|
-
outputs:
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3300
|
+
z20.object({
|
|
3301
|
+
type: z20.literal("code_interpreter_call"),
|
|
3302
|
+
id: z20.string(),
|
|
3303
|
+
container_id: z20.string(),
|
|
3304
|
+
code: z20.string().nullable(),
|
|
3305
|
+
outputs: z20.array(
|
|
3306
|
+
z20.discriminatedUnion("type", [
|
|
3307
|
+
z20.object({ type: z20.literal("logs"), logs: z20.string() }),
|
|
3308
|
+
z20.object({ type: z20.literal("image"), url: z20.string() })
|
|
3201
3309
|
])
|
|
3202
3310
|
).nullable(),
|
|
3203
|
-
status:
|
|
3311
|
+
status: z20.string()
|
|
3204
3312
|
}),
|
|
3205
|
-
|
|
3206
|
-
type:
|
|
3207
|
-
id:
|
|
3208
|
-
status:
|
|
3209
|
-
approval_request_id:
|
|
3313
|
+
z20.object({
|
|
3314
|
+
type: z20.literal("mcp_call"),
|
|
3315
|
+
id: z20.string(),
|
|
3316
|
+
status: z20.string(),
|
|
3317
|
+
approval_request_id: z20.string().nullish()
|
|
3210
3318
|
}),
|
|
3211
|
-
|
|
3212
|
-
type:
|
|
3213
|
-
id:
|
|
3319
|
+
z20.object({
|
|
3320
|
+
type: z20.literal("mcp_list_tools"),
|
|
3321
|
+
id: z20.string()
|
|
3214
3322
|
}),
|
|
3215
|
-
|
|
3216
|
-
type:
|
|
3217
|
-
id:
|
|
3323
|
+
z20.object({
|
|
3324
|
+
type: z20.literal("mcp_approval_request"),
|
|
3325
|
+
id: z20.string()
|
|
3218
3326
|
}),
|
|
3219
|
-
|
|
3220
|
-
type:
|
|
3221
|
-
id:
|
|
3222
|
-
call_id:
|
|
3223
|
-
status:
|
|
3224
|
-
operation:
|
|
3225
|
-
|
|
3226
|
-
type:
|
|
3227
|
-
path:
|
|
3228
|
-
diff:
|
|
3327
|
+
z20.object({
|
|
3328
|
+
type: z20.literal("apply_patch_call"),
|
|
3329
|
+
id: z20.string(),
|
|
3330
|
+
call_id: z20.string(),
|
|
3331
|
+
status: z20.enum(["in_progress", "completed"]),
|
|
3332
|
+
operation: z20.discriminatedUnion("type", [
|
|
3333
|
+
z20.object({
|
|
3334
|
+
type: z20.literal("create_file"),
|
|
3335
|
+
path: z20.string(),
|
|
3336
|
+
diff: z20.string()
|
|
3229
3337
|
}),
|
|
3230
|
-
|
|
3231
|
-
type:
|
|
3232
|
-
path:
|
|
3338
|
+
z20.object({
|
|
3339
|
+
type: z20.literal("delete_file"),
|
|
3340
|
+
path: z20.string()
|
|
3233
3341
|
}),
|
|
3234
|
-
|
|
3235
|
-
type:
|
|
3236
|
-
path:
|
|
3237
|
-
diff:
|
|
3342
|
+
z20.object({
|
|
3343
|
+
type: z20.literal("update_file"),
|
|
3344
|
+
path: z20.string(),
|
|
3345
|
+
diff: z20.string()
|
|
3238
3346
|
})
|
|
3239
3347
|
])
|
|
3240
3348
|
}),
|
|
3241
|
-
|
|
3242
|
-
type:
|
|
3243
|
-
id:
|
|
3244
|
-
call_id:
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3349
|
+
z20.object({
|
|
3350
|
+
type: z20.literal("custom_tool_call"),
|
|
3351
|
+
id: z20.string(),
|
|
3352
|
+
call_id: z20.string(),
|
|
3353
|
+
name: z20.string(),
|
|
3354
|
+
input: z20.string()
|
|
3355
|
+
}),
|
|
3356
|
+
z20.object({
|
|
3357
|
+
type: z20.literal("shell_call"),
|
|
3358
|
+
id: z20.string(),
|
|
3359
|
+
call_id: z20.string(),
|
|
3360
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
3361
|
+
action: z20.object({
|
|
3362
|
+
commands: z20.array(z20.string())
|
|
3248
3363
|
})
|
|
3249
3364
|
}),
|
|
3250
|
-
|
|
3251
|
-
type:
|
|
3252
|
-
id:
|
|
3253
|
-
call_id:
|
|
3254
|
-
status:
|
|
3255
|
-
output:
|
|
3256
|
-
|
|
3257
|
-
stdout:
|
|
3258
|
-
stderr:
|
|
3259
|
-
outcome:
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
type:
|
|
3263
|
-
exit_code:
|
|
3365
|
+
z20.object({
|
|
3366
|
+
type: z20.literal("shell_call_output"),
|
|
3367
|
+
id: z20.string(),
|
|
3368
|
+
call_id: z20.string(),
|
|
3369
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
3370
|
+
output: z20.array(
|
|
3371
|
+
z20.object({
|
|
3372
|
+
stdout: z20.string(),
|
|
3373
|
+
stderr: z20.string(),
|
|
3374
|
+
outcome: z20.discriminatedUnion("type", [
|
|
3375
|
+
z20.object({ type: z20.literal("timeout") }),
|
|
3376
|
+
z20.object({
|
|
3377
|
+
type: z20.literal("exit"),
|
|
3378
|
+
exit_code: z20.number()
|
|
3264
3379
|
})
|
|
3265
3380
|
])
|
|
3266
3381
|
})
|
|
@@ -3268,198 +3383,206 @@ var openaiResponsesChunkSchema = lazySchema17(
|
|
|
3268
3383
|
})
|
|
3269
3384
|
])
|
|
3270
3385
|
}),
|
|
3271
|
-
|
|
3272
|
-
type:
|
|
3273
|
-
output_index:
|
|
3274
|
-
item:
|
|
3275
|
-
|
|
3276
|
-
type:
|
|
3277
|
-
id:
|
|
3278
|
-
phase:
|
|
3386
|
+
z20.object({
|
|
3387
|
+
type: z20.literal("response.output_item.done"),
|
|
3388
|
+
output_index: z20.number(),
|
|
3389
|
+
item: z20.discriminatedUnion("type", [
|
|
3390
|
+
z20.object({
|
|
3391
|
+
type: z20.literal("message"),
|
|
3392
|
+
id: z20.string(),
|
|
3393
|
+
phase: z20.enum(["commentary", "final_answer"]).nullish()
|
|
3394
|
+
}),
|
|
3395
|
+
z20.object({
|
|
3396
|
+
type: z20.literal("reasoning"),
|
|
3397
|
+
id: z20.string(),
|
|
3398
|
+
encrypted_content: z20.string().nullish()
|
|
3279
3399
|
}),
|
|
3280
|
-
|
|
3281
|
-
type:
|
|
3282
|
-
id:
|
|
3283
|
-
|
|
3400
|
+
z20.object({
|
|
3401
|
+
type: z20.literal("function_call"),
|
|
3402
|
+
id: z20.string(),
|
|
3403
|
+
call_id: z20.string(),
|
|
3404
|
+
name: z20.string(),
|
|
3405
|
+
arguments: z20.string(),
|
|
3406
|
+
status: z20.literal("completed")
|
|
3284
3407
|
}),
|
|
3285
|
-
|
|
3286
|
-
type:
|
|
3287
|
-
id:
|
|
3288
|
-
call_id:
|
|
3289
|
-
name:
|
|
3290
|
-
|
|
3291
|
-
status:
|
|
3408
|
+
z20.object({
|
|
3409
|
+
type: z20.literal("custom_tool_call"),
|
|
3410
|
+
id: z20.string(),
|
|
3411
|
+
call_id: z20.string(),
|
|
3412
|
+
name: z20.string(),
|
|
3413
|
+
input: z20.string(),
|
|
3414
|
+
status: z20.literal("completed")
|
|
3292
3415
|
}),
|
|
3293
|
-
|
|
3294
|
-
type:
|
|
3295
|
-
id:
|
|
3296
|
-
code:
|
|
3297
|
-
container_id:
|
|
3298
|
-
outputs:
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3416
|
+
z20.object({
|
|
3417
|
+
type: z20.literal("code_interpreter_call"),
|
|
3418
|
+
id: z20.string(),
|
|
3419
|
+
code: z20.string().nullable(),
|
|
3420
|
+
container_id: z20.string(),
|
|
3421
|
+
outputs: z20.array(
|
|
3422
|
+
z20.discriminatedUnion("type", [
|
|
3423
|
+
z20.object({ type: z20.literal("logs"), logs: z20.string() }),
|
|
3424
|
+
z20.object({ type: z20.literal("image"), url: z20.string() })
|
|
3302
3425
|
])
|
|
3303
3426
|
).nullable()
|
|
3304
3427
|
}),
|
|
3305
|
-
|
|
3306
|
-
type:
|
|
3307
|
-
id:
|
|
3308
|
-
result:
|
|
3428
|
+
z20.object({
|
|
3429
|
+
type: z20.literal("image_generation_call"),
|
|
3430
|
+
id: z20.string(),
|
|
3431
|
+
result: z20.string()
|
|
3309
3432
|
}),
|
|
3310
|
-
|
|
3311
|
-
type:
|
|
3312
|
-
id:
|
|
3313
|
-
status:
|
|
3314
|
-
action:
|
|
3315
|
-
|
|
3316
|
-
type:
|
|
3317
|
-
query:
|
|
3318
|
-
sources:
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3433
|
+
z20.object({
|
|
3434
|
+
type: z20.literal("web_search_call"),
|
|
3435
|
+
id: z20.string(),
|
|
3436
|
+
status: z20.string(),
|
|
3437
|
+
action: z20.discriminatedUnion("type", [
|
|
3438
|
+
z20.object({
|
|
3439
|
+
type: z20.literal("search"),
|
|
3440
|
+
query: z20.string().nullish(),
|
|
3441
|
+
sources: z20.array(
|
|
3442
|
+
z20.discriminatedUnion("type", [
|
|
3443
|
+
z20.object({ type: z20.literal("url"), url: z20.string() }),
|
|
3444
|
+
z20.object({ type: z20.literal("api"), name: z20.string() })
|
|
3322
3445
|
])
|
|
3323
3446
|
).nullish()
|
|
3324
3447
|
}),
|
|
3325
|
-
|
|
3326
|
-
type:
|
|
3327
|
-
url:
|
|
3448
|
+
z20.object({
|
|
3449
|
+
type: z20.literal("open_page"),
|
|
3450
|
+
url: z20.string().nullish()
|
|
3328
3451
|
}),
|
|
3329
|
-
|
|
3330
|
-
type:
|
|
3331
|
-
url:
|
|
3332
|
-
pattern:
|
|
3452
|
+
z20.object({
|
|
3453
|
+
type: z20.literal("find_in_page"),
|
|
3454
|
+
url: z20.string().nullish(),
|
|
3455
|
+
pattern: z20.string().nullish()
|
|
3333
3456
|
})
|
|
3334
3457
|
]).nullish()
|
|
3335
3458
|
}),
|
|
3336
|
-
|
|
3337
|
-
type:
|
|
3338
|
-
id:
|
|
3339
|
-
queries:
|
|
3340
|
-
results:
|
|
3341
|
-
|
|
3342
|
-
attributes:
|
|
3343
|
-
|
|
3344
|
-
|
|
3459
|
+
z20.object({
|
|
3460
|
+
type: z20.literal("file_search_call"),
|
|
3461
|
+
id: z20.string(),
|
|
3462
|
+
queries: z20.array(z20.string()),
|
|
3463
|
+
results: z20.array(
|
|
3464
|
+
z20.object({
|
|
3465
|
+
attributes: z20.record(
|
|
3466
|
+
z20.string(),
|
|
3467
|
+
z20.union([z20.string(), z20.number(), z20.boolean()])
|
|
3345
3468
|
),
|
|
3346
|
-
file_id:
|
|
3347
|
-
filename:
|
|
3348
|
-
score:
|
|
3349
|
-
text:
|
|
3469
|
+
file_id: z20.string(),
|
|
3470
|
+
filename: z20.string(),
|
|
3471
|
+
score: z20.number(),
|
|
3472
|
+
text: z20.string()
|
|
3350
3473
|
})
|
|
3351
3474
|
).nullish()
|
|
3352
3475
|
}),
|
|
3353
|
-
|
|
3354
|
-
type:
|
|
3355
|
-
id:
|
|
3356
|
-
call_id:
|
|
3357
|
-
action:
|
|
3358
|
-
type:
|
|
3359
|
-
command:
|
|
3360
|
-
timeout_ms:
|
|
3361
|
-
user:
|
|
3362
|
-
working_directory:
|
|
3363
|
-
env:
|
|
3476
|
+
z20.object({
|
|
3477
|
+
type: z20.literal("local_shell_call"),
|
|
3478
|
+
id: z20.string(),
|
|
3479
|
+
call_id: z20.string(),
|
|
3480
|
+
action: z20.object({
|
|
3481
|
+
type: z20.literal("exec"),
|
|
3482
|
+
command: z20.array(z20.string()),
|
|
3483
|
+
timeout_ms: z20.number().optional(),
|
|
3484
|
+
user: z20.string().optional(),
|
|
3485
|
+
working_directory: z20.string().optional(),
|
|
3486
|
+
env: z20.record(z20.string(), z20.string()).optional()
|
|
3364
3487
|
})
|
|
3365
3488
|
}),
|
|
3366
|
-
|
|
3367
|
-
type:
|
|
3368
|
-
id:
|
|
3369
|
-
status:
|
|
3489
|
+
z20.object({
|
|
3490
|
+
type: z20.literal("computer_call"),
|
|
3491
|
+
id: z20.string(),
|
|
3492
|
+
status: z20.literal("completed")
|
|
3370
3493
|
}),
|
|
3371
|
-
|
|
3372
|
-
type:
|
|
3373
|
-
id:
|
|
3374
|
-
status:
|
|
3375
|
-
arguments:
|
|
3376
|
-
name:
|
|
3377
|
-
server_label:
|
|
3378
|
-
output:
|
|
3379
|
-
error:
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
type:
|
|
3383
|
-
code:
|
|
3384
|
-
message:
|
|
3494
|
+
z20.object({
|
|
3495
|
+
type: z20.literal("mcp_call"),
|
|
3496
|
+
id: z20.string(),
|
|
3497
|
+
status: z20.string(),
|
|
3498
|
+
arguments: z20.string(),
|
|
3499
|
+
name: z20.string(),
|
|
3500
|
+
server_label: z20.string(),
|
|
3501
|
+
output: z20.string().nullish(),
|
|
3502
|
+
error: z20.union([
|
|
3503
|
+
z20.string(),
|
|
3504
|
+
z20.object({
|
|
3505
|
+
type: z20.string().optional(),
|
|
3506
|
+
code: z20.union([z20.number(), z20.string()]).optional(),
|
|
3507
|
+
message: z20.string().optional()
|
|
3385
3508
|
}).loose()
|
|
3386
3509
|
]).nullish(),
|
|
3387
|
-
approval_request_id:
|
|
3510
|
+
approval_request_id: z20.string().nullish()
|
|
3388
3511
|
}),
|
|
3389
|
-
|
|
3390
|
-
type:
|
|
3391
|
-
id:
|
|
3392
|
-
server_label:
|
|
3393
|
-
tools:
|
|
3394
|
-
|
|
3395
|
-
name:
|
|
3396
|
-
description:
|
|
3397
|
-
input_schema:
|
|
3398
|
-
annotations:
|
|
3512
|
+
z20.object({
|
|
3513
|
+
type: z20.literal("mcp_list_tools"),
|
|
3514
|
+
id: z20.string(),
|
|
3515
|
+
server_label: z20.string(),
|
|
3516
|
+
tools: z20.array(
|
|
3517
|
+
z20.object({
|
|
3518
|
+
name: z20.string(),
|
|
3519
|
+
description: z20.string().optional(),
|
|
3520
|
+
input_schema: z20.any(),
|
|
3521
|
+
annotations: z20.record(z20.string(), z20.unknown()).optional()
|
|
3399
3522
|
})
|
|
3400
3523
|
),
|
|
3401
|
-
error:
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
type:
|
|
3405
|
-
code:
|
|
3406
|
-
message:
|
|
3524
|
+
error: z20.union([
|
|
3525
|
+
z20.string(),
|
|
3526
|
+
z20.object({
|
|
3527
|
+
type: z20.string().optional(),
|
|
3528
|
+
code: z20.union([z20.number(), z20.string()]).optional(),
|
|
3529
|
+
message: z20.string().optional()
|
|
3407
3530
|
}).loose()
|
|
3408
3531
|
]).optional()
|
|
3409
3532
|
}),
|
|
3410
|
-
|
|
3411
|
-
type:
|
|
3412
|
-
id:
|
|
3413
|
-
server_label:
|
|
3414
|
-
name:
|
|
3415
|
-
arguments:
|
|
3416
|
-
approval_request_id:
|
|
3533
|
+
z20.object({
|
|
3534
|
+
type: z20.literal("mcp_approval_request"),
|
|
3535
|
+
id: z20.string(),
|
|
3536
|
+
server_label: z20.string(),
|
|
3537
|
+
name: z20.string(),
|
|
3538
|
+
arguments: z20.string(),
|
|
3539
|
+
approval_request_id: z20.string().optional()
|
|
3417
3540
|
}),
|
|
3418
|
-
|
|
3419
|
-
type:
|
|
3420
|
-
id:
|
|
3421
|
-
call_id:
|
|
3422
|
-
status:
|
|
3423
|
-
operation:
|
|
3424
|
-
|
|
3425
|
-
type:
|
|
3426
|
-
path:
|
|
3427
|
-
diff:
|
|
3541
|
+
z20.object({
|
|
3542
|
+
type: z20.literal("apply_patch_call"),
|
|
3543
|
+
id: z20.string(),
|
|
3544
|
+
call_id: z20.string(),
|
|
3545
|
+
status: z20.enum(["in_progress", "completed"]),
|
|
3546
|
+
operation: z20.discriminatedUnion("type", [
|
|
3547
|
+
z20.object({
|
|
3548
|
+
type: z20.literal("create_file"),
|
|
3549
|
+
path: z20.string(),
|
|
3550
|
+
diff: z20.string()
|
|
3428
3551
|
}),
|
|
3429
|
-
|
|
3430
|
-
type:
|
|
3431
|
-
path:
|
|
3552
|
+
z20.object({
|
|
3553
|
+
type: z20.literal("delete_file"),
|
|
3554
|
+
path: z20.string()
|
|
3432
3555
|
}),
|
|
3433
|
-
|
|
3434
|
-
type:
|
|
3435
|
-
path:
|
|
3436
|
-
diff:
|
|
3556
|
+
z20.object({
|
|
3557
|
+
type: z20.literal("update_file"),
|
|
3558
|
+
path: z20.string(),
|
|
3559
|
+
diff: z20.string()
|
|
3437
3560
|
})
|
|
3438
3561
|
])
|
|
3439
3562
|
}),
|
|
3440
|
-
|
|
3441
|
-
type:
|
|
3442
|
-
id:
|
|
3443
|
-
call_id:
|
|
3444
|
-
status:
|
|
3445
|
-
action:
|
|
3446
|
-
commands:
|
|
3563
|
+
z20.object({
|
|
3564
|
+
type: z20.literal("shell_call"),
|
|
3565
|
+
id: z20.string(),
|
|
3566
|
+
call_id: z20.string(),
|
|
3567
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
3568
|
+
action: z20.object({
|
|
3569
|
+
commands: z20.array(z20.string())
|
|
3447
3570
|
})
|
|
3448
3571
|
}),
|
|
3449
|
-
|
|
3450
|
-
type:
|
|
3451
|
-
id:
|
|
3452
|
-
call_id:
|
|
3453
|
-
status:
|
|
3454
|
-
output:
|
|
3455
|
-
|
|
3456
|
-
stdout:
|
|
3457
|
-
stderr:
|
|
3458
|
-
outcome:
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
type:
|
|
3462
|
-
exit_code:
|
|
3572
|
+
z20.object({
|
|
3573
|
+
type: z20.literal("shell_call_output"),
|
|
3574
|
+
id: z20.string(),
|
|
3575
|
+
call_id: z20.string(),
|
|
3576
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
3577
|
+
output: z20.array(
|
|
3578
|
+
z20.object({
|
|
3579
|
+
stdout: z20.string(),
|
|
3580
|
+
stderr: z20.string(),
|
|
3581
|
+
outcome: z20.discriminatedUnion("type", [
|
|
3582
|
+
z20.object({ type: z20.literal("timeout") }),
|
|
3583
|
+
z20.object({
|
|
3584
|
+
type: z20.literal("exit"),
|
|
3585
|
+
exit_code: z20.number()
|
|
3463
3586
|
})
|
|
3464
3587
|
])
|
|
3465
3588
|
})
|
|
@@ -3467,101 +3590,107 @@ var openaiResponsesChunkSchema = lazySchema17(
|
|
|
3467
3590
|
})
|
|
3468
3591
|
])
|
|
3469
3592
|
}),
|
|
3470
|
-
|
|
3471
|
-
type:
|
|
3472
|
-
item_id:
|
|
3473
|
-
output_index:
|
|
3474
|
-
delta:
|
|
3593
|
+
z20.object({
|
|
3594
|
+
type: z20.literal("response.function_call_arguments.delta"),
|
|
3595
|
+
item_id: z20.string(),
|
|
3596
|
+
output_index: z20.number(),
|
|
3597
|
+
delta: z20.string()
|
|
3475
3598
|
}),
|
|
3476
|
-
|
|
3477
|
-
type:
|
|
3478
|
-
item_id:
|
|
3479
|
-
output_index:
|
|
3480
|
-
|
|
3599
|
+
z20.object({
|
|
3600
|
+
type: z20.literal("response.custom_tool_call_input.delta"),
|
|
3601
|
+
item_id: z20.string(),
|
|
3602
|
+
output_index: z20.number(),
|
|
3603
|
+
delta: z20.string()
|
|
3481
3604
|
}),
|
|
3482
|
-
|
|
3483
|
-
type:
|
|
3484
|
-
item_id:
|
|
3485
|
-
output_index:
|
|
3486
|
-
|
|
3605
|
+
z20.object({
|
|
3606
|
+
type: z20.literal("response.image_generation_call.partial_image"),
|
|
3607
|
+
item_id: z20.string(),
|
|
3608
|
+
output_index: z20.number(),
|
|
3609
|
+
partial_image_b64: z20.string()
|
|
3487
3610
|
}),
|
|
3488
|
-
|
|
3489
|
-
type:
|
|
3490
|
-
item_id:
|
|
3491
|
-
output_index:
|
|
3492
|
-
|
|
3611
|
+
z20.object({
|
|
3612
|
+
type: z20.literal("response.code_interpreter_call_code.delta"),
|
|
3613
|
+
item_id: z20.string(),
|
|
3614
|
+
output_index: z20.number(),
|
|
3615
|
+
delta: z20.string()
|
|
3493
3616
|
}),
|
|
3494
|
-
|
|
3495
|
-
type:
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3617
|
+
z20.object({
|
|
3618
|
+
type: z20.literal("response.code_interpreter_call_code.done"),
|
|
3619
|
+
item_id: z20.string(),
|
|
3620
|
+
output_index: z20.number(),
|
|
3621
|
+
code: z20.string()
|
|
3622
|
+
}),
|
|
3623
|
+
z20.object({
|
|
3624
|
+
type: z20.literal("response.output_text.annotation.added"),
|
|
3625
|
+
annotation: z20.discriminatedUnion("type", [
|
|
3626
|
+
z20.object({
|
|
3627
|
+
type: z20.literal("url_citation"),
|
|
3628
|
+
start_index: z20.number(),
|
|
3629
|
+
end_index: z20.number(),
|
|
3630
|
+
url: z20.string(),
|
|
3631
|
+
title: z20.string()
|
|
3503
3632
|
}),
|
|
3504
|
-
|
|
3505
|
-
type:
|
|
3506
|
-
file_id:
|
|
3507
|
-
filename:
|
|
3508
|
-
index:
|
|
3633
|
+
z20.object({
|
|
3634
|
+
type: z20.literal("file_citation"),
|
|
3635
|
+
file_id: z20.string(),
|
|
3636
|
+
filename: z20.string(),
|
|
3637
|
+
index: z20.number()
|
|
3509
3638
|
}),
|
|
3510
|
-
|
|
3511
|
-
type:
|
|
3512
|
-
container_id:
|
|
3513
|
-
file_id:
|
|
3514
|
-
filename:
|
|
3515
|
-
start_index:
|
|
3516
|
-
end_index:
|
|
3639
|
+
z20.object({
|
|
3640
|
+
type: z20.literal("container_file_citation"),
|
|
3641
|
+
container_id: z20.string(),
|
|
3642
|
+
file_id: z20.string(),
|
|
3643
|
+
filename: z20.string(),
|
|
3644
|
+
start_index: z20.number(),
|
|
3645
|
+
end_index: z20.number()
|
|
3517
3646
|
}),
|
|
3518
|
-
|
|
3519
|
-
type:
|
|
3520
|
-
file_id:
|
|
3521
|
-
index:
|
|
3647
|
+
z20.object({
|
|
3648
|
+
type: z20.literal("file_path"),
|
|
3649
|
+
file_id: z20.string(),
|
|
3650
|
+
index: z20.number()
|
|
3522
3651
|
})
|
|
3523
3652
|
])
|
|
3524
3653
|
}),
|
|
3525
|
-
|
|
3526
|
-
type:
|
|
3527
|
-
item_id:
|
|
3528
|
-
summary_index:
|
|
3654
|
+
z20.object({
|
|
3655
|
+
type: z20.literal("response.reasoning_summary_part.added"),
|
|
3656
|
+
item_id: z20.string(),
|
|
3657
|
+
summary_index: z20.number()
|
|
3529
3658
|
}),
|
|
3530
|
-
|
|
3531
|
-
type:
|
|
3532
|
-
item_id:
|
|
3533
|
-
summary_index:
|
|
3534
|
-
delta:
|
|
3659
|
+
z20.object({
|
|
3660
|
+
type: z20.literal("response.reasoning_summary_text.delta"),
|
|
3661
|
+
item_id: z20.string(),
|
|
3662
|
+
summary_index: z20.number(),
|
|
3663
|
+
delta: z20.string()
|
|
3535
3664
|
}),
|
|
3536
|
-
|
|
3537
|
-
type:
|
|
3538
|
-
item_id:
|
|
3539
|
-
summary_index:
|
|
3665
|
+
z20.object({
|
|
3666
|
+
type: z20.literal("response.reasoning_summary_part.done"),
|
|
3667
|
+
item_id: z20.string(),
|
|
3668
|
+
summary_index: z20.number()
|
|
3540
3669
|
}),
|
|
3541
|
-
|
|
3542
|
-
type:
|
|
3543
|
-
item_id:
|
|
3544
|
-
output_index:
|
|
3545
|
-
delta:
|
|
3546
|
-
obfuscation:
|
|
3670
|
+
z20.object({
|
|
3671
|
+
type: z20.literal("response.apply_patch_call_operation_diff.delta"),
|
|
3672
|
+
item_id: z20.string(),
|
|
3673
|
+
output_index: z20.number(),
|
|
3674
|
+
delta: z20.string(),
|
|
3675
|
+
obfuscation: z20.string().nullish()
|
|
3547
3676
|
}),
|
|
3548
|
-
|
|
3549
|
-
type:
|
|
3550
|
-
item_id:
|
|
3551
|
-
output_index:
|
|
3552
|
-
diff:
|
|
3677
|
+
z20.object({
|
|
3678
|
+
type: z20.literal("response.apply_patch_call_operation_diff.done"),
|
|
3679
|
+
item_id: z20.string(),
|
|
3680
|
+
output_index: z20.number(),
|
|
3681
|
+
diff: z20.string()
|
|
3553
3682
|
}),
|
|
3554
|
-
|
|
3555
|
-
type:
|
|
3556
|
-
sequence_number:
|
|
3557
|
-
error:
|
|
3558
|
-
type:
|
|
3559
|
-
code:
|
|
3560
|
-
message:
|
|
3561
|
-
param:
|
|
3683
|
+
z20.object({
|
|
3684
|
+
type: z20.literal("error"),
|
|
3685
|
+
sequence_number: z20.number(),
|
|
3686
|
+
error: z20.object({
|
|
3687
|
+
type: z20.string(),
|
|
3688
|
+
code: z20.string(),
|
|
3689
|
+
message: z20.string(),
|
|
3690
|
+
param: z20.string().nullish()
|
|
3562
3691
|
})
|
|
3563
3692
|
}),
|
|
3564
|
-
|
|
3693
|
+
z20.object({ type: z20.string() }).loose().transform((value) => ({
|
|
3565
3694
|
type: "unknown_chunk",
|
|
3566
3695
|
message: value.type
|
|
3567
3696
|
}))
|
|
@@ -3569,265 +3698,272 @@ var openaiResponsesChunkSchema = lazySchema17(
|
|
|
3569
3698
|
])
|
|
3570
3699
|
)
|
|
3571
3700
|
);
|
|
3572
|
-
var openaiResponsesResponseSchema =
|
|
3573
|
-
() =>
|
|
3574
|
-
|
|
3575
|
-
id:
|
|
3576
|
-
created_at:
|
|
3577
|
-
error:
|
|
3578
|
-
message:
|
|
3579
|
-
type:
|
|
3580
|
-
param:
|
|
3581
|
-
code:
|
|
3701
|
+
var openaiResponsesResponseSchema = lazySchema18(
|
|
3702
|
+
() => zodSchema18(
|
|
3703
|
+
z20.object({
|
|
3704
|
+
id: z20.string().optional(),
|
|
3705
|
+
created_at: z20.number().optional(),
|
|
3706
|
+
error: z20.object({
|
|
3707
|
+
message: z20.string(),
|
|
3708
|
+
type: z20.string(),
|
|
3709
|
+
param: z20.string().nullish(),
|
|
3710
|
+
code: z20.string()
|
|
3582
3711
|
}).nullish(),
|
|
3583
|
-
model:
|
|
3584
|
-
output:
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
type:
|
|
3588
|
-
role:
|
|
3589
|
-
id:
|
|
3590
|
-
phase:
|
|
3591
|
-
content:
|
|
3592
|
-
|
|
3593
|
-
type:
|
|
3594
|
-
text:
|
|
3595
|
-
logprobs:
|
|
3596
|
-
|
|
3597
|
-
token:
|
|
3598
|
-
logprob:
|
|
3599
|
-
top_logprobs:
|
|
3600
|
-
|
|
3601
|
-
token:
|
|
3602
|
-
logprob:
|
|
3712
|
+
model: z20.string().optional(),
|
|
3713
|
+
output: z20.array(
|
|
3714
|
+
z20.discriminatedUnion("type", [
|
|
3715
|
+
z20.object({
|
|
3716
|
+
type: z20.literal("message"),
|
|
3717
|
+
role: z20.literal("assistant"),
|
|
3718
|
+
id: z20.string(),
|
|
3719
|
+
phase: z20.enum(["commentary", "final_answer"]).nullish(),
|
|
3720
|
+
content: z20.array(
|
|
3721
|
+
z20.object({
|
|
3722
|
+
type: z20.literal("output_text"),
|
|
3723
|
+
text: z20.string(),
|
|
3724
|
+
logprobs: z20.array(
|
|
3725
|
+
z20.object({
|
|
3726
|
+
token: z20.string(),
|
|
3727
|
+
logprob: z20.number(),
|
|
3728
|
+
top_logprobs: z20.array(
|
|
3729
|
+
z20.object({
|
|
3730
|
+
token: z20.string(),
|
|
3731
|
+
logprob: z20.number()
|
|
3603
3732
|
})
|
|
3604
3733
|
)
|
|
3605
3734
|
})
|
|
3606
3735
|
).nullish(),
|
|
3607
|
-
annotations:
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
type:
|
|
3611
|
-
start_index:
|
|
3612
|
-
end_index:
|
|
3613
|
-
url:
|
|
3614
|
-
title:
|
|
3736
|
+
annotations: z20.array(
|
|
3737
|
+
z20.discriminatedUnion("type", [
|
|
3738
|
+
z20.object({
|
|
3739
|
+
type: z20.literal("url_citation"),
|
|
3740
|
+
start_index: z20.number(),
|
|
3741
|
+
end_index: z20.number(),
|
|
3742
|
+
url: z20.string(),
|
|
3743
|
+
title: z20.string()
|
|
3615
3744
|
}),
|
|
3616
|
-
|
|
3617
|
-
type:
|
|
3618
|
-
file_id:
|
|
3619
|
-
filename:
|
|
3620
|
-
index:
|
|
3745
|
+
z20.object({
|
|
3746
|
+
type: z20.literal("file_citation"),
|
|
3747
|
+
file_id: z20.string(),
|
|
3748
|
+
filename: z20.string(),
|
|
3749
|
+
index: z20.number()
|
|
3621
3750
|
}),
|
|
3622
|
-
|
|
3623
|
-
type:
|
|
3624
|
-
container_id:
|
|
3625
|
-
file_id:
|
|
3626
|
-
filename:
|
|
3627
|
-
start_index:
|
|
3628
|
-
end_index:
|
|
3751
|
+
z20.object({
|
|
3752
|
+
type: z20.literal("container_file_citation"),
|
|
3753
|
+
container_id: z20.string(),
|
|
3754
|
+
file_id: z20.string(),
|
|
3755
|
+
filename: z20.string(),
|
|
3756
|
+
start_index: z20.number(),
|
|
3757
|
+
end_index: z20.number()
|
|
3629
3758
|
}),
|
|
3630
|
-
|
|
3631
|
-
type:
|
|
3632
|
-
file_id:
|
|
3633
|
-
index:
|
|
3759
|
+
z20.object({
|
|
3760
|
+
type: z20.literal("file_path"),
|
|
3761
|
+
file_id: z20.string(),
|
|
3762
|
+
index: z20.number()
|
|
3634
3763
|
})
|
|
3635
3764
|
])
|
|
3636
3765
|
)
|
|
3637
3766
|
})
|
|
3638
3767
|
)
|
|
3639
3768
|
}),
|
|
3640
|
-
|
|
3641
|
-
type:
|
|
3642
|
-
id:
|
|
3643
|
-
status:
|
|
3644
|
-
action:
|
|
3645
|
-
|
|
3646
|
-
type:
|
|
3647
|
-
query:
|
|
3648
|
-
sources:
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
type:
|
|
3653
|
-
name:
|
|
3769
|
+
z20.object({
|
|
3770
|
+
type: z20.literal("web_search_call"),
|
|
3771
|
+
id: z20.string(),
|
|
3772
|
+
status: z20.string(),
|
|
3773
|
+
action: z20.discriminatedUnion("type", [
|
|
3774
|
+
z20.object({
|
|
3775
|
+
type: z20.literal("search"),
|
|
3776
|
+
query: z20.string().nullish(),
|
|
3777
|
+
sources: z20.array(
|
|
3778
|
+
z20.discriminatedUnion("type", [
|
|
3779
|
+
z20.object({ type: z20.literal("url"), url: z20.string() }),
|
|
3780
|
+
z20.object({
|
|
3781
|
+
type: z20.literal("api"),
|
|
3782
|
+
name: z20.string()
|
|
3654
3783
|
})
|
|
3655
3784
|
])
|
|
3656
3785
|
).nullish()
|
|
3657
3786
|
}),
|
|
3658
|
-
|
|
3659
|
-
type:
|
|
3660
|
-
url:
|
|
3787
|
+
z20.object({
|
|
3788
|
+
type: z20.literal("open_page"),
|
|
3789
|
+
url: z20.string().nullish()
|
|
3661
3790
|
}),
|
|
3662
|
-
|
|
3663
|
-
type:
|
|
3664
|
-
url:
|
|
3665
|
-
pattern:
|
|
3791
|
+
z20.object({
|
|
3792
|
+
type: z20.literal("find_in_page"),
|
|
3793
|
+
url: z20.string().nullish(),
|
|
3794
|
+
pattern: z20.string().nullish()
|
|
3666
3795
|
})
|
|
3667
3796
|
]).nullish()
|
|
3668
3797
|
}),
|
|
3669
|
-
|
|
3670
|
-
type:
|
|
3671
|
-
id:
|
|
3672
|
-
queries:
|
|
3673
|
-
results:
|
|
3674
|
-
|
|
3675
|
-
attributes:
|
|
3676
|
-
|
|
3677
|
-
|
|
3798
|
+
z20.object({
|
|
3799
|
+
type: z20.literal("file_search_call"),
|
|
3800
|
+
id: z20.string(),
|
|
3801
|
+
queries: z20.array(z20.string()),
|
|
3802
|
+
results: z20.array(
|
|
3803
|
+
z20.object({
|
|
3804
|
+
attributes: z20.record(
|
|
3805
|
+
z20.string(),
|
|
3806
|
+
z20.union([z20.string(), z20.number(), z20.boolean()])
|
|
3678
3807
|
),
|
|
3679
|
-
file_id:
|
|
3680
|
-
filename:
|
|
3681
|
-
score:
|
|
3682
|
-
text:
|
|
3808
|
+
file_id: z20.string(),
|
|
3809
|
+
filename: z20.string(),
|
|
3810
|
+
score: z20.number(),
|
|
3811
|
+
text: z20.string()
|
|
3683
3812
|
})
|
|
3684
3813
|
).nullish()
|
|
3685
3814
|
}),
|
|
3686
|
-
|
|
3687
|
-
type:
|
|
3688
|
-
id:
|
|
3689
|
-
code:
|
|
3690
|
-
container_id:
|
|
3691
|
-
outputs:
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3815
|
+
z20.object({
|
|
3816
|
+
type: z20.literal("code_interpreter_call"),
|
|
3817
|
+
id: z20.string(),
|
|
3818
|
+
code: z20.string().nullable(),
|
|
3819
|
+
container_id: z20.string(),
|
|
3820
|
+
outputs: z20.array(
|
|
3821
|
+
z20.discriminatedUnion("type", [
|
|
3822
|
+
z20.object({ type: z20.literal("logs"), logs: z20.string() }),
|
|
3823
|
+
z20.object({ type: z20.literal("image"), url: z20.string() })
|
|
3695
3824
|
])
|
|
3696
3825
|
).nullable()
|
|
3697
3826
|
}),
|
|
3698
|
-
|
|
3699
|
-
type:
|
|
3700
|
-
id:
|
|
3701
|
-
result:
|
|
3827
|
+
z20.object({
|
|
3828
|
+
type: z20.literal("image_generation_call"),
|
|
3829
|
+
id: z20.string(),
|
|
3830
|
+
result: z20.string()
|
|
3702
3831
|
}),
|
|
3703
|
-
|
|
3704
|
-
type:
|
|
3705
|
-
id:
|
|
3706
|
-
call_id:
|
|
3707
|
-
action:
|
|
3708
|
-
type:
|
|
3709
|
-
command:
|
|
3710
|
-
timeout_ms:
|
|
3711
|
-
user:
|
|
3712
|
-
working_directory:
|
|
3713
|
-
env:
|
|
3832
|
+
z20.object({
|
|
3833
|
+
type: z20.literal("local_shell_call"),
|
|
3834
|
+
id: z20.string(),
|
|
3835
|
+
call_id: z20.string(),
|
|
3836
|
+
action: z20.object({
|
|
3837
|
+
type: z20.literal("exec"),
|
|
3838
|
+
command: z20.array(z20.string()),
|
|
3839
|
+
timeout_ms: z20.number().optional(),
|
|
3840
|
+
user: z20.string().optional(),
|
|
3841
|
+
working_directory: z20.string().optional(),
|
|
3842
|
+
env: z20.record(z20.string(), z20.string()).optional()
|
|
3714
3843
|
})
|
|
3715
3844
|
}),
|
|
3716
|
-
|
|
3717
|
-
type:
|
|
3718
|
-
call_id:
|
|
3719
|
-
name:
|
|
3720
|
-
arguments:
|
|
3721
|
-
id:
|
|
3845
|
+
z20.object({
|
|
3846
|
+
type: z20.literal("function_call"),
|
|
3847
|
+
call_id: z20.string(),
|
|
3848
|
+
name: z20.string(),
|
|
3849
|
+
arguments: z20.string(),
|
|
3850
|
+
id: z20.string()
|
|
3851
|
+
}),
|
|
3852
|
+
z20.object({
|
|
3853
|
+
type: z20.literal("custom_tool_call"),
|
|
3854
|
+
call_id: z20.string(),
|
|
3855
|
+
name: z20.string(),
|
|
3856
|
+
input: z20.string(),
|
|
3857
|
+
id: z20.string()
|
|
3722
3858
|
}),
|
|
3723
|
-
|
|
3724
|
-
type:
|
|
3725
|
-
id:
|
|
3726
|
-
status:
|
|
3859
|
+
z20.object({
|
|
3860
|
+
type: z20.literal("computer_call"),
|
|
3861
|
+
id: z20.string(),
|
|
3862
|
+
status: z20.string().optional()
|
|
3727
3863
|
}),
|
|
3728
|
-
|
|
3729
|
-
type:
|
|
3730
|
-
id:
|
|
3731
|
-
encrypted_content:
|
|
3732
|
-
summary:
|
|
3733
|
-
|
|
3734
|
-
type:
|
|
3735
|
-
text:
|
|
3864
|
+
z20.object({
|
|
3865
|
+
type: z20.literal("reasoning"),
|
|
3866
|
+
id: z20.string(),
|
|
3867
|
+
encrypted_content: z20.string().nullish(),
|
|
3868
|
+
summary: z20.array(
|
|
3869
|
+
z20.object({
|
|
3870
|
+
type: z20.literal("summary_text"),
|
|
3871
|
+
text: z20.string()
|
|
3736
3872
|
})
|
|
3737
3873
|
)
|
|
3738
3874
|
}),
|
|
3739
|
-
|
|
3740
|
-
type:
|
|
3741
|
-
id:
|
|
3742
|
-
status:
|
|
3743
|
-
arguments:
|
|
3744
|
-
name:
|
|
3745
|
-
server_label:
|
|
3746
|
-
output:
|
|
3747
|
-
error:
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
type:
|
|
3751
|
-
code:
|
|
3752
|
-
message:
|
|
3875
|
+
z20.object({
|
|
3876
|
+
type: z20.literal("mcp_call"),
|
|
3877
|
+
id: z20.string(),
|
|
3878
|
+
status: z20.string(),
|
|
3879
|
+
arguments: z20.string(),
|
|
3880
|
+
name: z20.string(),
|
|
3881
|
+
server_label: z20.string(),
|
|
3882
|
+
output: z20.string().nullish(),
|
|
3883
|
+
error: z20.union([
|
|
3884
|
+
z20.string(),
|
|
3885
|
+
z20.object({
|
|
3886
|
+
type: z20.string().optional(),
|
|
3887
|
+
code: z20.union([z20.number(), z20.string()]).optional(),
|
|
3888
|
+
message: z20.string().optional()
|
|
3753
3889
|
}).loose()
|
|
3754
3890
|
]).nullish(),
|
|
3755
|
-
approval_request_id:
|
|
3891
|
+
approval_request_id: z20.string().nullish()
|
|
3756
3892
|
}),
|
|
3757
|
-
|
|
3758
|
-
type:
|
|
3759
|
-
id:
|
|
3760
|
-
server_label:
|
|
3761
|
-
tools:
|
|
3762
|
-
|
|
3763
|
-
name:
|
|
3764
|
-
description:
|
|
3765
|
-
input_schema:
|
|
3766
|
-
annotations:
|
|
3893
|
+
z20.object({
|
|
3894
|
+
type: z20.literal("mcp_list_tools"),
|
|
3895
|
+
id: z20.string(),
|
|
3896
|
+
server_label: z20.string(),
|
|
3897
|
+
tools: z20.array(
|
|
3898
|
+
z20.object({
|
|
3899
|
+
name: z20.string(),
|
|
3900
|
+
description: z20.string().optional(),
|
|
3901
|
+
input_schema: z20.any(),
|
|
3902
|
+
annotations: z20.record(z20.string(), z20.unknown()).optional()
|
|
3767
3903
|
})
|
|
3768
3904
|
),
|
|
3769
|
-
error:
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
type:
|
|
3773
|
-
code:
|
|
3774
|
-
message:
|
|
3905
|
+
error: z20.union([
|
|
3906
|
+
z20.string(),
|
|
3907
|
+
z20.object({
|
|
3908
|
+
type: z20.string().optional(),
|
|
3909
|
+
code: z20.union([z20.number(), z20.string()]).optional(),
|
|
3910
|
+
message: z20.string().optional()
|
|
3775
3911
|
}).loose()
|
|
3776
3912
|
]).optional()
|
|
3777
3913
|
}),
|
|
3778
|
-
|
|
3779
|
-
type:
|
|
3780
|
-
id:
|
|
3781
|
-
server_label:
|
|
3782
|
-
name:
|
|
3783
|
-
arguments:
|
|
3784
|
-
approval_request_id:
|
|
3914
|
+
z20.object({
|
|
3915
|
+
type: z20.literal("mcp_approval_request"),
|
|
3916
|
+
id: z20.string(),
|
|
3917
|
+
server_label: z20.string(),
|
|
3918
|
+
name: z20.string(),
|
|
3919
|
+
arguments: z20.string(),
|
|
3920
|
+
approval_request_id: z20.string().optional()
|
|
3785
3921
|
}),
|
|
3786
|
-
|
|
3787
|
-
type:
|
|
3788
|
-
id:
|
|
3789
|
-
call_id:
|
|
3790
|
-
status:
|
|
3791
|
-
operation:
|
|
3792
|
-
|
|
3793
|
-
type:
|
|
3794
|
-
path:
|
|
3795
|
-
diff:
|
|
3922
|
+
z20.object({
|
|
3923
|
+
type: z20.literal("apply_patch_call"),
|
|
3924
|
+
id: z20.string(),
|
|
3925
|
+
call_id: z20.string(),
|
|
3926
|
+
status: z20.enum(["in_progress", "completed"]),
|
|
3927
|
+
operation: z20.discriminatedUnion("type", [
|
|
3928
|
+
z20.object({
|
|
3929
|
+
type: z20.literal("create_file"),
|
|
3930
|
+
path: z20.string(),
|
|
3931
|
+
diff: z20.string()
|
|
3796
3932
|
}),
|
|
3797
|
-
|
|
3798
|
-
type:
|
|
3799
|
-
path:
|
|
3933
|
+
z20.object({
|
|
3934
|
+
type: z20.literal("delete_file"),
|
|
3935
|
+
path: z20.string()
|
|
3800
3936
|
}),
|
|
3801
|
-
|
|
3802
|
-
type:
|
|
3803
|
-
path:
|
|
3804
|
-
diff:
|
|
3937
|
+
z20.object({
|
|
3938
|
+
type: z20.literal("update_file"),
|
|
3939
|
+
path: z20.string(),
|
|
3940
|
+
diff: z20.string()
|
|
3805
3941
|
})
|
|
3806
3942
|
])
|
|
3807
3943
|
}),
|
|
3808
|
-
|
|
3809
|
-
type:
|
|
3810
|
-
id:
|
|
3811
|
-
call_id:
|
|
3812
|
-
status:
|
|
3813
|
-
action:
|
|
3814
|
-
commands:
|
|
3944
|
+
z20.object({
|
|
3945
|
+
type: z20.literal("shell_call"),
|
|
3946
|
+
id: z20.string(),
|
|
3947
|
+
call_id: z20.string(),
|
|
3948
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
3949
|
+
action: z20.object({
|
|
3950
|
+
commands: z20.array(z20.string())
|
|
3815
3951
|
})
|
|
3816
3952
|
}),
|
|
3817
|
-
|
|
3818
|
-
type:
|
|
3819
|
-
id:
|
|
3820
|
-
call_id:
|
|
3821
|
-
status:
|
|
3822
|
-
output:
|
|
3823
|
-
|
|
3824
|
-
stdout:
|
|
3825
|
-
stderr:
|
|
3826
|
-
outcome:
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
type:
|
|
3830
|
-
exit_code:
|
|
3953
|
+
z20.object({
|
|
3954
|
+
type: z20.literal("shell_call_output"),
|
|
3955
|
+
id: z20.string(),
|
|
3956
|
+
call_id: z20.string(),
|
|
3957
|
+
status: z20.enum(["in_progress", "completed", "incomplete"]),
|
|
3958
|
+
output: z20.array(
|
|
3959
|
+
z20.object({
|
|
3960
|
+
stdout: z20.string(),
|
|
3961
|
+
stderr: z20.string(),
|
|
3962
|
+
outcome: z20.discriminatedUnion("type", [
|
|
3963
|
+
z20.object({ type: z20.literal("timeout") }),
|
|
3964
|
+
z20.object({
|
|
3965
|
+
type: z20.literal("exit"),
|
|
3966
|
+
exit_code: z20.number()
|
|
3831
3967
|
})
|
|
3832
3968
|
])
|
|
3833
3969
|
})
|
|
@@ -3835,37 +3971,31 @@ var openaiResponsesResponseSchema = lazySchema17(
|
|
|
3835
3971
|
})
|
|
3836
3972
|
])
|
|
3837
3973
|
).optional(),
|
|
3838
|
-
service_tier:
|
|
3839
|
-
incomplete_details:
|
|
3840
|
-
usage:
|
|
3841
|
-
input_tokens:
|
|
3842
|
-
input_tokens_details:
|
|
3843
|
-
output_tokens:
|
|
3844
|
-
output_tokens_details:
|
|
3974
|
+
service_tier: z20.string().nullish(),
|
|
3975
|
+
incomplete_details: z20.object({ reason: z20.string() }).nullish(),
|
|
3976
|
+
usage: z20.object({
|
|
3977
|
+
input_tokens: z20.number(),
|
|
3978
|
+
input_tokens_details: z20.object({ cached_tokens: z20.number().nullish() }).nullish(),
|
|
3979
|
+
output_tokens: z20.number(),
|
|
3980
|
+
output_tokens_details: z20.object({ reasoning_tokens: z20.number().nullish() }).nullish()
|
|
3845
3981
|
}).optional()
|
|
3846
3982
|
})
|
|
3847
3983
|
)
|
|
3848
3984
|
);
|
|
3849
3985
|
|
|
3850
3986
|
// src/responses/openai-responses-options.ts
|
|
3851
|
-
import { lazySchema as
|
|
3852
|
-
import { z as
|
|
3987
|
+
import { lazySchema as lazySchema19, zodSchema as zodSchema19 } from "@ai-sdk/provider-utils";
|
|
3988
|
+
import { z as z21 } from "zod/v4";
|
|
3853
3989
|
var TOP_LOGPROBS_MAX = 20;
|
|
3854
3990
|
var openaiResponsesReasoningModelIds = [
|
|
3855
3991
|
"o1",
|
|
3856
3992
|
"o1-2024-12-17",
|
|
3857
3993
|
"o3",
|
|
3858
3994
|
"o3-2025-04-16",
|
|
3859
|
-
"o3-deep-research",
|
|
3860
|
-
"o3-deep-research-2025-06-26",
|
|
3861
3995
|
"o3-mini",
|
|
3862
3996
|
"o3-mini-2025-01-31",
|
|
3863
3997
|
"o4-mini",
|
|
3864
3998
|
"o4-mini-2025-04-16",
|
|
3865
|
-
"o4-mini-deep-research",
|
|
3866
|
-
"o4-mini-deep-research-2025-06-26",
|
|
3867
|
-
"codex-mini-latest",
|
|
3868
|
-
"computer-use-preview",
|
|
3869
3999
|
"gpt-5",
|
|
3870
4000
|
"gpt-5-2025-08-07",
|
|
3871
4001
|
"gpt-5-codex",
|
|
@@ -3898,7 +4028,6 @@ var openaiResponsesModelIds = [
|
|
|
3898
4028
|
"gpt-4o-2024-08-06",
|
|
3899
4029
|
"gpt-4o-2024-11-20",
|
|
3900
4030
|
"gpt-4o-audio-preview",
|
|
3901
|
-
"gpt-4o-audio-preview-2024-10-01",
|
|
3902
4031
|
"gpt-4o-audio-preview-2024-12-17",
|
|
3903
4032
|
"gpt-4o-search-preview",
|
|
3904
4033
|
"gpt-4o-search-preview-2025-03-11",
|
|
@@ -3906,25 +4035,15 @@ var openaiResponsesModelIds = [
|
|
|
3906
4035
|
"gpt-4o-mini-search-preview-2025-03-11",
|
|
3907
4036
|
"gpt-4o-mini",
|
|
3908
4037
|
"gpt-4o-mini-2024-07-18",
|
|
3909
|
-
"gpt-4-turbo",
|
|
3910
|
-
"gpt-4-turbo-2024-04-09",
|
|
3911
|
-
"gpt-4-turbo-preview",
|
|
3912
|
-
"gpt-4-0125-preview",
|
|
3913
|
-
"gpt-4-1106-preview",
|
|
3914
|
-
"gpt-4",
|
|
3915
|
-
"gpt-4-0613",
|
|
3916
|
-
"gpt-4.5-preview",
|
|
3917
|
-
"gpt-4.5-preview-2025-02-27",
|
|
3918
4038
|
"gpt-3.5-turbo-0125",
|
|
3919
4039
|
"gpt-3.5-turbo",
|
|
3920
4040
|
"gpt-3.5-turbo-1106",
|
|
3921
|
-
"chatgpt-4o-latest",
|
|
3922
4041
|
"gpt-5-chat-latest",
|
|
3923
4042
|
...openaiResponsesReasoningModelIds
|
|
3924
4043
|
];
|
|
3925
|
-
var openaiLanguageModelResponsesOptionsSchema =
|
|
3926
|
-
() =>
|
|
3927
|
-
|
|
4044
|
+
var openaiLanguageModelResponsesOptionsSchema = lazySchema19(
|
|
4045
|
+
() => zodSchema19(
|
|
4046
|
+
z21.object({
|
|
3928
4047
|
/**
|
|
3929
4048
|
* The ID of the OpenAI Conversation to continue.
|
|
3930
4049
|
* You must create a conversation first via the OpenAI API.
|
|
@@ -3932,13 +4051,13 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
|
3932
4051
|
* Defaults to `undefined`.
|
|
3933
4052
|
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
3934
4053
|
*/
|
|
3935
|
-
conversation:
|
|
4054
|
+
conversation: z21.string().nullish(),
|
|
3936
4055
|
/**
|
|
3937
4056
|
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
3938
4057
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
|
|
3939
4058
|
*/
|
|
3940
|
-
include:
|
|
3941
|
-
|
|
4059
|
+
include: z21.array(
|
|
4060
|
+
z21.enum([
|
|
3942
4061
|
"reasoning.encrypted_content",
|
|
3943
4062
|
// handled internally by default, only needed for unknown reasoning models
|
|
3944
4063
|
"file_search_call.results",
|
|
@@ -3950,7 +4069,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
|
3950
4069
|
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
3951
4070
|
* Defaults to `undefined`.
|
|
3952
4071
|
*/
|
|
3953
|
-
instructions:
|
|
4072
|
+
instructions: z21.string().nullish(),
|
|
3954
4073
|
/**
|
|
3955
4074
|
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
3956
4075
|
* the response size and can slow down response times. However, it can
|
|
@@ -3965,30 +4084,30 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
|
3965
4084
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
3966
4085
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
3967
4086
|
*/
|
|
3968
|
-
logprobs:
|
|
4087
|
+
logprobs: z21.union([z21.boolean(), z21.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
3969
4088
|
/**
|
|
3970
4089
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
3971
4090
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
3972
4091
|
* Any further attempts to call a tool by the model will be ignored.
|
|
3973
4092
|
*/
|
|
3974
|
-
maxToolCalls:
|
|
4093
|
+
maxToolCalls: z21.number().nullish(),
|
|
3975
4094
|
/**
|
|
3976
4095
|
* Additional metadata to store with the generation.
|
|
3977
4096
|
*/
|
|
3978
|
-
metadata:
|
|
4097
|
+
metadata: z21.any().nullish(),
|
|
3979
4098
|
/**
|
|
3980
4099
|
* Whether to use parallel tool calls. Defaults to `true`.
|
|
3981
4100
|
*/
|
|
3982
|
-
parallelToolCalls:
|
|
4101
|
+
parallelToolCalls: z21.boolean().nullish(),
|
|
3983
4102
|
/**
|
|
3984
4103
|
* The ID of the previous response. You can use it to continue a conversation.
|
|
3985
4104
|
* Defaults to `undefined`.
|
|
3986
4105
|
*/
|
|
3987
|
-
previousResponseId:
|
|
4106
|
+
previousResponseId: z21.string().nullish(),
|
|
3988
4107
|
/**
|
|
3989
4108
|
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
3990
4109
|
*/
|
|
3991
|
-
promptCacheKey:
|
|
4110
|
+
promptCacheKey: z21.string().nullish(),
|
|
3992
4111
|
/**
|
|
3993
4112
|
* The retention policy for the prompt cache.
|
|
3994
4113
|
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
@@ -3997,7 +4116,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
|
3997
4116
|
*
|
|
3998
4117
|
* @default 'in_memory'
|
|
3999
4118
|
*/
|
|
4000
|
-
promptCacheRetention:
|
|
4119
|
+
promptCacheRetention: z21.enum(["in_memory", "24h"]).nullish(),
|
|
4001
4120
|
/**
|
|
4002
4121
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
4003
4122
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
@@ -4008,17 +4127,17 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
|
4008
4127
|
* OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
|
|
4009
4128
|
* an error.
|
|
4010
4129
|
*/
|
|
4011
|
-
reasoningEffort:
|
|
4130
|
+
reasoningEffort: z21.string().nullish(),
|
|
4012
4131
|
/**
|
|
4013
4132
|
* Controls reasoning summary output from the model.
|
|
4014
4133
|
* Set to "auto" to automatically receive the richest level available,
|
|
4015
4134
|
* or "detailed" for comprehensive summaries.
|
|
4016
4135
|
*/
|
|
4017
|
-
reasoningSummary:
|
|
4136
|
+
reasoningSummary: z21.string().nullish(),
|
|
4018
4137
|
/**
|
|
4019
4138
|
* The identifier for safety monitoring and tracking.
|
|
4020
4139
|
*/
|
|
4021
|
-
safetyIdentifier:
|
|
4140
|
+
safetyIdentifier: z21.string().nullish(),
|
|
4022
4141
|
/**
|
|
4023
4142
|
* Service tier for the request.
|
|
4024
4143
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
@@ -4026,34 +4145,34 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
|
4026
4145
|
*
|
|
4027
4146
|
* Defaults to 'auto'.
|
|
4028
4147
|
*/
|
|
4029
|
-
serviceTier:
|
|
4148
|
+
serviceTier: z21.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
4030
4149
|
/**
|
|
4031
4150
|
* Whether to store the generation. Defaults to `true`.
|
|
4032
4151
|
*/
|
|
4033
|
-
store:
|
|
4152
|
+
store: z21.boolean().nullish(),
|
|
4034
4153
|
/**
|
|
4035
4154
|
* Whether to use strict JSON schema validation.
|
|
4036
4155
|
* Defaults to `true`.
|
|
4037
4156
|
*/
|
|
4038
|
-
strictJsonSchema:
|
|
4157
|
+
strictJsonSchema: z21.boolean().nullish(),
|
|
4039
4158
|
/**
|
|
4040
4159
|
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
4041
4160
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
4042
4161
|
* Valid values: 'low', 'medium', 'high'.
|
|
4043
4162
|
*/
|
|
4044
|
-
textVerbosity:
|
|
4163
|
+
textVerbosity: z21.enum(["low", "medium", "high"]).nullish(),
|
|
4045
4164
|
/**
|
|
4046
4165
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
4047
4166
|
* 'disabled' turns truncation off.
|
|
4048
4167
|
*/
|
|
4049
|
-
truncation:
|
|
4168
|
+
truncation: z21.enum(["auto", "disabled"]).nullish(),
|
|
4050
4169
|
/**
|
|
4051
4170
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
4052
4171
|
* monitor and detect abuse.
|
|
4053
4172
|
* Defaults to `undefined`.
|
|
4054
4173
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
4055
4174
|
*/
|
|
4056
|
-
user:
|
|
4175
|
+
user: z21.string().nullish(),
|
|
4057
4176
|
/**
|
|
4058
4177
|
* Override the system message mode for this model.
|
|
4059
4178
|
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
@@ -4062,7 +4181,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
|
4062
4181
|
*
|
|
4063
4182
|
* If not specified, the mode is automatically determined based on the model.
|
|
4064
4183
|
*/
|
|
4065
|
-
systemMessageMode:
|
|
4184
|
+
systemMessageMode: z21.enum(["system", "developer", "remove"]).optional(),
|
|
4066
4185
|
/**
|
|
4067
4186
|
* Force treating this model as a reasoning model.
|
|
4068
4187
|
*
|
|
@@ -4072,7 +4191,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
|
|
|
4072
4191
|
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
4073
4192
|
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
4074
4193
|
*/
|
|
4075
|
-
forceReasoning:
|
|
4194
|
+
forceReasoning: z21.boolean().optional()
|
|
4076
4195
|
})
|
|
4077
4196
|
)
|
|
4078
4197
|
);
|
|
@@ -4084,14 +4203,18 @@ import {
|
|
|
4084
4203
|
import { validateTypes as validateTypes2 } from "@ai-sdk/provider-utils";
|
|
4085
4204
|
async function prepareResponsesTools({
|
|
4086
4205
|
tools,
|
|
4087
|
-
toolChoice
|
|
4206
|
+
toolChoice,
|
|
4207
|
+
toolNameMapping,
|
|
4208
|
+
customProviderToolNames
|
|
4088
4209
|
}) {
|
|
4210
|
+
var _a;
|
|
4089
4211
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
4090
4212
|
const toolWarnings = [];
|
|
4091
4213
|
if (tools == null) {
|
|
4092
4214
|
return { tools: void 0, toolChoice: void 0, toolWarnings };
|
|
4093
4215
|
}
|
|
4094
4216
|
const openaiTools2 = [];
|
|
4217
|
+
const resolvedCustomProviderToolNames = customProviderToolNames != null ? customProviderToolNames : /* @__PURE__ */ new Set();
|
|
4095
4218
|
for (const tool of tools) {
|
|
4096
4219
|
switch (tool.type) {
|
|
4097
4220
|
case "function":
|
|
@@ -4233,6 +4356,20 @@ async function prepareResponsesTools({
|
|
|
4233
4356
|
});
|
|
4234
4357
|
break;
|
|
4235
4358
|
}
|
|
4359
|
+
case "openai.custom": {
|
|
4360
|
+
const args = await validateTypes2({
|
|
4361
|
+
value: tool.args,
|
|
4362
|
+
schema: customArgsSchema
|
|
4363
|
+
});
|
|
4364
|
+
openaiTools2.push({
|
|
4365
|
+
type: "custom",
|
|
4366
|
+
name: args.name,
|
|
4367
|
+
description: args.description,
|
|
4368
|
+
format: args.format
|
|
4369
|
+
});
|
|
4370
|
+
resolvedCustomProviderToolNames.add(args.name);
|
|
4371
|
+
break;
|
|
4372
|
+
}
|
|
4236
4373
|
}
|
|
4237
4374
|
break;
|
|
4238
4375
|
}
|
|
@@ -4253,12 +4390,14 @@ async function prepareResponsesTools({
|
|
|
4253
4390
|
case "none":
|
|
4254
4391
|
case "required":
|
|
4255
4392
|
return { tools: openaiTools2, toolChoice: type, toolWarnings };
|
|
4256
|
-
case "tool":
|
|
4393
|
+
case "tool": {
|
|
4394
|
+
const resolvedToolName = (_a = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _a : toolChoice.toolName;
|
|
4257
4395
|
return {
|
|
4258
4396
|
tools: openaiTools2,
|
|
4259
|
-
toolChoice:
|
|
4397
|
+
toolChoice: resolvedToolName === "code_interpreter" || resolvedToolName === "file_search" || resolvedToolName === "image_generation" || resolvedToolName === "web_search_preview" || resolvedToolName === "web_search" || resolvedToolName === "mcp" || resolvedToolName === "apply_patch" ? { type: resolvedToolName } : resolvedCustomProviderToolNames.has(resolvedToolName) ? { type: "custom", name: resolvedToolName } : { type: "function", name: resolvedToolName },
|
|
4260
4398
|
toolWarnings
|
|
4261
4399
|
};
|
|
4400
|
+
}
|
|
4262
4401
|
default: {
|
|
4263
4402
|
const _exhaustiveCheck = type;
|
|
4264
4403
|
throw new UnsupportedFunctionalityError5({
|
|
@@ -4409,7 +4548,19 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4409
4548
|
"openai.web_search_preview": "web_search_preview",
|
|
4410
4549
|
"openai.mcp": "mcp",
|
|
4411
4550
|
"openai.apply_patch": "apply_patch"
|
|
4412
|
-
}
|
|
4551
|
+
},
|
|
4552
|
+
resolveProviderToolName: (tool) => tool.id === "openai.custom" ? tool.args.name : void 0
|
|
4553
|
+
});
|
|
4554
|
+
const customProviderToolNames = /* @__PURE__ */ new Set();
|
|
4555
|
+
const {
|
|
4556
|
+
tools: openaiTools2,
|
|
4557
|
+
toolChoice: openaiToolChoice,
|
|
4558
|
+
toolWarnings
|
|
4559
|
+
} = await prepareResponsesTools({
|
|
4560
|
+
tools,
|
|
4561
|
+
toolChoice,
|
|
4562
|
+
toolNameMapping,
|
|
4563
|
+
customProviderToolNames
|
|
4413
4564
|
});
|
|
4414
4565
|
const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
|
|
4415
4566
|
prompt,
|
|
@@ -4421,7 +4572,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4421
4572
|
hasConversation: (openaiOptions == null ? void 0 : openaiOptions.conversation) != null,
|
|
4422
4573
|
hasLocalShellTool: hasOpenAITool("openai.local_shell"),
|
|
4423
4574
|
hasShellTool: hasOpenAITool("openai.shell"),
|
|
4424
|
-
hasApplyPatchTool: hasOpenAITool("openai.apply_patch")
|
|
4575
|
+
hasApplyPatchTool: hasOpenAITool("openai.apply_patch"),
|
|
4576
|
+
customProviderToolNames: customProviderToolNames.size > 0 ? customProviderToolNames : void 0
|
|
4425
4577
|
});
|
|
4426
4578
|
warnings.push(...inputWarnings);
|
|
4427
4579
|
const strictJsonSchema = (_d = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _d : true;
|
|
@@ -4554,14 +4706,6 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4554
4706
|
});
|
|
4555
4707
|
delete baseArgs.service_tier;
|
|
4556
4708
|
}
|
|
4557
|
-
const {
|
|
4558
|
-
tools: openaiTools2,
|
|
4559
|
-
toolChoice: openaiToolChoice,
|
|
4560
|
-
toolWarnings
|
|
4561
|
-
} = await prepareResponsesTools({
|
|
4562
|
-
tools,
|
|
4563
|
-
toolChoice
|
|
4564
|
-
});
|
|
4565
4709
|
const shellToolEnvType = (_i = (_h = (_g = tools == null ? void 0 : tools.find(
|
|
4566
4710
|
(tool) => tool.type === "provider" && tool.id === "openai.shell"
|
|
4567
4711
|
)) == null ? void 0 : _g.args) == null ? void 0 : _h.environment) == null ? void 0 : _i.type;
|
|
@@ -4811,6 +4955,22 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4811
4955
|
});
|
|
4812
4956
|
break;
|
|
4813
4957
|
}
|
|
4958
|
+
case "custom_tool_call": {
|
|
4959
|
+
hasFunctionCall = true;
|
|
4960
|
+
const toolName = toolNameMapping.toCustomToolName(part.name);
|
|
4961
|
+
content.push({
|
|
4962
|
+
type: "tool-call",
|
|
4963
|
+
toolCallId: part.call_id,
|
|
4964
|
+
toolName,
|
|
4965
|
+
input: JSON.stringify(part.input),
|
|
4966
|
+
providerMetadata: {
|
|
4967
|
+
[providerOptionsName]: {
|
|
4968
|
+
itemId: part.id
|
|
4969
|
+
}
|
|
4970
|
+
}
|
|
4971
|
+
});
|
|
4972
|
+
break;
|
|
4973
|
+
}
|
|
4814
4974
|
case "web_search_call": {
|
|
4815
4975
|
content.push({
|
|
4816
4976
|
type: "tool-call",
|
|
@@ -5069,6 +5229,19 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5069
5229
|
id: value.item.call_id,
|
|
5070
5230
|
toolName: value.item.name
|
|
5071
5231
|
});
|
|
5232
|
+
} else if (value.item.type === "custom_tool_call") {
|
|
5233
|
+
const toolName = toolNameMapping.toCustomToolName(
|
|
5234
|
+
value.item.name
|
|
5235
|
+
);
|
|
5236
|
+
ongoingToolCalls[value.output_index] = {
|
|
5237
|
+
toolName,
|
|
5238
|
+
toolCallId: value.item.call_id
|
|
5239
|
+
};
|
|
5240
|
+
controller.enqueue({
|
|
5241
|
+
type: "tool-input-start",
|
|
5242
|
+
id: value.item.call_id,
|
|
5243
|
+
toolName
|
|
5244
|
+
});
|
|
5072
5245
|
} else if (value.item.type === "web_search_call") {
|
|
5073
5246
|
ongoingToolCalls[value.output_index] = {
|
|
5074
5247
|
toolName: toolNameMapping.toCustomToolName(
|
|
@@ -5253,6 +5426,27 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5253
5426
|
}
|
|
5254
5427
|
}
|
|
5255
5428
|
});
|
|
5429
|
+
} else if (value.item.type === "custom_tool_call") {
|
|
5430
|
+
ongoingToolCalls[value.output_index] = void 0;
|
|
5431
|
+
hasFunctionCall = true;
|
|
5432
|
+
const toolName = toolNameMapping.toCustomToolName(
|
|
5433
|
+
value.item.name
|
|
5434
|
+
);
|
|
5435
|
+
controller.enqueue({
|
|
5436
|
+
type: "tool-input-end",
|
|
5437
|
+
id: value.item.call_id
|
|
5438
|
+
});
|
|
5439
|
+
controller.enqueue({
|
|
5440
|
+
type: "tool-call",
|
|
5441
|
+
toolCallId: value.item.call_id,
|
|
5442
|
+
toolName,
|
|
5443
|
+
input: JSON.stringify(value.item.input),
|
|
5444
|
+
providerMetadata: {
|
|
5445
|
+
[providerOptionsName]: {
|
|
5446
|
+
itemId: value.item.id
|
|
5447
|
+
}
|
|
5448
|
+
}
|
|
5449
|
+
});
|
|
5256
5450
|
} else if (value.item.type === "web_search_call") {
|
|
5257
5451
|
ongoingToolCalls[value.output_index] = void 0;
|
|
5258
5452
|
controller.enqueue({
|
|
@@ -5502,6 +5696,15 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5502
5696
|
delta: value.delta
|
|
5503
5697
|
});
|
|
5504
5698
|
}
|
|
5699
|
+
} else if (isResponseCustomToolCallInputDeltaChunk(value)) {
|
|
5700
|
+
const toolCall = ongoingToolCalls[value.output_index];
|
|
5701
|
+
if (toolCall != null) {
|
|
5702
|
+
controller.enqueue({
|
|
5703
|
+
type: "tool-input-delta",
|
|
5704
|
+
id: toolCall.toolCallId,
|
|
5705
|
+
delta: value.delta
|
|
5706
|
+
});
|
|
5707
|
+
}
|
|
5505
5708
|
} else if (isResponseApplyPatchCallOperationDiffDeltaChunk(value)) {
|
|
5506
5709
|
const toolCall = ongoingToolCalls[value.output_index];
|
|
5507
5710
|
if (toolCall == null ? void 0 : toolCall.applyPatch) {
|
|
@@ -5762,6 +5965,9 @@ function isResponseCreatedChunk(chunk) {
|
|
|
5762
5965
|
function isResponseFunctionCallArgumentsDeltaChunk(chunk) {
|
|
5763
5966
|
return chunk.type === "response.function_call_arguments.delta";
|
|
5764
5967
|
}
|
|
5968
|
+
function isResponseCustomToolCallInputDeltaChunk(chunk) {
|
|
5969
|
+
return chunk.type === "response.custom_tool_call_input.delta";
|
|
5970
|
+
}
|
|
5765
5971
|
function isResponseImageGenerationCallPartialImageChunk(chunk) {
|
|
5766
5972
|
return chunk.type === "response.image_generation_call.partial_image";
|
|
5767
5973
|
}
|
|
@@ -5823,13 +6029,13 @@ import {
|
|
|
5823
6029
|
} from "@ai-sdk/provider-utils";
|
|
5824
6030
|
|
|
5825
6031
|
// src/speech/openai-speech-options.ts
|
|
5826
|
-
import { lazySchema as
|
|
5827
|
-
import { z as
|
|
5828
|
-
var openaiSpeechModelOptionsSchema =
|
|
5829
|
-
() =>
|
|
5830
|
-
|
|
5831
|
-
instructions:
|
|
5832
|
-
speed:
|
|
6032
|
+
import { lazySchema as lazySchema20, zodSchema as zodSchema20 } from "@ai-sdk/provider-utils";
|
|
6033
|
+
import { z as z22 } from "zod/v4";
|
|
6034
|
+
var openaiSpeechModelOptionsSchema = lazySchema20(
|
|
6035
|
+
() => zodSchema20(
|
|
6036
|
+
z22.object({
|
|
6037
|
+
instructions: z22.string().nullish(),
|
|
6038
|
+
speed: z22.number().min(0.25).max(4).default(1).nullish()
|
|
5833
6039
|
})
|
|
5834
6040
|
)
|
|
5835
6041
|
);
|
|
@@ -5946,33 +6152,33 @@ import {
|
|
|
5946
6152
|
} from "@ai-sdk/provider-utils";
|
|
5947
6153
|
|
|
5948
6154
|
// src/transcription/openai-transcription-api.ts
|
|
5949
|
-
import { lazySchema as
|
|
5950
|
-
import { z as
|
|
5951
|
-
var openaiTranscriptionResponseSchema =
|
|
5952
|
-
() =>
|
|
5953
|
-
|
|
5954
|
-
text:
|
|
5955
|
-
language:
|
|
5956
|
-
duration:
|
|
5957
|
-
words:
|
|
5958
|
-
|
|
5959
|
-
word:
|
|
5960
|
-
start:
|
|
5961
|
-
end:
|
|
6155
|
+
import { lazySchema as lazySchema21, zodSchema as zodSchema21 } from "@ai-sdk/provider-utils";
|
|
6156
|
+
import { z as z23 } from "zod/v4";
|
|
6157
|
+
var openaiTranscriptionResponseSchema = lazySchema21(
|
|
6158
|
+
() => zodSchema21(
|
|
6159
|
+
z23.object({
|
|
6160
|
+
text: z23.string(),
|
|
6161
|
+
language: z23.string().nullish(),
|
|
6162
|
+
duration: z23.number().nullish(),
|
|
6163
|
+
words: z23.array(
|
|
6164
|
+
z23.object({
|
|
6165
|
+
word: z23.string(),
|
|
6166
|
+
start: z23.number(),
|
|
6167
|
+
end: z23.number()
|
|
5962
6168
|
})
|
|
5963
6169
|
).nullish(),
|
|
5964
|
-
segments:
|
|
5965
|
-
|
|
5966
|
-
id:
|
|
5967
|
-
seek:
|
|
5968
|
-
start:
|
|
5969
|
-
end:
|
|
5970
|
-
text:
|
|
5971
|
-
tokens:
|
|
5972
|
-
temperature:
|
|
5973
|
-
avg_logprob:
|
|
5974
|
-
compression_ratio:
|
|
5975
|
-
no_speech_prob:
|
|
6170
|
+
segments: z23.array(
|
|
6171
|
+
z23.object({
|
|
6172
|
+
id: z23.number(),
|
|
6173
|
+
seek: z23.number(),
|
|
6174
|
+
start: z23.number(),
|
|
6175
|
+
end: z23.number(),
|
|
6176
|
+
text: z23.string(),
|
|
6177
|
+
tokens: z23.array(z23.number()),
|
|
6178
|
+
temperature: z23.number(),
|
|
6179
|
+
avg_logprob: z23.number(),
|
|
6180
|
+
compression_ratio: z23.number(),
|
|
6181
|
+
no_speech_prob: z23.number()
|
|
5976
6182
|
})
|
|
5977
6183
|
).nullish()
|
|
5978
6184
|
})
|
|
@@ -5980,33 +6186,33 @@ var openaiTranscriptionResponseSchema = lazySchema20(
|
|
|
5980
6186
|
);
|
|
5981
6187
|
|
|
5982
6188
|
// src/transcription/openai-transcription-options.ts
|
|
5983
|
-
import { lazySchema as
|
|
5984
|
-
import { z as
|
|
5985
|
-
var openAITranscriptionModelOptions =
|
|
5986
|
-
() =>
|
|
5987
|
-
|
|
6189
|
+
import { lazySchema as lazySchema22, zodSchema as zodSchema22 } from "@ai-sdk/provider-utils";
|
|
6190
|
+
import { z as z24 } from "zod/v4";
|
|
6191
|
+
var openAITranscriptionModelOptions = lazySchema22(
|
|
6192
|
+
() => zodSchema22(
|
|
6193
|
+
z24.object({
|
|
5988
6194
|
/**
|
|
5989
6195
|
* Additional information to include in the transcription response.
|
|
5990
6196
|
*/
|
|
5991
|
-
include:
|
|
6197
|
+
include: z24.array(z24.string()).optional(),
|
|
5992
6198
|
/**
|
|
5993
6199
|
* The language of the input audio in ISO-639-1 format.
|
|
5994
6200
|
*/
|
|
5995
|
-
language:
|
|
6201
|
+
language: z24.string().optional(),
|
|
5996
6202
|
/**
|
|
5997
6203
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
5998
6204
|
*/
|
|
5999
|
-
prompt:
|
|
6205
|
+
prompt: z24.string().optional(),
|
|
6000
6206
|
/**
|
|
6001
6207
|
* The sampling temperature, between 0 and 1.
|
|
6002
6208
|
* @default 0
|
|
6003
6209
|
*/
|
|
6004
|
-
temperature:
|
|
6210
|
+
temperature: z24.number().min(0).max(1).default(0).optional(),
|
|
6005
6211
|
/**
|
|
6006
6212
|
* The timestamp granularities to populate for this transcription.
|
|
6007
6213
|
* @default ['segment']
|
|
6008
6214
|
*/
|
|
6009
|
-
timestampGranularities:
|
|
6215
|
+
timestampGranularities: z24.array(z24.enum(["word", "segment"])).default(["segment"]).optional()
|
|
6010
6216
|
})
|
|
6011
6217
|
)
|
|
6012
6218
|
);
|
|
@@ -6179,7 +6385,7 @@ var OpenAITranscriptionModel = class {
|
|
|
6179
6385
|
};
|
|
6180
6386
|
|
|
6181
6387
|
// src/version.ts
|
|
6182
|
-
var VERSION = true ? "3.0.
|
|
6388
|
+
var VERSION = true ? "3.0.38" : "0.0.0-test";
|
|
6183
6389
|
|
|
6184
6390
|
// src/openai-provider.ts
|
|
6185
6391
|
function createOpenAI(options = {}) {
|