@ai-sdk/openai 3.0.0-beta.71 → 3.0.0-beta.72
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 +9 -0
- package/dist/index.d.mts +0 -16
- package/dist/index.d.ts +0 -16
- package/dist/index.js +80 -79
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +81 -79
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +249 -232
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +260 -242
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/internal/index.mjs
CHANGED
|
@@ -2128,6 +2128,7 @@ import {
|
|
|
2128
2128
|
combineHeaders as combineHeaders7,
|
|
2129
2129
|
createEventSourceResponseHandler as createEventSourceResponseHandler3,
|
|
2130
2130
|
createJsonResponseHandler as createJsonResponseHandler6,
|
|
2131
|
+
createToolNameMapping,
|
|
2131
2132
|
generateId as generateId2,
|
|
2132
2133
|
parseProviderOptions as parseProviderOptions7,
|
|
2133
2134
|
postJsonToApi as postJsonToApi6
|
|
@@ -2171,7 +2172,6 @@ var localShellOutputSchema = lazySchema11(
|
|
|
2171
2172
|
);
|
|
2172
2173
|
var localShell = createProviderDefinedToolFactoryWithOutputSchema({
|
|
2173
2174
|
id: "openai.local_shell",
|
|
2174
|
-
name: "local_shell",
|
|
2175
2175
|
inputSchema: localShellInputSchema,
|
|
2176
2176
|
outputSchema: localShellOutputSchema
|
|
2177
2177
|
});
|
|
@@ -2183,6 +2183,7 @@ function isFileId(data, prefixes) {
|
|
|
2183
2183
|
}
|
|
2184
2184
|
async function convertToOpenAIResponsesInput({
|
|
2185
2185
|
prompt,
|
|
2186
|
+
toolNameMapping,
|
|
2186
2187
|
systemMessageMode,
|
|
2187
2188
|
fileIdPrefixes,
|
|
2188
2189
|
store,
|
|
@@ -2265,7 +2266,6 @@ async function convertToOpenAIResponsesInput({
|
|
|
2265
2266
|
}
|
|
2266
2267
|
case "assistant": {
|
|
2267
2268
|
const reasoningMessages = {};
|
|
2268
|
-
const toolCallParts = {};
|
|
2269
2269
|
for (const part of content) {
|
|
2270
2270
|
switch (part.type) {
|
|
2271
2271
|
case "text": {
|
|
@@ -2282,7 +2282,6 @@ async function convertToOpenAIResponsesInput({
|
|
|
2282
2282
|
break;
|
|
2283
2283
|
}
|
|
2284
2284
|
case "tool-call": {
|
|
2285
|
-
toolCallParts[part.toolCallId] = part;
|
|
2286
2285
|
if (part.providerExecuted) {
|
|
2287
2286
|
break;
|
|
2288
2287
|
}
|
|
@@ -2291,7 +2290,10 @@ async function convertToOpenAIResponsesInput({
|
|
|
2291
2290
|
input.push({ type: "item_reference", id });
|
|
2292
2291
|
break;
|
|
2293
2292
|
}
|
|
2294
|
-
|
|
2293
|
+
const resolvedToolName = toolNameMapping.toProviderToolName(
|
|
2294
|
+
part.toolName
|
|
2295
|
+
);
|
|
2296
|
+
if (hasLocalShellTool && resolvedToolName === "local_shell") {
|
|
2295
2297
|
const parsedInput = await validateTypes({
|
|
2296
2298
|
value: part.input,
|
|
2297
2299
|
schema: localShellInputSchema
|
|
@@ -2314,7 +2316,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2314
2316
|
input.push({
|
|
2315
2317
|
type: "function_call",
|
|
2316
2318
|
call_id: part.toolCallId,
|
|
2317
|
-
name:
|
|
2319
|
+
name: resolvedToolName,
|
|
2318
2320
|
arguments: JSON.stringify(part.input),
|
|
2319
2321
|
id
|
|
2320
2322
|
});
|
|
@@ -2393,7 +2395,10 @@ async function convertToOpenAIResponsesInput({
|
|
|
2393
2395
|
case "tool": {
|
|
2394
2396
|
for (const part of content) {
|
|
2395
2397
|
const output = part.output;
|
|
2396
|
-
|
|
2398
|
+
const resolvedToolName = toolNameMapping.toProviderToolName(
|
|
2399
|
+
part.toolName
|
|
2400
|
+
);
|
|
2401
|
+
if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
|
|
2397
2402
|
const parsedOutput = await validateTypes({
|
|
2398
2403
|
value: output.value,
|
|
2399
2404
|
schema: localShellOutputSchema
|
|
@@ -3197,6 +3202,7 @@ var openaiResponsesProviderOptionsSchema = lazySchema13(
|
|
|
3197
3202
|
import {
|
|
3198
3203
|
UnsupportedFunctionalityError as UnsupportedFunctionalityError5
|
|
3199
3204
|
} from "@ai-sdk/provider";
|
|
3205
|
+
import { validateTypes as validateTypes2 } from "@ai-sdk/provider-utils";
|
|
3200
3206
|
|
|
3201
3207
|
// src/tool/code-interpreter.ts
|
|
3202
3208
|
import {
|
|
@@ -3239,7 +3245,6 @@ var codeInterpreterArgsSchema = lazySchema14(
|
|
|
3239
3245
|
);
|
|
3240
3246
|
var codeInterpreterToolFactory = createProviderDefinedToolFactoryWithOutputSchema2({
|
|
3241
3247
|
id: "openai.code_interpreter",
|
|
3242
|
-
name: "code_interpreter",
|
|
3243
3248
|
inputSchema: codeInterpreterInputSchema,
|
|
3244
3249
|
outputSchema: codeInterpreterOutputSchema
|
|
3245
3250
|
});
|
|
@@ -3296,154 +3301,42 @@ var fileSearchOutputSchema = lazySchema15(
|
|
|
3296
3301
|
);
|
|
3297
3302
|
var fileSearch = createProviderDefinedToolFactoryWithOutputSchema3({
|
|
3298
3303
|
id: "openai.file_search",
|
|
3299
|
-
name: "file_search",
|
|
3300
3304
|
inputSchema: z17.object({}),
|
|
3301
3305
|
outputSchema: fileSearchOutputSchema
|
|
3302
3306
|
});
|
|
3303
3307
|
|
|
3304
|
-
// src/tool/
|
|
3308
|
+
// src/tool/image-generation.ts
|
|
3305
3309
|
import {
|
|
3306
3310
|
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema4,
|
|
3307
3311
|
lazySchema as lazySchema16,
|
|
3308
3312
|
zodSchema as zodSchema16
|
|
3309
3313
|
} from "@ai-sdk/provider-utils";
|
|
3310
3314
|
import { z as z18 } from "zod/v4";
|
|
3311
|
-
var
|
|
3312
|
-
() => zodSchema16(
|
|
3313
|
-
z18.object({
|
|
3314
|
-
externalWebAccess: z18.boolean().optional(),
|
|
3315
|
-
filters: z18.object({ allowedDomains: z18.array(z18.string()).optional() }).optional(),
|
|
3316
|
-
searchContextSize: z18.enum(["low", "medium", "high"]).optional(),
|
|
3317
|
-
userLocation: z18.object({
|
|
3318
|
-
type: z18.literal("approximate"),
|
|
3319
|
-
country: z18.string().optional(),
|
|
3320
|
-
city: z18.string().optional(),
|
|
3321
|
-
region: z18.string().optional(),
|
|
3322
|
-
timezone: z18.string().optional()
|
|
3323
|
-
}).optional()
|
|
3324
|
-
})
|
|
3325
|
-
)
|
|
3326
|
-
);
|
|
3327
|
-
var webSearchInputSchema = lazySchema16(() => zodSchema16(z18.object({})));
|
|
3328
|
-
var webSearchOutputSchema = lazySchema16(
|
|
3315
|
+
var imageGenerationArgsSchema = lazySchema16(
|
|
3329
3316
|
() => zodSchema16(
|
|
3330
3317
|
z18.object({
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
z18.object({
|
|
3337
|
-
type: z18.literal("openPage"),
|
|
3338
|
-
url: z18.string()
|
|
3339
|
-
}),
|
|
3340
|
-
z18.object({
|
|
3341
|
-
type: z18.literal("find"),
|
|
3342
|
-
url: z18.string(),
|
|
3343
|
-
pattern: z18.string()
|
|
3344
|
-
})
|
|
3345
|
-
]),
|
|
3346
|
-
sources: z18.array(
|
|
3347
|
-
z18.discriminatedUnion("type", [
|
|
3348
|
-
z18.object({ type: z18.literal("url"), url: z18.string() }),
|
|
3349
|
-
z18.object({ type: z18.literal("api"), name: z18.string() })
|
|
3350
|
-
])
|
|
3351
|
-
).optional()
|
|
3352
|
-
})
|
|
3353
|
-
)
|
|
3354
|
-
);
|
|
3355
|
-
var webSearchToolFactory = createProviderDefinedToolFactoryWithOutputSchema4({
|
|
3356
|
-
id: "openai.web_search",
|
|
3357
|
-
name: "web_search",
|
|
3358
|
-
inputSchema: webSearchInputSchema,
|
|
3359
|
-
outputSchema: webSearchOutputSchema
|
|
3360
|
-
});
|
|
3361
|
-
|
|
3362
|
-
// src/tool/web-search-preview.ts
|
|
3363
|
-
import {
|
|
3364
|
-
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema5,
|
|
3365
|
-
lazySchema as lazySchema17,
|
|
3366
|
-
zodSchema as zodSchema17
|
|
3367
|
-
} from "@ai-sdk/provider-utils";
|
|
3368
|
-
import { z as z19 } from "zod/v4";
|
|
3369
|
-
var webSearchPreviewArgsSchema = lazySchema17(
|
|
3370
|
-
() => zodSchema17(
|
|
3371
|
-
z19.object({
|
|
3372
|
-
searchContextSize: z19.enum(["low", "medium", "high"]).optional(),
|
|
3373
|
-
userLocation: z19.object({
|
|
3374
|
-
type: z19.literal("approximate"),
|
|
3375
|
-
country: z19.string().optional(),
|
|
3376
|
-
city: z19.string().optional(),
|
|
3377
|
-
region: z19.string().optional(),
|
|
3378
|
-
timezone: z19.string().optional()
|
|
3379
|
-
}).optional()
|
|
3380
|
-
})
|
|
3381
|
-
)
|
|
3382
|
-
);
|
|
3383
|
-
var webSearchPreviewInputSchema = lazySchema17(
|
|
3384
|
-
() => zodSchema17(z19.object({}))
|
|
3385
|
-
);
|
|
3386
|
-
var webSearchPreviewOutputSchema = lazySchema17(
|
|
3387
|
-
() => zodSchema17(
|
|
3388
|
-
z19.object({
|
|
3389
|
-
action: z19.discriminatedUnion("type", [
|
|
3390
|
-
z19.object({
|
|
3391
|
-
type: z19.literal("search"),
|
|
3392
|
-
query: z19.string().optional()
|
|
3393
|
-
}),
|
|
3394
|
-
z19.object({
|
|
3395
|
-
type: z19.literal("openPage"),
|
|
3396
|
-
url: z19.string()
|
|
3397
|
-
}),
|
|
3398
|
-
z19.object({
|
|
3399
|
-
type: z19.literal("find"),
|
|
3400
|
-
url: z19.string(),
|
|
3401
|
-
pattern: z19.string()
|
|
3402
|
-
})
|
|
3403
|
-
])
|
|
3404
|
-
})
|
|
3405
|
-
)
|
|
3406
|
-
);
|
|
3407
|
-
var webSearchPreview = createProviderDefinedToolFactoryWithOutputSchema5({
|
|
3408
|
-
id: "openai.web_search_preview",
|
|
3409
|
-
name: "web_search_preview",
|
|
3410
|
-
inputSchema: webSearchPreviewInputSchema,
|
|
3411
|
-
outputSchema: webSearchPreviewOutputSchema
|
|
3412
|
-
});
|
|
3413
|
-
|
|
3414
|
-
// src/tool/image-generation.ts
|
|
3415
|
-
import {
|
|
3416
|
-
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema6,
|
|
3417
|
-
lazySchema as lazySchema18,
|
|
3418
|
-
zodSchema as zodSchema18
|
|
3419
|
-
} from "@ai-sdk/provider-utils";
|
|
3420
|
-
import { z as z20 } from "zod/v4";
|
|
3421
|
-
var imageGenerationArgsSchema = lazySchema18(
|
|
3422
|
-
() => zodSchema18(
|
|
3423
|
-
z20.object({
|
|
3424
|
-
background: z20.enum(["auto", "opaque", "transparent"]).optional(),
|
|
3425
|
-
inputFidelity: z20.enum(["low", "high"]).optional(),
|
|
3426
|
-
inputImageMask: z20.object({
|
|
3427
|
-
fileId: z20.string().optional(),
|
|
3428
|
-
imageUrl: z20.string().optional()
|
|
3318
|
+
background: z18.enum(["auto", "opaque", "transparent"]).optional(),
|
|
3319
|
+
inputFidelity: z18.enum(["low", "high"]).optional(),
|
|
3320
|
+
inputImageMask: z18.object({
|
|
3321
|
+
fileId: z18.string().optional(),
|
|
3322
|
+
imageUrl: z18.string().optional()
|
|
3429
3323
|
}).optional(),
|
|
3430
|
-
model:
|
|
3431
|
-
moderation:
|
|
3432
|
-
outputCompression:
|
|
3433
|
-
outputFormat:
|
|
3434
|
-
partialImages:
|
|
3435
|
-
quality:
|
|
3436
|
-
size:
|
|
3324
|
+
model: z18.string().optional(),
|
|
3325
|
+
moderation: z18.enum(["auto"]).optional(),
|
|
3326
|
+
outputCompression: z18.number().int().min(0).max(100).optional(),
|
|
3327
|
+
outputFormat: z18.enum(["png", "jpeg", "webp"]).optional(),
|
|
3328
|
+
partialImages: z18.number().int().min(0).max(3).optional(),
|
|
3329
|
+
quality: z18.enum(["auto", "low", "medium", "high"]).optional(),
|
|
3330
|
+
size: z18.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
3437
3331
|
}).strict()
|
|
3438
3332
|
)
|
|
3439
3333
|
);
|
|
3440
|
-
var imageGenerationInputSchema =
|
|
3441
|
-
var imageGenerationOutputSchema =
|
|
3442
|
-
() =>
|
|
3334
|
+
var imageGenerationInputSchema = lazySchema16(() => zodSchema16(z18.object({})));
|
|
3335
|
+
var imageGenerationOutputSchema = lazySchema16(
|
|
3336
|
+
() => zodSchema16(z18.object({ result: z18.string() }))
|
|
3443
3337
|
);
|
|
3444
|
-
var imageGenerationToolFactory =
|
|
3338
|
+
var imageGenerationToolFactory = createProviderDefinedToolFactoryWithOutputSchema4({
|
|
3445
3339
|
id: "openai.image_generation",
|
|
3446
|
-
name: "image_generation",
|
|
3447
3340
|
inputSchema: imageGenerationInputSchema,
|
|
3448
3341
|
outputSchema: imageGenerationOutputSchema
|
|
3449
3342
|
});
|
|
@@ -3453,35 +3346,35 @@ var imageGeneration = (args = {}) => {
|
|
|
3453
3346
|
|
|
3454
3347
|
// src/tool/mcp.ts
|
|
3455
3348
|
import {
|
|
3456
|
-
createProviderDefinedToolFactoryWithOutputSchema as
|
|
3457
|
-
lazySchema as
|
|
3458
|
-
zodSchema as
|
|
3349
|
+
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema5,
|
|
3350
|
+
lazySchema as lazySchema17,
|
|
3351
|
+
zodSchema as zodSchema17
|
|
3459
3352
|
} from "@ai-sdk/provider-utils";
|
|
3460
|
-
import { z as
|
|
3461
|
-
var jsonValueSchema =
|
|
3462
|
-
() =>
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3353
|
+
import { z as z19 } from "zod/v4";
|
|
3354
|
+
var jsonValueSchema = z19.lazy(
|
|
3355
|
+
() => z19.union([
|
|
3356
|
+
z19.string(),
|
|
3357
|
+
z19.number(),
|
|
3358
|
+
z19.boolean(),
|
|
3359
|
+
z19.null(),
|
|
3360
|
+
z19.array(jsonValueSchema),
|
|
3361
|
+
z19.record(z19.string(), jsonValueSchema)
|
|
3469
3362
|
])
|
|
3470
3363
|
);
|
|
3471
|
-
var mcpArgsSchema =
|
|
3472
|
-
() =>
|
|
3473
|
-
|
|
3474
|
-
serverLabel:
|
|
3475
|
-
allowedTools:
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
readOnly:
|
|
3479
|
-
toolNames:
|
|
3364
|
+
var mcpArgsSchema = lazySchema17(
|
|
3365
|
+
() => zodSchema17(
|
|
3366
|
+
z19.object({
|
|
3367
|
+
serverLabel: z19.string(),
|
|
3368
|
+
allowedTools: z19.union([
|
|
3369
|
+
z19.array(z19.string()),
|
|
3370
|
+
z19.object({
|
|
3371
|
+
readOnly: z19.boolean().optional(),
|
|
3372
|
+
toolNames: z19.array(z19.string()).optional()
|
|
3480
3373
|
})
|
|
3481
3374
|
]).optional(),
|
|
3482
|
-
authorization:
|
|
3483
|
-
connectorId:
|
|
3484
|
-
headers:
|
|
3375
|
+
authorization: z19.string().optional(),
|
|
3376
|
+
connectorId: z19.string().optional(),
|
|
3377
|
+
headers: z19.record(z19.string(), z19.string()).optional(),
|
|
3485
3378
|
// TODO: Integrate this MCP tool approval with our SDK's existing tool approval architecture
|
|
3486
3379
|
// requireApproval: z
|
|
3487
3380
|
// .union([
|
|
@@ -3492,58 +3385,164 @@ var mcpArgsSchema = lazySchema19(
|
|
|
3492
3385
|
// }),
|
|
3493
3386
|
// ])
|
|
3494
3387
|
// .optional(),
|
|
3495
|
-
serverDescription:
|
|
3496
|
-
serverUrl:
|
|
3388
|
+
serverDescription: z19.string().optional(),
|
|
3389
|
+
serverUrl: z19.string().optional()
|
|
3497
3390
|
}).refine(
|
|
3498
3391
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
3499
3392
|
"One of serverUrl or connectorId must be provided."
|
|
3500
3393
|
)
|
|
3501
3394
|
)
|
|
3502
3395
|
);
|
|
3503
|
-
var mcpInputSchema =
|
|
3504
|
-
var mcpOutputSchema =
|
|
3505
|
-
() =>
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
type:
|
|
3509
|
-
serverLabel:
|
|
3510
|
-
name:
|
|
3511
|
-
arguments:
|
|
3512
|
-
output:
|
|
3513
|
-
error:
|
|
3396
|
+
var mcpInputSchema = lazySchema17(() => zodSchema17(z19.object({})));
|
|
3397
|
+
var mcpOutputSchema = lazySchema17(
|
|
3398
|
+
() => zodSchema17(
|
|
3399
|
+
z19.discriminatedUnion("type", [
|
|
3400
|
+
z19.object({
|
|
3401
|
+
type: z19.literal("call"),
|
|
3402
|
+
serverLabel: z19.string(),
|
|
3403
|
+
name: z19.string(),
|
|
3404
|
+
arguments: z19.string(),
|
|
3405
|
+
output: z19.string().nullable().optional(),
|
|
3406
|
+
error: z19.union([z19.string(), jsonValueSchema]).optional()
|
|
3514
3407
|
}),
|
|
3515
|
-
|
|
3516
|
-
type:
|
|
3517
|
-
serverLabel:
|
|
3518
|
-
tools:
|
|
3519
|
-
|
|
3520
|
-
name:
|
|
3521
|
-
description:
|
|
3408
|
+
z19.object({
|
|
3409
|
+
type: z19.literal("listTools"),
|
|
3410
|
+
serverLabel: z19.string(),
|
|
3411
|
+
tools: z19.array(
|
|
3412
|
+
z19.object({
|
|
3413
|
+
name: z19.string(),
|
|
3414
|
+
description: z19.string().optional(),
|
|
3522
3415
|
inputSchema: jsonValueSchema,
|
|
3523
|
-
annotations:
|
|
3416
|
+
annotations: z19.record(z19.string(), jsonValueSchema).optional()
|
|
3524
3417
|
})
|
|
3525
3418
|
),
|
|
3526
|
-
error:
|
|
3419
|
+
error: z19.union([z19.string(), jsonValueSchema]).optional()
|
|
3527
3420
|
}),
|
|
3528
|
-
|
|
3529
|
-
type:
|
|
3530
|
-
serverLabel:
|
|
3531
|
-
name:
|
|
3532
|
-
arguments:
|
|
3533
|
-
approvalRequestId:
|
|
3421
|
+
z19.object({
|
|
3422
|
+
type: z19.literal("approvalRequest"),
|
|
3423
|
+
serverLabel: z19.string(),
|
|
3424
|
+
name: z19.string(),
|
|
3425
|
+
arguments: z19.string(),
|
|
3426
|
+
approvalRequestId: z19.string()
|
|
3534
3427
|
})
|
|
3535
3428
|
])
|
|
3536
3429
|
)
|
|
3537
3430
|
);
|
|
3538
|
-
var mcpToolFactory =
|
|
3431
|
+
var mcpToolFactory = createProviderDefinedToolFactoryWithOutputSchema5({
|
|
3539
3432
|
id: "openai.mcp",
|
|
3540
|
-
name: "mcp",
|
|
3541
3433
|
inputSchema: mcpInputSchema,
|
|
3542
3434
|
outputSchema: mcpOutputSchema
|
|
3543
3435
|
});
|
|
3544
3436
|
|
|
3437
|
+
// src/tool/web-search.ts
|
|
3438
|
+
import {
|
|
3439
|
+
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema6,
|
|
3440
|
+
lazySchema as lazySchema18,
|
|
3441
|
+
zodSchema as zodSchema18
|
|
3442
|
+
} from "@ai-sdk/provider-utils";
|
|
3443
|
+
import { z as z20 } from "zod/v4";
|
|
3444
|
+
var webSearchArgsSchema = lazySchema18(
|
|
3445
|
+
() => zodSchema18(
|
|
3446
|
+
z20.object({
|
|
3447
|
+
externalWebAccess: z20.boolean().optional(),
|
|
3448
|
+
filters: z20.object({ allowedDomains: z20.array(z20.string()).optional() }).optional(),
|
|
3449
|
+
searchContextSize: z20.enum(["low", "medium", "high"]).optional(),
|
|
3450
|
+
userLocation: z20.object({
|
|
3451
|
+
type: z20.literal("approximate"),
|
|
3452
|
+
country: z20.string().optional(),
|
|
3453
|
+
city: z20.string().optional(),
|
|
3454
|
+
region: z20.string().optional(),
|
|
3455
|
+
timezone: z20.string().optional()
|
|
3456
|
+
}).optional()
|
|
3457
|
+
})
|
|
3458
|
+
)
|
|
3459
|
+
);
|
|
3460
|
+
var webSearchInputSchema = lazySchema18(() => zodSchema18(z20.object({})));
|
|
3461
|
+
var webSearchOutputSchema = lazySchema18(
|
|
3462
|
+
() => zodSchema18(
|
|
3463
|
+
z20.object({
|
|
3464
|
+
action: z20.discriminatedUnion("type", [
|
|
3465
|
+
z20.object({
|
|
3466
|
+
type: z20.literal("search"),
|
|
3467
|
+
query: z20.string().optional()
|
|
3468
|
+
}),
|
|
3469
|
+
z20.object({
|
|
3470
|
+
type: z20.literal("openPage"),
|
|
3471
|
+
url: z20.string()
|
|
3472
|
+
}),
|
|
3473
|
+
z20.object({
|
|
3474
|
+
type: z20.literal("find"),
|
|
3475
|
+
url: z20.string(),
|
|
3476
|
+
pattern: z20.string()
|
|
3477
|
+
})
|
|
3478
|
+
]),
|
|
3479
|
+
sources: z20.array(
|
|
3480
|
+
z20.discriminatedUnion("type", [
|
|
3481
|
+
z20.object({ type: z20.literal("url"), url: z20.string() }),
|
|
3482
|
+
z20.object({ type: z20.literal("api"), name: z20.string() })
|
|
3483
|
+
])
|
|
3484
|
+
).optional()
|
|
3485
|
+
})
|
|
3486
|
+
)
|
|
3487
|
+
);
|
|
3488
|
+
var webSearchToolFactory = createProviderDefinedToolFactoryWithOutputSchema6({
|
|
3489
|
+
id: "openai.web_search",
|
|
3490
|
+
inputSchema: webSearchInputSchema,
|
|
3491
|
+
outputSchema: webSearchOutputSchema
|
|
3492
|
+
});
|
|
3493
|
+
|
|
3494
|
+
// src/tool/web-search-preview.ts
|
|
3495
|
+
import {
|
|
3496
|
+
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema7,
|
|
3497
|
+
lazySchema as lazySchema19,
|
|
3498
|
+
zodSchema as zodSchema19
|
|
3499
|
+
} from "@ai-sdk/provider-utils";
|
|
3500
|
+
import { z as z21 } from "zod/v4";
|
|
3501
|
+
var webSearchPreviewArgsSchema = lazySchema19(
|
|
3502
|
+
() => zodSchema19(
|
|
3503
|
+
z21.object({
|
|
3504
|
+
searchContextSize: z21.enum(["low", "medium", "high"]).optional(),
|
|
3505
|
+
userLocation: z21.object({
|
|
3506
|
+
type: z21.literal("approximate"),
|
|
3507
|
+
country: z21.string().optional(),
|
|
3508
|
+
city: z21.string().optional(),
|
|
3509
|
+
region: z21.string().optional(),
|
|
3510
|
+
timezone: z21.string().optional()
|
|
3511
|
+
}).optional()
|
|
3512
|
+
})
|
|
3513
|
+
)
|
|
3514
|
+
);
|
|
3515
|
+
var webSearchPreviewInputSchema = lazySchema19(
|
|
3516
|
+
() => zodSchema19(z21.object({}))
|
|
3517
|
+
);
|
|
3518
|
+
var webSearchPreviewOutputSchema = lazySchema19(
|
|
3519
|
+
() => zodSchema19(
|
|
3520
|
+
z21.object({
|
|
3521
|
+
action: z21.discriminatedUnion("type", [
|
|
3522
|
+
z21.object({
|
|
3523
|
+
type: z21.literal("search"),
|
|
3524
|
+
query: z21.string().optional()
|
|
3525
|
+
}),
|
|
3526
|
+
z21.object({
|
|
3527
|
+
type: z21.literal("openPage"),
|
|
3528
|
+
url: z21.string()
|
|
3529
|
+
}),
|
|
3530
|
+
z21.object({
|
|
3531
|
+
type: z21.literal("find"),
|
|
3532
|
+
url: z21.string(),
|
|
3533
|
+
pattern: z21.string()
|
|
3534
|
+
})
|
|
3535
|
+
])
|
|
3536
|
+
})
|
|
3537
|
+
)
|
|
3538
|
+
);
|
|
3539
|
+
var webSearchPreview = createProviderDefinedToolFactoryWithOutputSchema7({
|
|
3540
|
+
id: "openai.web_search_preview",
|
|
3541
|
+
inputSchema: webSearchPreviewInputSchema,
|
|
3542
|
+
outputSchema: webSearchPreviewOutputSchema
|
|
3543
|
+
});
|
|
3544
|
+
|
|
3545
3545
|
// src/responses/openai-responses-prepare-tools.ts
|
|
3546
|
-
import { validateTypes as validateTypes2 } from "@ai-sdk/provider-utils";
|
|
3547
3546
|
async function prepareResponsesTools({
|
|
3548
3547
|
tools,
|
|
3549
3548
|
toolChoice,
|
|
@@ -3666,15 +3665,6 @@ async function prepareResponsesTools({
|
|
|
3666
3665
|
authorization: args.authorization,
|
|
3667
3666
|
connector_id: args.connectorId,
|
|
3668
3667
|
headers: args.headers,
|
|
3669
|
-
// require_approval:
|
|
3670
|
-
// typeof args.requireApproval === 'string'
|
|
3671
|
-
// ? args.requireApproval
|
|
3672
|
-
// : args.requireApproval
|
|
3673
|
-
// ? {
|
|
3674
|
-
// read_only: args.requireApproval.readOnly,
|
|
3675
|
-
// tool_names: args.requireApproval.toolNames,
|
|
3676
|
-
// }
|
|
3677
|
-
// : undefined,
|
|
3678
3668
|
require_approval: "never",
|
|
3679
3669
|
server_description: args.serverDescription,
|
|
3680
3670
|
server_url: args.serverUrl
|
|
@@ -3775,8 +3765,21 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3775
3765
|
details: "conversation and previousResponseId cannot be used together"
|
|
3776
3766
|
});
|
|
3777
3767
|
}
|
|
3768
|
+
const toolNameMapping = createToolNameMapping({
|
|
3769
|
+
tools,
|
|
3770
|
+
providerToolNames: {
|
|
3771
|
+
"openai.code_interpreter": "code_interpreter",
|
|
3772
|
+
"openai.file_search": "file_search",
|
|
3773
|
+
"openai.image_generation": "image_generation",
|
|
3774
|
+
"openai.local_shell": "local_shell",
|
|
3775
|
+
"openai.web_search": "web_search",
|
|
3776
|
+
"openai.web_search_preview": "web_search_preview",
|
|
3777
|
+
"openai.mcp": "mcp"
|
|
3778
|
+
}
|
|
3779
|
+
});
|
|
3778
3780
|
const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
|
|
3779
3781
|
prompt,
|
|
3782
|
+
toolNameMapping,
|
|
3780
3783
|
systemMessageMode: modelConfig.systemMessageMode,
|
|
3781
3784
|
fileIdPrefixes: this.config.fileIdPrefixes,
|
|
3782
3785
|
store: (_a = openaiOptions == null ? void 0 : openaiOptions.store) != null ? _a : true,
|
|
@@ -3930,7 +3933,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3930
3933
|
tool_choice: openaiToolChoice
|
|
3931
3934
|
},
|
|
3932
3935
|
warnings: [...warnings, ...toolWarnings],
|
|
3933
|
-
store
|
|
3936
|
+
store,
|
|
3937
|
+
toolNameMapping
|
|
3934
3938
|
};
|
|
3935
3939
|
}
|
|
3936
3940
|
async doGenerate(options) {
|
|
@@ -3938,7 +3942,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3938
3942
|
const {
|
|
3939
3943
|
args: body,
|
|
3940
3944
|
warnings,
|
|
3941
|
-
webSearchToolName
|
|
3945
|
+
webSearchToolName,
|
|
3946
|
+
toolNameMapping
|
|
3942
3947
|
} = await this.getArgs(options);
|
|
3943
3948
|
const url = this.config.url({
|
|
3944
3949
|
path: "/responses",
|
|
@@ -3998,14 +4003,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3998
4003
|
content.push({
|
|
3999
4004
|
type: "tool-call",
|
|
4000
4005
|
toolCallId: part.id,
|
|
4001
|
-
toolName: "image_generation",
|
|
4006
|
+
toolName: toolNameMapping.toCustomToolName("image_generation"),
|
|
4002
4007
|
input: "{}",
|
|
4003
4008
|
providerExecuted: true
|
|
4004
4009
|
});
|
|
4005
4010
|
content.push({
|
|
4006
4011
|
type: "tool-result",
|
|
4007
4012
|
toolCallId: part.id,
|
|
4008
|
-
toolName: "image_generation",
|
|
4013
|
+
toolName: toolNameMapping.toCustomToolName("image_generation"),
|
|
4009
4014
|
result: {
|
|
4010
4015
|
result: part.result
|
|
4011
4016
|
}
|
|
@@ -4016,7 +4021,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4016
4021
|
content.push({
|
|
4017
4022
|
type: "tool-call",
|
|
4018
4023
|
toolCallId: part.call_id,
|
|
4019
|
-
toolName: "local_shell",
|
|
4024
|
+
toolName: toolNameMapping.toCustomToolName("local_shell"),
|
|
4020
4025
|
input: JSON.stringify({
|
|
4021
4026
|
action: part.action
|
|
4022
4027
|
}),
|
|
@@ -4126,14 +4131,18 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4126
4131
|
content.push({
|
|
4127
4132
|
type: "tool-call",
|
|
4128
4133
|
toolCallId: part.id,
|
|
4129
|
-
toolName:
|
|
4134
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
4135
|
+
webSearchToolName != null ? webSearchToolName : "web_search"
|
|
4136
|
+
),
|
|
4130
4137
|
input: JSON.stringify({}),
|
|
4131
4138
|
providerExecuted: true
|
|
4132
4139
|
});
|
|
4133
4140
|
content.push({
|
|
4134
4141
|
type: "tool-result",
|
|
4135
4142
|
toolCallId: part.id,
|
|
4136
|
-
toolName:
|
|
4143
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
4144
|
+
webSearchToolName != null ? webSearchToolName : "web_search"
|
|
4145
|
+
),
|
|
4137
4146
|
result: mapWebSearchOutput(part.action)
|
|
4138
4147
|
});
|
|
4139
4148
|
break;
|
|
@@ -4142,14 +4151,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4142
4151
|
content.push({
|
|
4143
4152
|
type: "tool-call",
|
|
4144
4153
|
toolCallId: part.id,
|
|
4145
|
-
toolName: "mcp",
|
|
4154
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
4146
4155
|
input: JSON.stringify({}),
|
|
4147
4156
|
providerExecuted: true
|
|
4148
4157
|
});
|
|
4149
4158
|
content.push({
|
|
4150
4159
|
type: "tool-result",
|
|
4151
4160
|
toolCallId: part.id,
|
|
4152
|
-
toolName: "mcp",
|
|
4161
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
4153
4162
|
result: {
|
|
4154
4163
|
type: "call",
|
|
4155
4164
|
serverLabel: part.server_label,
|
|
@@ -4165,14 +4174,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4165
4174
|
content.push({
|
|
4166
4175
|
type: "tool-call",
|
|
4167
4176
|
toolCallId: part.id,
|
|
4168
|
-
toolName: "mcp",
|
|
4177
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
4169
4178
|
input: JSON.stringify({}),
|
|
4170
4179
|
providerExecuted: true
|
|
4171
4180
|
});
|
|
4172
4181
|
content.push({
|
|
4173
4182
|
type: "tool-result",
|
|
4174
4183
|
toolCallId: part.id,
|
|
4175
|
-
toolName: "mcp",
|
|
4184
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
4176
4185
|
result: {
|
|
4177
4186
|
type: "listTools",
|
|
4178
4187
|
serverLabel: part.server_label,
|
|
@@ -4194,14 +4203,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4194
4203
|
content.push({
|
|
4195
4204
|
type: "tool-call",
|
|
4196
4205
|
toolCallId: part.id,
|
|
4197
|
-
toolName: "mcp",
|
|
4206
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
4198
4207
|
input: JSON.stringify({}),
|
|
4199
4208
|
providerExecuted: true
|
|
4200
4209
|
});
|
|
4201
4210
|
content.push({
|
|
4202
4211
|
type: "tool-result",
|
|
4203
4212
|
toolCallId: part.id,
|
|
4204
|
-
toolName: "mcp",
|
|
4213
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
4205
4214
|
result: {
|
|
4206
4215
|
type: "approvalRequest",
|
|
4207
4216
|
serverLabel: part.server_label,
|
|
@@ -4216,14 +4225,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4216
4225
|
content.push({
|
|
4217
4226
|
type: "tool-call",
|
|
4218
4227
|
toolCallId: part.id,
|
|
4219
|
-
toolName: "computer_use",
|
|
4228
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
4220
4229
|
input: "",
|
|
4221
4230
|
providerExecuted: true
|
|
4222
4231
|
});
|
|
4223
4232
|
content.push({
|
|
4224
4233
|
type: "tool-result",
|
|
4225
4234
|
toolCallId: part.id,
|
|
4226
|
-
toolName: "computer_use",
|
|
4235
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
4227
4236
|
result: {
|
|
4228
4237
|
type: "computer_use_tool_result",
|
|
4229
4238
|
status: part.status || "completed"
|
|
@@ -4235,14 +4244,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4235
4244
|
content.push({
|
|
4236
4245
|
type: "tool-call",
|
|
4237
4246
|
toolCallId: part.id,
|
|
4238
|
-
toolName: "file_search",
|
|
4247
|
+
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
4239
4248
|
input: "{}",
|
|
4240
4249
|
providerExecuted: true
|
|
4241
4250
|
});
|
|
4242
4251
|
content.push({
|
|
4243
4252
|
type: "tool-result",
|
|
4244
4253
|
toolCallId: part.id,
|
|
4245
|
-
toolName: "file_search",
|
|
4254
|
+
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
4246
4255
|
result: {
|
|
4247
4256
|
queries: part.queries,
|
|
4248
4257
|
results: (_w = (_v = part.results) == null ? void 0 : _v.map((result) => ({
|
|
@@ -4260,7 +4269,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4260
4269
|
content.push({
|
|
4261
4270
|
type: "tool-call",
|
|
4262
4271
|
toolCallId: part.id,
|
|
4263
|
-
toolName: "code_interpreter",
|
|
4272
|
+
toolName: toolNameMapping.toCustomToolName("code_interpreter"),
|
|
4264
4273
|
input: JSON.stringify({
|
|
4265
4274
|
code: part.code,
|
|
4266
4275
|
containerId: part.container_id
|
|
@@ -4270,7 +4279,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4270
4279
|
content.push({
|
|
4271
4280
|
type: "tool-result",
|
|
4272
4281
|
toolCallId: part.id,
|
|
4273
|
-
toolName: "code_interpreter",
|
|
4282
|
+
toolName: toolNameMapping.toCustomToolName("code_interpreter"),
|
|
4274
4283
|
result: {
|
|
4275
4284
|
outputs: part.outputs
|
|
4276
4285
|
}
|
|
@@ -4319,6 +4328,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4319
4328
|
args: body,
|
|
4320
4329
|
warnings,
|
|
4321
4330
|
webSearchToolName,
|
|
4331
|
+
toolNameMapping,
|
|
4322
4332
|
store
|
|
4323
4333
|
} = await this.getArgs(options);
|
|
4324
4334
|
const { responseHeaders, value: response } = await postJsonToApi6({
|
|
@@ -4383,13 +4393,17 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4383
4393
|
});
|
|
4384
4394
|
} else if (value.item.type === "web_search_call") {
|
|
4385
4395
|
ongoingToolCalls[value.output_index] = {
|
|
4386
|
-
toolName:
|
|
4396
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
4397
|
+
webSearchToolName != null ? webSearchToolName : "web_search"
|
|
4398
|
+
),
|
|
4387
4399
|
toolCallId: value.item.id
|
|
4388
4400
|
};
|
|
4389
4401
|
controller.enqueue({
|
|
4390
4402
|
type: "tool-input-start",
|
|
4391
4403
|
id: value.item.id,
|
|
4392
|
-
toolName:
|
|
4404
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
4405
|
+
webSearchToolName != null ? webSearchToolName : "web_search"
|
|
4406
|
+
),
|
|
4393
4407
|
providerExecuted: true
|
|
4394
4408
|
});
|
|
4395
4409
|
controller.enqueue({
|
|
@@ -4399,24 +4413,26 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4399
4413
|
controller.enqueue({
|
|
4400
4414
|
type: "tool-call",
|
|
4401
4415
|
toolCallId: value.item.id,
|
|
4402
|
-
toolName:
|
|
4416
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
4417
|
+
webSearchToolName != null ? webSearchToolName : "web_search"
|
|
4418
|
+
),
|
|
4403
4419
|
input: JSON.stringify({}),
|
|
4404
4420
|
providerExecuted: true
|
|
4405
4421
|
});
|
|
4406
4422
|
} else if (value.item.type === "computer_call") {
|
|
4407
4423
|
ongoingToolCalls[value.output_index] = {
|
|
4408
|
-
toolName: "computer_use",
|
|
4424
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
4409
4425
|
toolCallId: value.item.id
|
|
4410
4426
|
};
|
|
4411
4427
|
controller.enqueue({
|
|
4412
4428
|
type: "tool-input-start",
|
|
4413
4429
|
id: value.item.id,
|
|
4414
|
-
toolName: "computer_use",
|
|
4430
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
4415
4431
|
providerExecuted: true
|
|
4416
4432
|
});
|
|
4417
4433
|
} else if (value.item.type === "code_interpreter_call") {
|
|
4418
4434
|
ongoingToolCalls[value.output_index] = {
|
|
4419
|
-
toolName: "code_interpreter",
|
|
4435
|
+
toolName: toolNameMapping.toCustomToolName("code_interpreter"),
|
|
4420
4436
|
toolCallId: value.item.id,
|
|
4421
4437
|
codeInterpreter: {
|
|
4422
4438
|
containerId: value.item.container_id
|
|
@@ -4425,7 +4441,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4425
4441
|
controller.enqueue({
|
|
4426
4442
|
type: "tool-input-start",
|
|
4427
4443
|
id: value.item.id,
|
|
4428
|
-
toolName: "code_interpreter",
|
|
4444
|
+
toolName: toolNameMapping.toCustomToolName("code_interpreter"),
|
|
4429
4445
|
providerExecuted: true
|
|
4430
4446
|
});
|
|
4431
4447
|
controller.enqueue({
|
|
@@ -4437,7 +4453,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4437
4453
|
controller.enqueue({
|
|
4438
4454
|
type: "tool-call",
|
|
4439
4455
|
toolCallId: value.item.id,
|
|
4440
|
-
toolName: "file_search",
|
|
4456
|
+
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
4441
4457
|
input: "{}",
|
|
4442
4458
|
providerExecuted: true
|
|
4443
4459
|
});
|
|
@@ -4445,7 +4461,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4445
4461
|
controller.enqueue({
|
|
4446
4462
|
type: "tool-call",
|
|
4447
4463
|
toolCallId: value.item.id,
|
|
4448
|
-
toolName: "image_generation",
|
|
4464
|
+
toolName: toolNameMapping.toCustomToolName("image_generation"),
|
|
4449
4465
|
input: "{}",
|
|
4450
4466
|
providerExecuted: true
|
|
4451
4467
|
});
|
|
@@ -4453,7 +4469,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4453
4469
|
controller.enqueue({
|
|
4454
4470
|
type: "tool-call",
|
|
4455
4471
|
toolCallId: value.item.id,
|
|
4456
|
-
toolName: "mcp",
|
|
4472
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
4457
4473
|
input: "{}",
|
|
4458
4474
|
providerExecuted: true
|
|
4459
4475
|
});
|
|
@@ -4521,7 +4537,9 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4521
4537
|
controller.enqueue({
|
|
4522
4538
|
type: "tool-result",
|
|
4523
4539
|
toolCallId: value.item.id,
|
|
4524
|
-
toolName:
|
|
4540
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
4541
|
+
webSearchToolName != null ? webSearchToolName : "web_search"
|
|
4542
|
+
),
|
|
4525
4543
|
result: mapWebSearchOutput(value.item.action)
|
|
4526
4544
|
});
|
|
4527
4545
|
} else if (value.item.type === "computer_call") {
|
|
@@ -4533,14 +4551,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4533
4551
|
controller.enqueue({
|
|
4534
4552
|
type: "tool-call",
|
|
4535
4553
|
toolCallId: value.item.id,
|
|
4536
|
-
toolName: "computer_use",
|
|
4554
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
4537
4555
|
input: "",
|
|
4538
4556
|
providerExecuted: true
|
|
4539
4557
|
});
|
|
4540
4558
|
controller.enqueue({
|
|
4541
4559
|
type: "tool-result",
|
|
4542
4560
|
toolCallId: value.item.id,
|
|
4543
|
-
toolName: "computer_use",
|
|
4561
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
4544
4562
|
result: {
|
|
4545
4563
|
type: "computer_use_tool_result",
|
|
4546
4564
|
status: value.item.status || "completed"
|
|
@@ -4551,7 +4569,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4551
4569
|
controller.enqueue({
|
|
4552
4570
|
type: "tool-result",
|
|
4553
4571
|
toolCallId: value.item.id,
|
|
4554
|
-
toolName: "file_search",
|
|
4572
|
+
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
4555
4573
|
result: {
|
|
4556
4574
|
queries: value.item.queries,
|
|
4557
4575
|
results: (_c = (_b = value.item.results) == null ? void 0 : _b.map((result) => ({
|
|
@@ -4568,7 +4586,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4568
4586
|
controller.enqueue({
|
|
4569
4587
|
type: "tool-result",
|
|
4570
4588
|
toolCallId: value.item.id,
|
|
4571
|
-
toolName: "code_interpreter",
|
|
4589
|
+
toolName: toolNameMapping.toCustomToolName("code_interpreter"),
|
|
4572
4590
|
result: {
|
|
4573
4591
|
outputs: value.item.outputs
|
|
4574
4592
|
}
|
|
@@ -4577,7 +4595,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4577
4595
|
controller.enqueue({
|
|
4578
4596
|
type: "tool-result",
|
|
4579
4597
|
toolCallId: value.item.id,
|
|
4580
|
-
toolName: "image_generation",
|
|
4598
|
+
toolName: toolNameMapping.toCustomToolName("image_generation"),
|
|
4581
4599
|
result: {
|
|
4582
4600
|
result: value.item.result
|
|
4583
4601
|
}
|
|
@@ -4587,7 +4605,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4587
4605
|
controller.enqueue({
|
|
4588
4606
|
type: "tool-result",
|
|
4589
4607
|
toolCallId: value.item.id,
|
|
4590
|
-
toolName: "mcp",
|
|
4608
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
4591
4609
|
result: {
|
|
4592
4610
|
type: "call",
|
|
4593
4611
|
serverLabel: value.item.server_label,
|
|
@@ -4602,7 +4620,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4602
4620
|
controller.enqueue({
|
|
4603
4621
|
type: "tool-result",
|
|
4604
4622
|
toolCallId: value.item.id,
|
|
4605
|
-
toolName: "mcp",
|
|
4623
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
4606
4624
|
result: {
|
|
4607
4625
|
type: "listTools",
|
|
4608
4626
|
serverLabel: value.item.server_label,
|
|
@@ -4623,7 +4641,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4623
4641
|
controller.enqueue({
|
|
4624
4642
|
type: "tool-result",
|
|
4625
4643
|
toolCallId: value.item.id,
|
|
4626
|
-
toolName: "mcp",
|
|
4644
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
4627
4645
|
result: {
|
|
4628
4646
|
type: "approvalRequest",
|
|
4629
4647
|
serverLabel: value.item.server_label,
|
|
@@ -4637,7 +4655,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4637
4655
|
controller.enqueue({
|
|
4638
4656
|
type: "tool-call",
|
|
4639
4657
|
toolCallId: value.item.call_id,
|
|
4640
|
-
toolName: "local_shell",
|
|
4658
|
+
toolName: toolNameMapping.toCustomToolName("local_shell"),
|
|
4641
4659
|
input: JSON.stringify({
|
|
4642
4660
|
action: {
|
|
4643
4661
|
type: "exec",
|
|
@@ -4686,7 +4704,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4686
4704
|
controller.enqueue({
|
|
4687
4705
|
type: "tool-result",
|
|
4688
4706
|
toolCallId: value.item_id,
|
|
4689
|
-
toolName: "image_generation",
|
|
4707
|
+
toolName: toolNameMapping.toCustomToolName("image_generation"),
|
|
4690
4708
|
result: {
|
|
4691
4709
|
result: value.partial_image_b64
|
|
4692
4710
|
},
|
|
@@ -4718,7 +4736,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4718
4736
|
controller.enqueue({
|
|
4719
4737
|
type: "tool-call",
|
|
4720
4738
|
toolCallId: toolCall.toolCallId,
|
|
4721
|
-
toolName: "code_interpreter",
|
|
4739
|
+
toolName: toolNameMapping.toCustomToolName("code_interpreter"),
|
|
4722
4740
|
input: JSON.stringify({
|
|
4723
4741
|
code: value.code,
|
|
4724
4742
|
containerId: toolCall.codeInterpreter.containerId
|