@ai-sdk/openai 3.0.0-beta.73 → 3.0.0-beta.75
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 +12 -0
- package/dist/index.d.mts +55 -2
- package/dist/index.d.ts +55 -2
- package/dist/index.js +967 -789
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +933 -751
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +128 -2
- package/dist/internal/index.d.ts +128 -2
- package/dist/internal/index.js +910 -730
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +890 -711
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/internal/index.js
CHANGED
|
@@ -27,6 +27,11 @@ __export(internal_exports, {
|
|
|
27
27
|
OpenAIResponsesLanguageModel: () => OpenAIResponsesLanguageModel,
|
|
28
28
|
OpenAISpeechModel: () => OpenAISpeechModel,
|
|
29
29
|
OpenAITranscriptionModel: () => OpenAITranscriptionModel,
|
|
30
|
+
applyPatch: () => applyPatch,
|
|
31
|
+
applyPatchArgsSchema: () => applyPatchArgsSchema,
|
|
32
|
+
applyPatchInputSchema: () => applyPatchInputSchema,
|
|
33
|
+
applyPatchOutputSchema: () => applyPatchOutputSchema,
|
|
34
|
+
applyPatchToolFactory: () => applyPatchToolFactory,
|
|
30
35
|
codeInterpreter: () => codeInterpreter,
|
|
31
36
|
codeInterpreterArgsSchema: () => codeInterpreterArgsSchema,
|
|
32
37
|
codeInterpreterInputSchema: () => codeInterpreterInputSchema,
|
|
@@ -485,12 +490,6 @@ var openaiChatLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
|
|
|
485
490
|
* Parameters for prediction mode.
|
|
486
491
|
*/
|
|
487
492
|
prediction: import_v43.z.record(import_v43.z.string(), import_v43.z.any()).optional(),
|
|
488
|
-
/**
|
|
489
|
-
* Whether to use structured outputs.
|
|
490
|
-
*
|
|
491
|
-
* @default true
|
|
492
|
-
*/
|
|
493
|
-
structuredOutputs: import_v43.z.boolean().optional(),
|
|
494
493
|
/**
|
|
495
494
|
* Service tier for the request.
|
|
496
495
|
* - 'auto': Default service tier. The request will be processed with the service tier configured in the
|
|
@@ -505,7 +504,7 @@ var openaiChatLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
|
|
|
505
504
|
/**
|
|
506
505
|
* Whether to use strict JSON schema validation.
|
|
507
506
|
*
|
|
508
|
-
* @default
|
|
507
|
+
* @default true
|
|
509
508
|
*/
|
|
510
509
|
strictJsonSchema: import_v43.z.boolean().optional(),
|
|
511
510
|
/**
|
|
@@ -544,7 +543,6 @@ var import_provider2 = require("@ai-sdk/provider");
|
|
|
544
543
|
function prepareChatTools({
|
|
545
544
|
tools,
|
|
546
545
|
toolChoice,
|
|
547
|
-
structuredOutputs,
|
|
548
546
|
strictJsonSchema
|
|
549
547
|
}) {
|
|
550
548
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
@@ -562,7 +560,7 @@ function prepareChatTools({
|
|
|
562
560
|
name: tool.name,
|
|
563
561
|
description: tool.description,
|
|
564
562
|
parameters: tool.inputSchema,
|
|
565
|
-
strict:
|
|
563
|
+
strict: strictJsonSchema
|
|
566
564
|
}
|
|
567
565
|
});
|
|
568
566
|
break;
|
|
@@ -631,24 +629,16 @@ var OpenAIChatLanguageModel = class {
|
|
|
631
629
|
toolChoice,
|
|
632
630
|
providerOptions
|
|
633
631
|
}) {
|
|
634
|
-
var _a, _b, _c
|
|
632
|
+
var _a, _b, _c;
|
|
635
633
|
const warnings = [];
|
|
636
634
|
const openaiOptions = (_a = await (0, import_provider_utils5.parseProviderOptions)({
|
|
637
635
|
provider: "openai",
|
|
638
636
|
providerOptions,
|
|
639
637
|
schema: openaiChatLanguageModelOptions
|
|
640
638
|
})) != null ? _a : {};
|
|
641
|
-
const structuredOutputs = (_b = openaiOptions.structuredOutputs) != null ? _b : true;
|
|
642
639
|
if (topK != null) {
|
|
643
640
|
warnings.push({ type: "unsupported", feature: "topK" });
|
|
644
641
|
}
|
|
645
|
-
if ((responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !structuredOutputs) {
|
|
646
|
-
warnings.push({
|
|
647
|
-
type: "unsupported",
|
|
648
|
-
feature: "responseFormat",
|
|
649
|
-
details: "JSON response format schema is only supported with structuredOutputs"
|
|
650
|
-
});
|
|
651
|
-
}
|
|
652
642
|
const { messages, warnings: messageWarnings } = convertToOpenAIChatMessages(
|
|
653
643
|
{
|
|
654
644
|
prompt,
|
|
@@ -656,7 +646,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
656
646
|
}
|
|
657
647
|
);
|
|
658
648
|
warnings.push(...messageWarnings);
|
|
659
|
-
const strictJsonSchema = (
|
|
649
|
+
const strictJsonSchema = (_b = openaiOptions.strictJsonSchema) != null ? _b : true;
|
|
660
650
|
const baseArgs = {
|
|
661
651
|
// model id:
|
|
662
652
|
model: this.modelId,
|
|
@@ -672,12 +662,12 @@ var OpenAIChatLanguageModel = class {
|
|
|
672
662
|
top_p: topP,
|
|
673
663
|
frequency_penalty: frequencyPenalty,
|
|
674
664
|
presence_penalty: presencePenalty,
|
|
675
|
-
response_format: (responseFormat == null ? void 0 : responseFormat.type) === "json" ?
|
|
665
|
+
response_format: (responseFormat == null ? void 0 : responseFormat.type) === "json" ? responseFormat.schema != null ? {
|
|
676
666
|
type: "json_schema",
|
|
677
667
|
json_schema: {
|
|
678
668
|
schema: responseFormat.schema,
|
|
679
669
|
strict: strictJsonSchema,
|
|
680
|
-
name: (
|
|
670
|
+
name: (_c = responseFormat.name) != null ? _c : "response",
|
|
681
671
|
description: responseFormat.description
|
|
682
672
|
}
|
|
683
673
|
} : { type: "json_object" } : void 0,
|
|
@@ -791,7 +781,6 @@ var OpenAIChatLanguageModel = class {
|
|
|
791
781
|
} = prepareChatTools({
|
|
792
782
|
tools,
|
|
793
783
|
toolChoice,
|
|
794
|
-
structuredOutputs,
|
|
795
784
|
strictJsonSchema
|
|
796
785
|
});
|
|
797
786
|
return {
|
|
@@ -2129,34 +2118,76 @@ var OpenAISpeechModel = class {
|
|
|
2129
2118
|
|
|
2130
2119
|
// src/responses/openai-responses-language-model.ts
|
|
2131
2120
|
var import_provider8 = require("@ai-sdk/provider");
|
|
2132
|
-
var
|
|
2121
|
+
var import_provider_utils31 = require("@ai-sdk/provider-utils");
|
|
2133
2122
|
|
|
2134
2123
|
// src/responses/convert-to-openai-responses-input.ts
|
|
2135
2124
|
var import_provider6 = require("@ai-sdk/provider");
|
|
2136
|
-
var
|
|
2137
|
-
var
|
|
2125
|
+
var import_provider_utils21 = require("@ai-sdk/provider-utils");
|
|
2126
|
+
var import_v414 = require("zod/v4");
|
|
2138
2127
|
|
|
2139
|
-
// src/tool/
|
|
2128
|
+
// src/tool/apply-patch.ts
|
|
2140
2129
|
var import_provider_utils19 = require("@ai-sdk/provider-utils");
|
|
2141
2130
|
var import_v412 = require("zod/v4");
|
|
2142
|
-
var
|
|
2131
|
+
var applyPatchInputSchema = (0, import_provider_utils19.lazySchema)(
|
|
2132
|
+
() => (0, import_provider_utils19.zodSchema)(
|
|
2133
|
+
import_v412.z.object({
|
|
2134
|
+
callId: import_v412.z.string(),
|
|
2135
|
+
operation: import_v412.z.discriminatedUnion("type", [
|
|
2136
|
+
import_v412.z.object({
|
|
2137
|
+
type: import_v412.z.literal("create_file"),
|
|
2138
|
+
path: import_v412.z.string(),
|
|
2139
|
+
diff: import_v412.z.string()
|
|
2140
|
+
}),
|
|
2141
|
+
import_v412.z.object({
|
|
2142
|
+
type: import_v412.z.literal("delete_file"),
|
|
2143
|
+
path: import_v412.z.string()
|
|
2144
|
+
}),
|
|
2145
|
+
import_v412.z.object({
|
|
2146
|
+
type: import_v412.z.literal("update_file"),
|
|
2147
|
+
path: import_v412.z.string(),
|
|
2148
|
+
diff: import_v412.z.string()
|
|
2149
|
+
})
|
|
2150
|
+
])
|
|
2151
|
+
})
|
|
2152
|
+
)
|
|
2153
|
+
);
|
|
2154
|
+
var applyPatchOutputSchema = (0, import_provider_utils19.lazySchema)(
|
|
2143
2155
|
() => (0, import_provider_utils19.zodSchema)(
|
|
2144
2156
|
import_v412.z.object({
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2157
|
+
status: import_v412.z.enum(["completed", "failed"]),
|
|
2158
|
+
output: import_v412.z.string().optional()
|
|
2159
|
+
})
|
|
2160
|
+
)
|
|
2161
|
+
);
|
|
2162
|
+
var applyPatchArgsSchema = (0, import_provider_utils19.lazySchema)(() => (0, import_provider_utils19.zodSchema)(import_v412.z.object({})));
|
|
2163
|
+
var applyPatchToolFactory = (0, import_provider_utils19.createProviderToolFactoryWithOutputSchema)({
|
|
2164
|
+
id: "openai.apply_patch",
|
|
2165
|
+
inputSchema: applyPatchInputSchema,
|
|
2166
|
+
outputSchema: applyPatchOutputSchema
|
|
2167
|
+
});
|
|
2168
|
+
var applyPatch = () => applyPatchToolFactory({});
|
|
2169
|
+
|
|
2170
|
+
// src/tool/local-shell.ts
|
|
2171
|
+
var import_provider_utils20 = require("@ai-sdk/provider-utils");
|
|
2172
|
+
var import_v413 = require("zod/v4");
|
|
2173
|
+
var localShellInputSchema = (0, import_provider_utils20.lazySchema)(
|
|
2174
|
+
() => (0, import_provider_utils20.zodSchema)(
|
|
2175
|
+
import_v413.z.object({
|
|
2176
|
+
action: import_v413.z.object({
|
|
2177
|
+
type: import_v413.z.literal("exec"),
|
|
2178
|
+
command: import_v413.z.array(import_v413.z.string()),
|
|
2179
|
+
timeoutMs: import_v413.z.number().optional(),
|
|
2180
|
+
user: import_v413.z.string().optional(),
|
|
2181
|
+
workingDirectory: import_v413.z.string().optional(),
|
|
2182
|
+
env: import_v413.z.record(import_v413.z.string(), import_v413.z.string()).optional()
|
|
2152
2183
|
})
|
|
2153
2184
|
})
|
|
2154
2185
|
)
|
|
2155
2186
|
);
|
|
2156
|
-
var localShellOutputSchema = (0,
|
|
2157
|
-
() => (0,
|
|
2187
|
+
var localShellOutputSchema = (0, import_provider_utils20.lazySchema)(
|
|
2188
|
+
() => (0, import_provider_utils20.zodSchema)(import_v413.z.object({ output: import_v413.z.string() }))
|
|
2158
2189
|
);
|
|
2159
|
-
var localShell = (0,
|
|
2190
|
+
var localShell = (0, import_provider_utils20.createProviderToolFactoryWithOutputSchema)({
|
|
2160
2191
|
id: "openai.local_shell",
|
|
2161
2192
|
inputSchema: localShellInputSchema,
|
|
2162
2193
|
outputSchema: localShellOutputSchema
|
|
@@ -2173,7 +2204,8 @@ async function convertToOpenAIResponsesInput({
|
|
|
2173
2204
|
systemMessageMode,
|
|
2174
2205
|
fileIdPrefixes,
|
|
2175
2206
|
store,
|
|
2176
|
-
hasLocalShellTool = false
|
|
2207
|
+
hasLocalShellTool = false,
|
|
2208
|
+
hasApplyPatchTool = false
|
|
2177
2209
|
}) {
|
|
2178
2210
|
var _a, _b, _c, _d, _e;
|
|
2179
2211
|
const input = [];
|
|
@@ -2221,7 +2253,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2221
2253
|
return {
|
|
2222
2254
|
type: "input_image",
|
|
2223
2255
|
...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
2224
|
-
image_url: `data:${mediaType};base64,${(0,
|
|
2256
|
+
image_url: `data:${mediaType};base64,${(0, import_provider_utils21.convertToBase64)(part.data)}`
|
|
2225
2257
|
},
|
|
2226
2258
|
detail: (_b2 = (_a2 = part.providerOptions) == null ? void 0 : _a2.openai) == null ? void 0 : _b2.imageDetail
|
|
2227
2259
|
};
|
|
@@ -2236,7 +2268,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2236
2268
|
type: "input_file",
|
|
2237
2269
|
...typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
2238
2270
|
filename: (_c2 = part.filename) != null ? _c2 : `part-${index}.pdf`,
|
|
2239
|
-
file_data: `data:application/pdf;base64,${(0,
|
|
2271
|
+
file_data: `data:application/pdf;base64,${(0, import_provider_utils21.convertToBase64)(part.data)}`
|
|
2240
2272
|
}
|
|
2241
2273
|
};
|
|
2242
2274
|
} else {
|
|
@@ -2280,7 +2312,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2280
2312
|
part.toolName
|
|
2281
2313
|
);
|
|
2282
2314
|
if (hasLocalShellTool && resolvedToolName === "local_shell") {
|
|
2283
|
-
const parsedInput = await (0,
|
|
2315
|
+
const parsedInput = await (0, import_provider_utils21.validateTypes)({
|
|
2284
2316
|
value: part.input,
|
|
2285
2317
|
schema: localShellInputSchema
|
|
2286
2318
|
});
|
|
@@ -2321,7 +2353,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2321
2353
|
break;
|
|
2322
2354
|
}
|
|
2323
2355
|
case "reasoning": {
|
|
2324
|
-
const providerOptions = await (0,
|
|
2356
|
+
const providerOptions = await (0, import_provider_utils21.parseProviderOptions)({
|
|
2325
2357
|
provider: "openai",
|
|
2326
2358
|
providerOptions: part.providerOptions,
|
|
2327
2359
|
schema: openaiResponsesReasoningProviderOptionsSchema
|
|
@@ -2385,7 +2417,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2385
2417
|
part.toolName
|
|
2386
2418
|
);
|
|
2387
2419
|
if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
|
|
2388
|
-
const parsedOutput = await (0,
|
|
2420
|
+
const parsedOutput = await (0, import_provider_utils21.validateTypes)({
|
|
2389
2421
|
value: output.value,
|
|
2390
2422
|
schema: localShellOutputSchema
|
|
2391
2423
|
});
|
|
@@ -2396,6 +2428,19 @@ async function convertToOpenAIResponsesInput({
|
|
|
2396
2428
|
});
|
|
2397
2429
|
break;
|
|
2398
2430
|
}
|
|
2431
|
+
if (hasApplyPatchTool && part.toolName === "apply_patch" && output.type === "json") {
|
|
2432
|
+
const parsedOutput = await (0, import_provider_utils21.validateTypes)({
|
|
2433
|
+
value: output.value,
|
|
2434
|
+
schema: applyPatchOutputSchema
|
|
2435
|
+
});
|
|
2436
|
+
input.push({
|
|
2437
|
+
type: "apply_patch_call_output",
|
|
2438
|
+
call_id: part.toolCallId,
|
|
2439
|
+
status: parsedOutput.status,
|
|
2440
|
+
output: parsedOutput.output
|
|
2441
|
+
});
|
|
2442
|
+
break;
|
|
2443
|
+
}
|
|
2399
2444
|
let contentValue;
|
|
2400
2445
|
switch (output.type) {
|
|
2401
2446
|
case "text":
|
|
@@ -2437,7 +2482,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2437
2482
|
return void 0;
|
|
2438
2483
|
}
|
|
2439
2484
|
}
|
|
2440
|
-
}).filter(
|
|
2485
|
+
}).filter(import_provider_utils21.isNonNullable);
|
|
2441
2486
|
break;
|
|
2442
2487
|
}
|
|
2443
2488
|
input.push({
|
|
@@ -2456,9 +2501,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
2456
2501
|
}
|
|
2457
2502
|
return { input, warnings };
|
|
2458
2503
|
}
|
|
2459
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
2460
|
-
itemId:
|
|
2461
|
-
reasoningEncryptedContent:
|
|
2504
|
+
var openaiResponsesReasoningProviderOptionsSchema = import_v414.z.object({
|
|
2505
|
+
itemId: import_v414.z.string().nullish(),
|
|
2506
|
+
reasoningEncryptedContent: import_v414.z.string().nullish()
|
|
2462
2507
|
});
|
|
2463
2508
|
|
|
2464
2509
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -2480,349 +2525,393 @@ function mapOpenAIResponseFinishReason({
|
|
|
2480
2525
|
}
|
|
2481
2526
|
|
|
2482
2527
|
// src/responses/openai-responses-api.ts
|
|
2483
|
-
var
|
|
2484
|
-
var
|
|
2485
|
-
var openaiResponsesChunkSchema = (0,
|
|
2486
|
-
() => (0,
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
type:
|
|
2490
|
-
item_id:
|
|
2491
|
-
delta:
|
|
2492
|
-
logprobs:
|
|
2493
|
-
|
|
2494
|
-
token:
|
|
2495
|
-
logprob:
|
|
2496
|
-
top_logprobs:
|
|
2497
|
-
|
|
2498
|
-
token:
|
|
2499
|
-
logprob:
|
|
2528
|
+
var import_provider_utils22 = require("@ai-sdk/provider-utils");
|
|
2529
|
+
var import_v415 = require("zod/v4");
|
|
2530
|
+
var openaiResponsesChunkSchema = (0, import_provider_utils22.lazySchema)(
|
|
2531
|
+
() => (0, import_provider_utils22.zodSchema)(
|
|
2532
|
+
import_v415.z.union([
|
|
2533
|
+
import_v415.z.object({
|
|
2534
|
+
type: import_v415.z.literal("response.output_text.delta"),
|
|
2535
|
+
item_id: import_v415.z.string(),
|
|
2536
|
+
delta: import_v415.z.string(),
|
|
2537
|
+
logprobs: import_v415.z.array(
|
|
2538
|
+
import_v415.z.object({
|
|
2539
|
+
token: import_v415.z.string(),
|
|
2540
|
+
logprob: import_v415.z.number(),
|
|
2541
|
+
top_logprobs: import_v415.z.array(
|
|
2542
|
+
import_v415.z.object({
|
|
2543
|
+
token: import_v415.z.string(),
|
|
2544
|
+
logprob: import_v415.z.number()
|
|
2500
2545
|
})
|
|
2501
2546
|
)
|
|
2502
2547
|
})
|
|
2503
2548
|
).nullish()
|
|
2504
2549
|
}),
|
|
2505
|
-
|
|
2506
|
-
type:
|
|
2507
|
-
response:
|
|
2508
|
-
incomplete_details:
|
|
2509
|
-
usage:
|
|
2510
|
-
input_tokens:
|
|
2511
|
-
input_tokens_details:
|
|
2512
|
-
output_tokens:
|
|
2513
|
-
output_tokens_details:
|
|
2550
|
+
import_v415.z.object({
|
|
2551
|
+
type: import_v415.z.enum(["response.completed", "response.incomplete"]),
|
|
2552
|
+
response: import_v415.z.object({
|
|
2553
|
+
incomplete_details: import_v415.z.object({ reason: import_v415.z.string() }).nullish(),
|
|
2554
|
+
usage: import_v415.z.object({
|
|
2555
|
+
input_tokens: import_v415.z.number(),
|
|
2556
|
+
input_tokens_details: import_v415.z.object({ cached_tokens: import_v415.z.number().nullish() }).nullish(),
|
|
2557
|
+
output_tokens: import_v415.z.number(),
|
|
2558
|
+
output_tokens_details: import_v415.z.object({ reasoning_tokens: import_v415.z.number().nullish() }).nullish()
|
|
2514
2559
|
}),
|
|
2515
|
-
service_tier:
|
|
2560
|
+
service_tier: import_v415.z.string().nullish()
|
|
2516
2561
|
})
|
|
2517
2562
|
}),
|
|
2518
|
-
|
|
2519
|
-
type:
|
|
2520
|
-
response:
|
|
2521
|
-
id:
|
|
2522
|
-
created_at:
|
|
2523
|
-
model:
|
|
2524
|
-
service_tier:
|
|
2563
|
+
import_v415.z.object({
|
|
2564
|
+
type: import_v415.z.literal("response.created"),
|
|
2565
|
+
response: import_v415.z.object({
|
|
2566
|
+
id: import_v415.z.string(),
|
|
2567
|
+
created_at: import_v415.z.number(),
|
|
2568
|
+
model: import_v415.z.string(),
|
|
2569
|
+
service_tier: import_v415.z.string().nullish()
|
|
2525
2570
|
})
|
|
2526
2571
|
}),
|
|
2527
|
-
|
|
2528
|
-
type:
|
|
2529
|
-
output_index:
|
|
2530
|
-
item:
|
|
2531
|
-
|
|
2532
|
-
type:
|
|
2533
|
-
id:
|
|
2572
|
+
import_v415.z.object({
|
|
2573
|
+
type: import_v415.z.literal("response.output_item.added"),
|
|
2574
|
+
output_index: import_v415.z.number(),
|
|
2575
|
+
item: import_v415.z.discriminatedUnion("type", [
|
|
2576
|
+
import_v415.z.object({
|
|
2577
|
+
type: import_v415.z.literal("message"),
|
|
2578
|
+
id: import_v415.z.string()
|
|
2534
2579
|
}),
|
|
2535
|
-
|
|
2536
|
-
type:
|
|
2537
|
-
id:
|
|
2538
|
-
encrypted_content:
|
|
2580
|
+
import_v415.z.object({
|
|
2581
|
+
type: import_v415.z.literal("reasoning"),
|
|
2582
|
+
id: import_v415.z.string(),
|
|
2583
|
+
encrypted_content: import_v415.z.string().nullish()
|
|
2539
2584
|
}),
|
|
2540
|
-
|
|
2541
|
-
type:
|
|
2542
|
-
id:
|
|
2543
|
-
call_id:
|
|
2544
|
-
name:
|
|
2545
|
-
arguments:
|
|
2585
|
+
import_v415.z.object({
|
|
2586
|
+
type: import_v415.z.literal("function_call"),
|
|
2587
|
+
id: import_v415.z.string(),
|
|
2588
|
+
call_id: import_v415.z.string(),
|
|
2589
|
+
name: import_v415.z.string(),
|
|
2590
|
+
arguments: import_v415.z.string()
|
|
2546
2591
|
}),
|
|
2547
|
-
|
|
2548
|
-
type:
|
|
2549
|
-
id:
|
|
2550
|
-
status:
|
|
2592
|
+
import_v415.z.object({
|
|
2593
|
+
type: import_v415.z.literal("web_search_call"),
|
|
2594
|
+
id: import_v415.z.string(),
|
|
2595
|
+
status: import_v415.z.string()
|
|
2551
2596
|
}),
|
|
2552
|
-
|
|
2553
|
-
type:
|
|
2554
|
-
id:
|
|
2555
|
-
status:
|
|
2597
|
+
import_v415.z.object({
|
|
2598
|
+
type: import_v415.z.literal("computer_call"),
|
|
2599
|
+
id: import_v415.z.string(),
|
|
2600
|
+
status: import_v415.z.string()
|
|
2556
2601
|
}),
|
|
2557
|
-
|
|
2558
|
-
type:
|
|
2559
|
-
id:
|
|
2602
|
+
import_v415.z.object({
|
|
2603
|
+
type: import_v415.z.literal("file_search_call"),
|
|
2604
|
+
id: import_v415.z.string()
|
|
2560
2605
|
}),
|
|
2561
|
-
|
|
2562
|
-
type:
|
|
2563
|
-
id:
|
|
2606
|
+
import_v415.z.object({
|
|
2607
|
+
type: import_v415.z.literal("image_generation_call"),
|
|
2608
|
+
id: import_v415.z.string()
|
|
2564
2609
|
}),
|
|
2565
|
-
|
|
2566
|
-
type:
|
|
2567
|
-
id:
|
|
2568
|
-
container_id:
|
|
2569
|
-
code:
|
|
2570
|
-
outputs:
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2610
|
+
import_v415.z.object({
|
|
2611
|
+
type: import_v415.z.literal("code_interpreter_call"),
|
|
2612
|
+
id: import_v415.z.string(),
|
|
2613
|
+
container_id: import_v415.z.string(),
|
|
2614
|
+
code: import_v415.z.string().nullable(),
|
|
2615
|
+
outputs: import_v415.z.array(
|
|
2616
|
+
import_v415.z.discriminatedUnion("type", [
|
|
2617
|
+
import_v415.z.object({ type: import_v415.z.literal("logs"), logs: import_v415.z.string() }),
|
|
2618
|
+
import_v415.z.object({ type: import_v415.z.literal("image"), url: import_v415.z.string() })
|
|
2574
2619
|
])
|
|
2575
2620
|
).nullable(),
|
|
2576
|
-
status:
|
|
2621
|
+
status: import_v415.z.string()
|
|
2577
2622
|
}),
|
|
2578
|
-
|
|
2579
|
-
type:
|
|
2580
|
-
id:
|
|
2581
|
-
status:
|
|
2623
|
+
import_v415.z.object({
|
|
2624
|
+
type: import_v415.z.literal("mcp_call"),
|
|
2625
|
+
id: import_v415.z.string(),
|
|
2626
|
+
status: import_v415.z.string()
|
|
2582
2627
|
}),
|
|
2583
|
-
|
|
2584
|
-
type:
|
|
2585
|
-
id:
|
|
2628
|
+
import_v415.z.object({
|
|
2629
|
+
type: import_v415.z.literal("mcp_list_tools"),
|
|
2630
|
+
id: import_v415.z.string()
|
|
2586
2631
|
}),
|
|
2587
|
-
|
|
2588
|
-
type:
|
|
2589
|
-
id:
|
|
2632
|
+
import_v415.z.object({
|
|
2633
|
+
type: import_v415.z.literal("mcp_approval_request"),
|
|
2634
|
+
id: import_v415.z.string()
|
|
2635
|
+
}),
|
|
2636
|
+
import_v415.z.object({
|
|
2637
|
+
type: import_v415.z.literal("apply_patch_call"),
|
|
2638
|
+
id: import_v415.z.string(),
|
|
2639
|
+
call_id: import_v415.z.string(),
|
|
2640
|
+
status: import_v415.z.enum(["in_progress", "completed"]),
|
|
2641
|
+
operation: import_v415.z.discriminatedUnion("type", [
|
|
2642
|
+
import_v415.z.object({
|
|
2643
|
+
type: import_v415.z.literal("create_file"),
|
|
2644
|
+
path: import_v415.z.string(),
|
|
2645
|
+
diff: import_v415.z.string()
|
|
2646
|
+
}),
|
|
2647
|
+
import_v415.z.object({
|
|
2648
|
+
type: import_v415.z.literal("delete_file"),
|
|
2649
|
+
path: import_v415.z.string()
|
|
2650
|
+
}),
|
|
2651
|
+
import_v415.z.object({
|
|
2652
|
+
type: import_v415.z.literal("update_file"),
|
|
2653
|
+
path: import_v415.z.string(),
|
|
2654
|
+
diff: import_v415.z.string()
|
|
2655
|
+
})
|
|
2656
|
+
])
|
|
2590
2657
|
})
|
|
2591
2658
|
])
|
|
2592
2659
|
}),
|
|
2593
|
-
|
|
2594
|
-
type:
|
|
2595
|
-
output_index:
|
|
2596
|
-
item:
|
|
2597
|
-
|
|
2598
|
-
type:
|
|
2599
|
-
id:
|
|
2660
|
+
import_v415.z.object({
|
|
2661
|
+
type: import_v415.z.literal("response.output_item.done"),
|
|
2662
|
+
output_index: import_v415.z.number(),
|
|
2663
|
+
item: import_v415.z.discriminatedUnion("type", [
|
|
2664
|
+
import_v415.z.object({
|
|
2665
|
+
type: import_v415.z.literal("message"),
|
|
2666
|
+
id: import_v415.z.string()
|
|
2600
2667
|
}),
|
|
2601
|
-
|
|
2602
|
-
type:
|
|
2603
|
-
id:
|
|
2604
|
-
encrypted_content:
|
|
2668
|
+
import_v415.z.object({
|
|
2669
|
+
type: import_v415.z.literal("reasoning"),
|
|
2670
|
+
id: import_v415.z.string(),
|
|
2671
|
+
encrypted_content: import_v415.z.string().nullish()
|
|
2605
2672
|
}),
|
|
2606
|
-
|
|
2607
|
-
type:
|
|
2608
|
-
id:
|
|
2609
|
-
call_id:
|
|
2610
|
-
name:
|
|
2611
|
-
arguments:
|
|
2612
|
-
status:
|
|
2673
|
+
import_v415.z.object({
|
|
2674
|
+
type: import_v415.z.literal("function_call"),
|
|
2675
|
+
id: import_v415.z.string(),
|
|
2676
|
+
call_id: import_v415.z.string(),
|
|
2677
|
+
name: import_v415.z.string(),
|
|
2678
|
+
arguments: import_v415.z.string(),
|
|
2679
|
+
status: import_v415.z.literal("completed")
|
|
2613
2680
|
}),
|
|
2614
|
-
|
|
2615
|
-
type:
|
|
2616
|
-
id:
|
|
2617
|
-
code:
|
|
2618
|
-
container_id:
|
|
2619
|
-
outputs:
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2681
|
+
import_v415.z.object({
|
|
2682
|
+
type: import_v415.z.literal("code_interpreter_call"),
|
|
2683
|
+
id: import_v415.z.string(),
|
|
2684
|
+
code: import_v415.z.string().nullable(),
|
|
2685
|
+
container_id: import_v415.z.string(),
|
|
2686
|
+
outputs: import_v415.z.array(
|
|
2687
|
+
import_v415.z.discriminatedUnion("type", [
|
|
2688
|
+
import_v415.z.object({ type: import_v415.z.literal("logs"), logs: import_v415.z.string() }),
|
|
2689
|
+
import_v415.z.object({ type: import_v415.z.literal("image"), url: import_v415.z.string() })
|
|
2623
2690
|
])
|
|
2624
2691
|
).nullable()
|
|
2625
2692
|
}),
|
|
2626
|
-
|
|
2627
|
-
type:
|
|
2628
|
-
id:
|
|
2629
|
-
result:
|
|
2693
|
+
import_v415.z.object({
|
|
2694
|
+
type: import_v415.z.literal("image_generation_call"),
|
|
2695
|
+
id: import_v415.z.string(),
|
|
2696
|
+
result: import_v415.z.string()
|
|
2630
2697
|
}),
|
|
2631
|
-
|
|
2632
|
-
type:
|
|
2633
|
-
id:
|
|
2634
|
-
status:
|
|
2635
|
-
action:
|
|
2636
|
-
|
|
2637
|
-
type:
|
|
2638
|
-
query:
|
|
2639
|
-
sources:
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2698
|
+
import_v415.z.object({
|
|
2699
|
+
type: import_v415.z.literal("web_search_call"),
|
|
2700
|
+
id: import_v415.z.string(),
|
|
2701
|
+
status: import_v415.z.string(),
|
|
2702
|
+
action: import_v415.z.discriminatedUnion("type", [
|
|
2703
|
+
import_v415.z.object({
|
|
2704
|
+
type: import_v415.z.literal("search"),
|
|
2705
|
+
query: import_v415.z.string().nullish(),
|
|
2706
|
+
sources: import_v415.z.array(
|
|
2707
|
+
import_v415.z.discriminatedUnion("type", [
|
|
2708
|
+
import_v415.z.object({ type: import_v415.z.literal("url"), url: import_v415.z.string() }),
|
|
2709
|
+
import_v415.z.object({ type: import_v415.z.literal("api"), name: import_v415.z.string() })
|
|
2643
2710
|
])
|
|
2644
2711
|
).nullish()
|
|
2645
2712
|
}),
|
|
2646
|
-
|
|
2647
|
-
type:
|
|
2648
|
-
url:
|
|
2713
|
+
import_v415.z.object({
|
|
2714
|
+
type: import_v415.z.literal("open_page"),
|
|
2715
|
+
url: import_v415.z.string()
|
|
2649
2716
|
}),
|
|
2650
|
-
|
|
2651
|
-
type:
|
|
2652
|
-
url:
|
|
2653
|
-
pattern:
|
|
2717
|
+
import_v415.z.object({
|
|
2718
|
+
type: import_v415.z.literal("find"),
|
|
2719
|
+
url: import_v415.z.string(),
|
|
2720
|
+
pattern: import_v415.z.string()
|
|
2654
2721
|
})
|
|
2655
2722
|
])
|
|
2656
2723
|
}),
|
|
2657
|
-
|
|
2658
|
-
type:
|
|
2659
|
-
id:
|
|
2660
|
-
queries:
|
|
2661
|
-
results:
|
|
2662
|
-
|
|
2663
|
-
attributes:
|
|
2664
|
-
|
|
2665
|
-
|
|
2724
|
+
import_v415.z.object({
|
|
2725
|
+
type: import_v415.z.literal("file_search_call"),
|
|
2726
|
+
id: import_v415.z.string(),
|
|
2727
|
+
queries: import_v415.z.array(import_v415.z.string()),
|
|
2728
|
+
results: import_v415.z.array(
|
|
2729
|
+
import_v415.z.object({
|
|
2730
|
+
attributes: import_v415.z.record(
|
|
2731
|
+
import_v415.z.string(),
|
|
2732
|
+
import_v415.z.union([import_v415.z.string(), import_v415.z.number(), import_v415.z.boolean()])
|
|
2666
2733
|
),
|
|
2667
|
-
file_id:
|
|
2668
|
-
filename:
|
|
2669
|
-
score:
|
|
2670
|
-
text:
|
|
2734
|
+
file_id: import_v415.z.string(),
|
|
2735
|
+
filename: import_v415.z.string(),
|
|
2736
|
+
score: import_v415.z.number(),
|
|
2737
|
+
text: import_v415.z.string()
|
|
2671
2738
|
})
|
|
2672
2739
|
).nullish()
|
|
2673
2740
|
}),
|
|
2674
|
-
|
|
2675
|
-
type:
|
|
2676
|
-
id:
|
|
2677
|
-
call_id:
|
|
2678
|
-
action:
|
|
2679
|
-
type:
|
|
2680
|
-
command:
|
|
2681
|
-
timeout_ms:
|
|
2682
|
-
user:
|
|
2683
|
-
working_directory:
|
|
2684
|
-
env:
|
|
2741
|
+
import_v415.z.object({
|
|
2742
|
+
type: import_v415.z.literal("local_shell_call"),
|
|
2743
|
+
id: import_v415.z.string(),
|
|
2744
|
+
call_id: import_v415.z.string(),
|
|
2745
|
+
action: import_v415.z.object({
|
|
2746
|
+
type: import_v415.z.literal("exec"),
|
|
2747
|
+
command: import_v415.z.array(import_v415.z.string()),
|
|
2748
|
+
timeout_ms: import_v415.z.number().optional(),
|
|
2749
|
+
user: import_v415.z.string().optional(),
|
|
2750
|
+
working_directory: import_v415.z.string().optional(),
|
|
2751
|
+
env: import_v415.z.record(import_v415.z.string(), import_v415.z.string()).optional()
|
|
2685
2752
|
})
|
|
2686
2753
|
}),
|
|
2687
|
-
|
|
2688
|
-
type:
|
|
2689
|
-
id:
|
|
2690
|
-
status:
|
|
2754
|
+
import_v415.z.object({
|
|
2755
|
+
type: import_v415.z.literal("computer_call"),
|
|
2756
|
+
id: import_v415.z.string(),
|
|
2757
|
+
status: import_v415.z.literal("completed")
|
|
2691
2758
|
}),
|
|
2692
|
-
|
|
2693
|
-
type:
|
|
2694
|
-
id:
|
|
2695
|
-
status:
|
|
2696
|
-
arguments:
|
|
2697
|
-
name:
|
|
2698
|
-
server_label:
|
|
2699
|
-
output:
|
|
2700
|
-
error:
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
type:
|
|
2704
|
-
code:
|
|
2705
|
-
message:
|
|
2759
|
+
import_v415.z.object({
|
|
2760
|
+
type: import_v415.z.literal("mcp_call"),
|
|
2761
|
+
id: import_v415.z.string(),
|
|
2762
|
+
status: import_v415.z.string(),
|
|
2763
|
+
arguments: import_v415.z.string(),
|
|
2764
|
+
name: import_v415.z.string(),
|
|
2765
|
+
server_label: import_v415.z.string(),
|
|
2766
|
+
output: import_v415.z.string().nullish(),
|
|
2767
|
+
error: import_v415.z.union([
|
|
2768
|
+
import_v415.z.string(),
|
|
2769
|
+
import_v415.z.object({
|
|
2770
|
+
type: import_v415.z.string().optional(),
|
|
2771
|
+
code: import_v415.z.union([import_v415.z.number(), import_v415.z.string()]).optional(),
|
|
2772
|
+
message: import_v415.z.string().optional()
|
|
2706
2773
|
}).loose()
|
|
2707
2774
|
]).nullish()
|
|
2708
2775
|
}),
|
|
2709
|
-
|
|
2710
|
-
type:
|
|
2711
|
-
id:
|
|
2712
|
-
server_label:
|
|
2713
|
-
tools:
|
|
2714
|
-
|
|
2715
|
-
name:
|
|
2716
|
-
description:
|
|
2717
|
-
input_schema:
|
|
2718
|
-
annotations:
|
|
2776
|
+
import_v415.z.object({
|
|
2777
|
+
type: import_v415.z.literal("mcp_list_tools"),
|
|
2778
|
+
id: import_v415.z.string(),
|
|
2779
|
+
server_label: import_v415.z.string(),
|
|
2780
|
+
tools: import_v415.z.array(
|
|
2781
|
+
import_v415.z.object({
|
|
2782
|
+
name: import_v415.z.string(),
|
|
2783
|
+
description: import_v415.z.string().optional(),
|
|
2784
|
+
input_schema: import_v415.z.any(),
|
|
2785
|
+
annotations: import_v415.z.record(import_v415.z.string(), import_v415.z.unknown()).optional()
|
|
2719
2786
|
})
|
|
2720
2787
|
),
|
|
2721
|
-
error:
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
type:
|
|
2725
|
-
code:
|
|
2726
|
-
message:
|
|
2788
|
+
error: import_v415.z.union([
|
|
2789
|
+
import_v415.z.string(),
|
|
2790
|
+
import_v415.z.object({
|
|
2791
|
+
type: import_v415.z.string().optional(),
|
|
2792
|
+
code: import_v415.z.union([import_v415.z.number(), import_v415.z.string()]).optional(),
|
|
2793
|
+
message: import_v415.z.string().optional()
|
|
2727
2794
|
}).loose()
|
|
2728
2795
|
]).optional()
|
|
2729
2796
|
}),
|
|
2730
|
-
|
|
2731
|
-
type:
|
|
2732
|
-
id:
|
|
2733
|
-
server_label:
|
|
2734
|
-
name:
|
|
2735
|
-
arguments:
|
|
2736
|
-
approval_request_id:
|
|
2797
|
+
import_v415.z.object({
|
|
2798
|
+
type: import_v415.z.literal("mcp_approval_request"),
|
|
2799
|
+
id: import_v415.z.string(),
|
|
2800
|
+
server_label: import_v415.z.string(),
|
|
2801
|
+
name: import_v415.z.string(),
|
|
2802
|
+
arguments: import_v415.z.string(),
|
|
2803
|
+
approval_request_id: import_v415.z.string()
|
|
2804
|
+
}),
|
|
2805
|
+
import_v415.z.object({
|
|
2806
|
+
type: import_v415.z.literal("apply_patch_call"),
|
|
2807
|
+
id: import_v415.z.string(),
|
|
2808
|
+
call_id: import_v415.z.string(),
|
|
2809
|
+
status: import_v415.z.enum(["in_progress", "completed"]),
|
|
2810
|
+
operation: import_v415.z.discriminatedUnion("type", [
|
|
2811
|
+
import_v415.z.object({
|
|
2812
|
+
type: import_v415.z.literal("create_file"),
|
|
2813
|
+
path: import_v415.z.string(),
|
|
2814
|
+
diff: import_v415.z.string()
|
|
2815
|
+
}),
|
|
2816
|
+
import_v415.z.object({
|
|
2817
|
+
type: import_v415.z.literal("delete_file"),
|
|
2818
|
+
path: import_v415.z.string()
|
|
2819
|
+
}),
|
|
2820
|
+
import_v415.z.object({
|
|
2821
|
+
type: import_v415.z.literal("update_file"),
|
|
2822
|
+
path: import_v415.z.string(),
|
|
2823
|
+
diff: import_v415.z.string()
|
|
2824
|
+
})
|
|
2825
|
+
])
|
|
2737
2826
|
})
|
|
2738
2827
|
])
|
|
2739
2828
|
}),
|
|
2740
|
-
|
|
2741
|
-
type:
|
|
2742
|
-
item_id:
|
|
2743
|
-
output_index:
|
|
2744
|
-
delta:
|
|
2829
|
+
import_v415.z.object({
|
|
2830
|
+
type: import_v415.z.literal("response.function_call_arguments.delta"),
|
|
2831
|
+
item_id: import_v415.z.string(),
|
|
2832
|
+
output_index: import_v415.z.number(),
|
|
2833
|
+
delta: import_v415.z.string()
|
|
2745
2834
|
}),
|
|
2746
|
-
|
|
2747
|
-
type:
|
|
2748
|
-
item_id:
|
|
2749
|
-
output_index:
|
|
2750
|
-
partial_image_b64:
|
|
2835
|
+
import_v415.z.object({
|
|
2836
|
+
type: import_v415.z.literal("response.image_generation_call.partial_image"),
|
|
2837
|
+
item_id: import_v415.z.string(),
|
|
2838
|
+
output_index: import_v415.z.number(),
|
|
2839
|
+
partial_image_b64: import_v415.z.string()
|
|
2751
2840
|
}),
|
|
2752
|
-
|
|
2753
|
-
type:
|
|
2754
|
-
item_id:
|
|
2755
|
-
output_index:
|
|
2756
|
-
delta:
|
|
2841
|
+
import_v415.z.object({
|
|
2842
|
+
type: import_v415.z.literal("response.code_interpreter_call_code.delta"),
|
|
2843
|
+
item_id: import_v415.z.string(),
|
|
2844
|
+
output_index: import_v415.z.number(),
|
|
2845
|
+
delta: import_v415.z.string()
|
|
2757
2846
|
}),
|
|
2758
|
-
|
|
2759
|
-
type:
|
|
2760
|
-
item_id:
|
|
2761
|
-
output_index:
|
|
2762
|
-
code:
|
|
2847
|
+
import_v415.z.object({
|
|
2848
|
+
type: import_v415.z.literal("response.code_interpreter_call_code.done"),
|
|
2849
|
+
item_id: import_v415.z.string(),
|
|
2850
|
+
output_index: import_v415.z.number(),
|
|
2851
|
+
code: import_v415.z.string()
|
|
2763
2852
|
}),
|
|
2764
|
-
|
|
2765
|
-
type:
|
|
2766
|
-
annotation:
|
|
2767
|
-
|
|
2768
|
-
type:
|
|
2769
|
-
start_index:
|
|
2770
|
-
end_index:
|
|
2771
|
-
url:
|
|
2772
|
-
title:
|
|
2853
|
+
import_v415.z.object({
|
|
2854
|
+
type: import_v415.z.literal("response.output_text.annotation.added"),
|
|
2855
|
+
annotation: import_v415.z.discriminatedUnion("type", [
|
|
2856
|
+
import_v415.z.object({
|
|
2857
|
+
type: import_v415.z.literal("url_citation"),
|
|
2858
|
+
start_index: import_v415.z.number(),
|
|
2859
|
+
end_index: import_v415.z.number(),
|
|
2860
|
+
url: import_v415.z.string(),
|
|
2861
|
+
title: import_v415.z.string()
|
|
2773
2862
|
}),
|
|
2774
|
-
|
|
2775
|
-
type:
|
|
2776
|
-
file_id:
|
|
2777
|
-
filename:
|
|
2778
|
-
index:
|
|
2779
|
-
start_index:
|
|
2780
|
-
end_index:
|
|
2781
|
-
quote:
|
|
2863
|
+
import_v415.z.object({
|
|
2864
|
+
type: import_v415.z.literal("file_citation"),
|
|
2865
|
+
file_id: import_v415.z.string(),
|
|
2866
|
+
filename: import_v415.z.string().nullish(),
|
|
2867
|
+
index: import_v415.z.number().nullish(),
|
|
2868
|
+
start_index: import_v415.z.number().nullish(),
|
|
2869
|
+
end_index: import_v415.z.number().nullish(),
|
|
2870
|
+
quote: import_v415.z.string().nullish()
|
|
2782
2871
|
}),
|
|
2783
|
-
|
|
2784
|
-
type:
|
|
2785
|
-
container_id:
|
|
2786
|
-
file_id:
|
|
2787
|
-
filename:
|
|
2788
|
-
start_index:
|
|
2789
|
-
end_index:
|
|
2790
|
-
index:
|
|
2872
|
+
import_v415.z.object({
|
|
2873
|
+
type: import_v415.z.literal("container_file_citation"),
|
|
2874
|
+
container_id: import_v415.z.string(),
|
|
2875
|
+
file_id: import_v415.z.string(),
|
|
2876
|
+
filename: import_v415.z.string().nullish(),
|
|
2877
|
+
start_index: import_v415.z.number().nullish(),
|
|
2878
|
+
end_index: import_v415.z.number().nullish(),
|
|
2879
|
+
index: import_v415.z.number().nullish()
|
|
2791
2880
|
}),
|
|
2792
|
-
|
|
2793
|
-
type:
|
|
2794
|
-
file_id:
|
|
2795
|
-
index:
|
|
2881
|
+
import_v415.z.object({
|
|
2882
|
+
type: import_v415.z.literal("file_path"),
|
|
2883
|
+
file_id: import_v415.z.string(),
|
|
2884
|
+
index: import_v415.z.number().nullish()
|
|
2796
2885
|
})
|
|
2797
2886
|
])
|
|
2798
2887
|
}),
|
|
2799
|
-
|
|
2800
|
-
type:
|
|
2801
|
-
item_id:
|
|
2802
|
-
summary_index:
|
|
2888
|
+
import_v415.z.object({
|
|
2889
|
+
type: import_v415.z.literal("response.reasoning_summary_part.added"),
|
|
2890
|
+
item_id: import_v415.z.string(),
|
|
2891
|
+
summary_index: import_v415.z.number()
|
|
2803
2892
|
}),
|
|
2804
|
-
|
|
2805
|
-
type:
|
|
2806
|
-
item_id:
|
|
2807
|
-
summary_index:
|
|
2808
|
-
delta:
|
|
2893
|
+
import_v415.z.object({
|
|
2894
|
+
type: import_v415.z.literal("response.reasoning_summary_text.delta"),
|
|
2895
|
+
item_id: import_v415.z.string(),
|
|
2896
|
+
summary_index: import_v415.z.number(),
|
|
2897
|
+
delta: import_v415.z.string()
|
|
2809
2898
|
}),
|
|
2810
|
-
|
|
2811
|
-
type:
|
|
2812
|
-
item_id:
|
|
2813
|
-
summary_index:
|
|
2899
|
+
import_v415.z.object({
|
|
2900
|
+
type: import_v415.z.literal("response.reasoning_summary_part.done"),
|
|
2901
|
+
item_id: import_v415.z.string(),
|
|
2902
|
+
summary_index: import_v415.z.number()
|
|
2814
2903
|
}),
|
|
2815
|
-
|
|
2816
|
-
type:
|
|
2817
|
-
sequence_number:
|
|
2818
|
-
error:
|
|
2819
|
-
type:
|
|
2820
|
-
code:
|
|
2821
|
-
message:
|
|
2822
|
-
param:
|
|
2904
|
+
import_v415.z.object({
|
|
2905
|
+
type: import_v415.z.literal("error"),
|
|
2906
|
+
sequence_number: import_v415.z.number(),
|
|
2907
|
+
error: import_v415.z.object({
|
|
2908
|
+
type: import_v415.z.string(),
|
|
2909
|
+
code: import_v415.z.string(),
|
|
2910
|
+
message: import_v415.z.string(),
|
|
2911
|
+
param: import_v415.z.string().nullish()
|
|
2823
2912
|
})
|
|
2824
2913
|
}),
|
|
2825
|
-
|
|
2914
|
+
import_v415.z.object({ type: import_v415.z.string() }).loose().transform((value) => ({
|
|
2826
2915
|
type: "unknown_chunk",
|
|
2827
2916
|
message: value.type
|
|
2828
2917
|
}))
|
|
@@ -2830,236 +2919,258 @@ var openaiResponsesChunkSchema = (0, import_provider_utils21.lazySchema)(
|
|
|
2830
2919
|
])
|
|
2831
2920
|
)
|
|
2832
2921
|
);
|
|
2833
|
-
var openaiResponsesResponseSchema = (0,
|
|
2834
|
-
() => (0,
|
|
2835
|
-
|
|
2836
|
-
id:
|
|
2837
|
-
created_at:
|
|
2838
|
-
error:
|
|
2839
|
-
message:
|
|
2840
|
-
type:
|
|
2841
|
-
param:
|
|
2842
|
-
code:
|
|
2922
|
+
var openaiResponsesResponseSchema = (0, import_provider_utils22.lazySchema)(
|
|
2923
|
+
() => (0, import_provider_utils22.zodSchema)(
|
|
2924
|
+
import_v415.z.object({
|
|
2925
|
+
id: import_v415.z.string().optional(),
|
|
2926
|
+
created_at: import_v415.z.number().optional(),
|
|
2927
|
+
error: import_v415.z.object({
|
|
2928
|
+
message: import_v415.z.string(),
|
|
2929
|
+
type: import_v415.z.string(),
|
|
2930
|
+
param: import_v415.z.string().nullish(),
|
|
2931
|
+
code: import_v415.z.string()
|
|
2843
2932
|
}).nullish(),
|
|
2844
|
-
model:
|
|
2845
|
-
output:
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
type:
|
|
2849
|
-
role:
|
|
2850
|
-
id:
|
|
2851
|
-
content:
|
|
2852
|
-
|
|
2853
|
-
type:
|
|
2854
|
-
text:
|
|
2855
|
-
logprobs:
|
|
2856
|
-
|
|
2857
|
-
token:
|
|
2858
|
-
logprob:
|
|
2859
|
-
top_logprobs:
|
|
2860
|
-
|
|
2861
|
-
token:
|
|
2862
|
-
logprob:
|
|
2933
|
+
model: import_v415.z.string().optional(),
|
|
2934
|
+
output: import_v415.z.array(
|
|
2935
|
+
import_v415.z.discriminatedUnion("type", [
|
|
2936
|
+
import_v415.z.object({
|
|
2937
|
+
type: import_v415.z.literal("message"),
|
|
2938
|
+
role: import_v415.z.literal("assistant"),
|
|
2939
|
+
id: import_v415.z.string(),
|
|
2940
|
+
content: import_v415.z.array(
|
|
2941
|
+
import_v415.z.object({
|
|
2942
|
+
type: import_v415.z.literal("output_text"),
|
|
2943
|
+
text: import_v415.z.string(),
|
|
2944
|
+
logprobs: import_v415.z.array(
|
|
2945
|
+
import_v415.z.object({
|
|
2946
|
+
token: import_v415.z.string(),
|
|
2947
|
+
logprob: import_v415.z.number(),
|
|
2948
|
+
top_logprobs: import_v415.z.array(
|
|
2949
|
+
import_v415.z.object({
|
|
2950
|
+
token: import_v415.z.string(),
|
|
2951
|
+
logprob: import_v415.z.number()
|
|
2863
2952
|
})
|
|
2864
2953
|
)
|
|
2865
2954
|
})
|
|
2866
2955
|
).nullish(),
|
|
2867
|
-
annotations:
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
type:
|
|
2871
|
-
start_index:
|
|
2872
|
-
end_index:
|
|
2873
|
-
url:
|
|
2874
|
-
title:
|
|
2956
|
+
annotations: import_v415.z.array(
|
|
2957
|
+
import_v415.z.discriminatedUnion("type", [
|
|
2958
|
+
import_v415.z.object({
|
|
2959
|
+
type: import_v415.z.literal("url_citation"),
|
|
2960
|
+
start_index: import_v415.z.number(),
|
|
2961
|
+
end_index: import_v415.z.number(),
|
|
2962
|
+
url: import_v415.z.string(),
|
|
2963
|
+
title: import_v415.z.string()
|
|
2875
2964
|
}),
|
|
2876
|
-
|
|
2877
|
-
type:
|
|
2878
|
-
file_id:
|
|
2879
|
-
filename:
|
|
2880
|
-
index:
|
|
2881
|
-
start_index:
|
|
2882
|
-
end_index:
|
|
2883
|
-
quote:
|
|
2965
|
+
import_v415.z.object({
|
|
2966
|
+
type: import_v415.z.literal("file_citation"),
|
|
2967
|
+
file_id: import_v415.z.string(),
|
|
2968
|
+
filename: import_v415.z.string().nullish(),
|
|
2969
|
+
index: import_v415.z.number().nullish(),
|
|
2970
|
+
start_index: import_v415.z.number().nullish(),
|
|
2971
|
+
end_index: import_v415.z.number().nullish(),
|
|
2972
|
+
quote: import_v415.z.string().nullish()
|
|
2884
2973
|
}),
|
|
2885
|
-
|
|
2886
|
-
type:
|
|
2887
|
-
container_id:
|
|
2888
|
-
file_id:
|
|
2889
|
-
filename:
|
|
2890
|
-
start_index:
|
|
2891
|
-
end_index:
|
|
2892
|
-
index:
|
|
2974
|
+
import_v415.z.object({
|
|
2975
|
+
type: import_v415.z.literal("container_file_citation"),
|
|
2976
|
+
container_id: import_v415.z.string(),
|
|
2977
|
+
file_id: import_v415.z.string(),
|
|
2978
|
+
filename: import_v415.z.string().nullish(),
|
|
2979
|
+
start_index: import_v415.z.number().nullish(),
|
|
2980
|
+
end_index: import_v415.z.number().nullish(),
|
|
2981
|
+
index: import_v415.z.number().nullish()
|
|
2893
2982
|
}),
|
|
2894
|
-
|
|
2895
|
-
type:
|
|
2896
|
-
file_id:
|
|
2897
|
-
index:
|
|
2983
|
+
import_v415.z.object({
|
|
2984
|
+
type: import_v415.z.literal("file_path"),
|
|
2985
|
+
file_id: import_v415.z.string(),
|
|
2986
|
+
index: import_v415.z.number().nullish()
|
|
2898
2987
|
})
|
|
2899
2988
|
])
|
|
2900
2989
|
)
|
|
2901
2990
|
})
|
|
2902
2991
|
)
|
|
2903
2992
|
}),
|
|
2904
|
-
|
|
2905
|
-
type:
|
|
2906
|
-
id:
|
|
2907
|
-
status:
|
|
2908
|
-
action:
|
|
2909
|
-
|
|
2910
|
-
type:
|
|
2911
|
-
query:
|
|
2912
|
-
sources:
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2993
|
+
import_v415.z.object({
|
|
2994
|
+
type: import_v415.z.literal("web_search_call"),
|
|
2995
|
+
id: import_v415.z.string(),
|
|
2996
|
+
status: import_v415.z.string(),
|
|
2997
|
+
action: import_v415.z.discriminatedUnion("type", [
|
|
2998
|
+
import_v415.z.object({
|
|
2999
|
+
type: import_v415.z.literal("search"),
|
|
3000
|
+
query: import_v415.z.string().nullish(),
|
|
3001
|
+
sources: import_v415.z.array(
|
|
3002
|
+
import_v415.z.discriminatedUnion("type", [
|
|
3003
|
+
import_v415.z.object({ type: import_v415.z.literal("url"), url: import_v415.z.string() }),
|
|
3004
|
+
import_v415.z.object({ type: import_v415.z.literal("api"), name: import_v415.z.string() })
|
|
2916
3005
|
])
|
|
2917
3006
|
).nullish()
|
|
2918
3007
|
}),
|
|
2919
|
-
|
|
2920
|
-
type:
|
|
2921
|
-
url:
|
|
3008
|
+
import_v415.z.object({
|
|
3009
|
+
type: import_v415.z.literal("open_page"),
|
|
3010
|
+
url: import_v415.z.string()
|
|
2922
3011
|
}),
|
|
2923
|
-
|
|
2924
|
-
type:
|
|
2925
|
-
url:
|
|
2926
|
-
pattern:
|
|
3012
|
+
import_v415.z.object({
|
|
3013
|
+
type: import_v415.z.literal("find"),
|
|
3014
|
+
url: import_v415.z.string(),
|
|
3015
|
+
pattern: import_v415.z.string()
|
|
2927
3016
|
})
|
|
2928
3017
|
])
|
|
2929
3018
|
}),
|
|
2930
|
-
|
|
2931
|
-
type:
|
|
2932
|
-
id:
|
|
2933
|
-
queries:
|
|
2934
|
-
results:
|
|
2935
|
-
|
|
2936
|
-
attributes:
|
|
2937
|
-
|
|
2938
|
-
|
|
3019
|
+
import_v415.z.object({
|
|
3020
|
+
type: import_v415.z.literal("file_search_call"),
|
|
3021
|
+
id: import_v415.z.string(),
|
|
3022
|
+
queries: import_v415.z.array(import_v415.z.string()),
|
|
3023
|
+
results: import_v415.z.array(
|
|
3024
|
+
import_v415.z.object({
|
|
3025
|
+
attributes: import_v415.z.record(
|
|
3026
|
+
import_v415.z.string(),
|
|
3027
|
+
import_v415.z.union([import_v415.z.string(), import_v415.z.number(), import_v415.z.boolean()])
|
|
2939
3028
|
),
|
|
2940
|
-
file_id:
|
|
2941
|
-
filename:
|
|
2942
|
-
score:
|
|
2943
|
-
text:
|
|
3029
|
+
file_id: import_v415.z.string(),
|
|
3030
|
+
filename: import_v415.z.string(),
|
|
3031
|
+
score: import_v415.z.number(),
|
|
3032
|
+
text: import_v415.z.string()
|
|
2944
3033
|
})
|
|
2945
3034
|
).nullish()
|
|
2946
3035
|
}),
|
|
2947
|
-
|
|
2948
|
-
type:
|
|
2949
|
-
id:
|
|
2950
|
-
code:
|
|
2951
|
-
container_id:
|
|
2952
|
-
outputs:
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
3036
|
+
import_v415.z.object({
|
|
3037
|
+
type: import_v415.z.literal("code_interpreter_call"),
|
|
3038
|
+
id: import_v415.z.string(),
|
|
3039
|
+
code: import_v415.z.string().nullable(),
|
|
3040
|
+
container_id: import_v415.z.string(),
|
|
3041
|
+
outputs: import_v415.z.array(
|
|
3042
|
+
import_v415.z.discriminatedUnion("type", [
|
|
3043
|
+
import_v415.z.object({ type: import_v415.z.literal("logs"), logs: import_v415.z.string() }),
|
|
3044
|
+
import_v415.z.object({ type: import_v415.z.literal("image"), url: import_v415.z.string() })
|
|
2956
3045
|
])
|
|
2957
3046
|
).nullable()
|
|
2958
3047
|
}),
|
|
2959
|
-
|
|
2960
|
-
type:
|
|
2961
|
-
id:
|
|
2962
|
-
result:
|
|
3048
|
+
import_v415.z.object({
|
|
3049
|
+
type: import_v415.z.literal("image_generation_call"),
|
|
3050
|
+
id: import_v415.z.string(),
|
|
3051
|
+
result: import_v415.z.string()
|
|
2963
3052
|
}),
|
|
2964
|
-
|
|
2965
|
-
type:
|
|
2966
|
-
id:
|
|
2967
|
-
call_id:
|
|
2968
|
-
action:
|
|
2969
|
-
type:
|
|
2970
|
-
command:
|
|
2971
|
-
timeout_ms:
|
|
2972
|
-
user:
|
|
2973
|
-
working_directory:
|
|
2974
|
-
env:
|
|
3053
|
+
import_v415.z.object({
|
|
3054
|
+
type: import_v415.z.literal("local_shell_call"),
|
|
3055
|
+
id: import_v415.z.string(),
|
|
3056
|
+
call_id: import_v415.z.string(),
|
|
3057
|
+
action: import_v415.z.object({
|
|
3058
|
+
type: import_v415.z.literal("exec"),
|
|
3059
|
+
command: import_v415.z.array(import_v415.z.string()),
|
|
3060
|
+
timeout_ms: import_v415.z.number().optional(),
|
|
3061
|
+
user: import_v415.z.string().optional(),
|
|
3062
|
+
working_directory: import_v415.z.string().optional(),
|
|
3063
|
+
env: import_v415.z.record(import_v415.z.string(), import_v415.z.string()).optional()
|
|
2975
3064
|
})
|
|
2976
3065
|
}),
|
|
2977
|
-
|
|
2978
|
-
type:
|
|
2979
|
-
call_id:
|
|
2980
|
-
name:
|
|
2981
|
-
arguments:
|
|
2982
|
-
id:
|
|
3066
|
+
import_v415.z.object({
|
|
3067
|
+
type: import_v415.z.literal("function_call"),
|
|
3068
|
+
call_id: import_v415.z.string(),
|
|
3069
|
+
name: import_v415.z.string(),
|
|
3070
|
+
arguments: import_v415.z.string(),
|
|
3071
|
+
id: import_v415.z.string()
|
|
2983
3072
|
}),
|
|
2984
|
-
|
|
2985
|
-
type:
|
|
2986
|
-
id:
|
|
2987
|
-
status:
|
|
3073
|
+
import_v415.z.object({
|
|
3074
|
+
type: import_v415.z.literal("computer_call"),
|
|
3075
|
+
id: import_v415.z.string(),
|
|
3076
|
+
status: import_v415.z.string().optional()
|
|
2988
3077
|
}),
|
|
2989
|
-
|
|
2990
|
-
type:
|
|
2991
|
-
id:
|
|
2992
|
-
encrypted_content:
|
|
2993
|
-
summary:
|
|
2994
|
-
|
|
2995
|
-
type:
|
|
2996
|
-
text:
|
|
3078
|
+
import_v415.z.object({
|
|
3079
|
+
type: import_v415.z.literal("reasoning"),
|
|
3080
|
+
id: import_v415.z.string(),
|
|
3081
|
+
encrypted_content: import_v415.z.string().nullish(),
|
|
3082
|
+
summary: import_v415.z.array(
|
|
3083
|
+
import_v415.z.object({
|
|
3084
|
+
type: import_v415.z.literal("summary_text"),
|
|
3085
|
+
text: import_v415.z.string()
|
|
2997
3086
|
})
|
|
2998
3087
|
)
|
|
2999
3088
|
}),
|
|
3000
|
-
|
|
3001
|
-
type:
|
|
3002
|
-
id:
|
|
3003
|
-
status:
|
|
3004
|
-
arguments:
|
|
3005
|
-
name:
|
|
3006
|
-
server_label:
|
|
3007
|
-
output:
|
|
3008
|
-
error:
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
type:
|
|
3012
|
-
code:
|
|
3013
|
-
message:
|
|
3089
|
+
import_v415.z.object({
|
|
3090
|
+
type: import_v415.z.literal("mcp_call"),
|
|
3091
|
+
id: import_v415.z.string(),
|
|
3092
|
+
status: import_v415.z.string(),
|
|
3093
|
+
arguments: import_v415.z.string(),
|
|
3094
|
+
name: import_v415.z.string(),
|
|
3095
|
+
server_label: import_v415.z.string(),
|
|
3096
|
+
output: import_v415.z.string().nullish(),
|
|
3097
|
+
error: import_v415.z.union([
|
|
3098
|
+
import_v415.z.string(),
|
|
3099
|
+
import_v415.z.object({
|
|
3100
|
+
type: import_v415.z.string().optional(),
|
|
3101
|
+
code: import_v415.z.union([import_v415.z.number(), import_v415.z.string()]).optional(),
|
|
3102
|
+
message: import_v415.z.string().optional()
|
|
3014
3103
|
}).loose()
|
|
3015
3104
|
]).nullish()
|
|
3016
3105
|
}),
|
|
3017
|
-
|
|
3018
|
-
type:
|
|
3019
|
-
id:
|
|
3020
|
-
server_label:
|
|
3021
|
-
tools:
|
|
3022
|
-
|
|
3023
|
-
name:
|
|
3024
|
-
description:
|
|
3025
|
-
input_schema:
|
|
3026
|
-
annotations:
|
|
3106
|
+
import_v415.z.object({
|
|
3107
|
+
type: import_v415.z.literal("mcp_list_tools"),
|
|
3108
|
+
id: import_v415.z.string(),
|
|
3109
|
+
server_label: import_v415.z.string(),
|
|
3110
|
+
tools: import_v415.z.array(
|
|
3111
|
+
import_v415.z.object({
|
|
3112
|
+
name: import_v415.z.string(),
|
|
3113
|
+
description: import_v415.z.string().optional(),
|
|
3114
|
+
input_schema: import_v415.z.any(),
|
|
3115
|
+
annotations: import_v415.z.record(import_v415.z.string(), import_v415.z.unknown()).optional()
|
|
3027
3116
|
})
|
|
3028
3117
|
),
|
|
3029
|
-
error:
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
type:
|
|
3033
|
-
code:
|
|
3034
|
-
message:
|
|
3118
|
+
error: import_v415.z.union([
|
|
3119
|
+
import_v415.z.string(),
|
|
3120
|
+
import_v415.z.object({
|
|
3121
|
+
type: import_v415.z.string().optional(),
|
|
3122
|
+
code: import_v415.z.union([import_v415.z.number(), import_v415.z.string()]).optional(),
|
|
3123
|
+
message: import_v415.z.string().optional()
|
|
3035
3124
|
}).loose()
|
|
3036
3125
|
]).optional()
|
|
3037
3126
|
}),
|
|
3038
|
-
|
|
3039
|
-
type:
|
|
3040
|
-
id:
|
|
3041
|
-
server_label:
|
|
3042
|
-
name:
|
|
3043
|
-
arguments:
|
|
3044
|
-
approval_request_id:
|
|
3127
|
+
import_v415.z.object({
|
|
3128
|
+
type: import_v415.z.literal("mcp_approval_request"),
|
|
3129
|
+
id: import_v415.z.string(),
|
|
3130
|
+
server_label: import_v415.z.string(),
|
|
3131
|
+
name: import_v415.z.string(),
|
|
3132
|
+
arguments: import_v415.z.string(),
|
|
3133
|
+
approval_request_id: import_v415.z.string()
|
|
3134
|
+
}),
|
|
3135
|
+
import_v415.z.object({
|
|
3136
|
+
type: import_v415.z.literal("apply_patch_call"),
|
|
3137
|
+
id: import_v415.z.string(),
|
|
3138
|
+
call_id: import_v415.z.string(),
|
|
3139
|
+
status: import_v415.z.enum(["in_progress", "completed"]),
|
|
3140
|
+
operation: import_v415.z.discriminatedUnion("type", [
|
|
3141
|
+
import_v415.z.object({
|
|
3142
|
+
type: import_v415.z.literal("create_file"),
|
|
3143
|
+
path: import_v415.z.string(),
|
|
3144
|
+
diff: import_v415.z.string()
|
|
3145
|
+
}),
|
|
3146
|
+
import_v415.z.object({
|
|
3147
|
+
type: import_v415.z.literal("delete_file"),
|
|
3148
|
+
path: import_v415.z.string()
|
|
3149
|
+
}),
|
|
3150
|
+
import_v415.z.object({
|
|
3151
|
+
type: import_v415.z.literal("update_file"),
|
|
3152
|
+
path: import_v415.z.string(),
|
|
3153
|
+
diff: import_v415.z.string()
|
|
3154
|
+
})
|
|
3155
|
+
])
|
|
3045
3156
|
})
|
|
3046
3157
|
])
|
|
3047
3158
|
).optional(),
|
|
3048
|
-
service_tier:
|
|
3049
|
-
incomplete_details:
|
|
3050
|
-
usage:
|
|
3051
|
-
input_tokens:
|
|
3052
|
-
input_tokens_details:
|
|
3053
|
-
output_tokens:
|
|
3054
|
-
output_tokens_details:
|
|
3159
|
+
service_tier: import_v415.z.string().nullish(),
|
|
3160
|
+
incomplete_details: import_v415.z.object({ reason: import_v415.z.string() }).nullish(),
|
|
3161
|
+
usage: import_v415.z.object({
|
|
3162
|
+
input_tokens: import_v415.z.number(),
|
|
3163
|
+
input_tokens_details: import_v415.z.object({ cached_tokens: import_v415.z.number().nullish() }).nullish(),
|
|
3164
|
+
output_tokens: import_v415.z.number(),
|
|
3165
|
+
output_tokens_details: import_v415.z.object({ reasoning_tokens: import_v415.z.number().nullish() }).nullish()
|
|
3055
3166
|
}).optional()
|
|
3056
3167
|
})
|
|
3057
3168
|
)
|
|
3058
3169
|
);
|
|
3059
3170
|
|
|
3060
3171
|
// src/responses/openai-responses-options.ts
|
|
3061
|
-
var
|
|
3062
|
-
var
|
|
3172
|
+
var import_provider_utils23 = require("@ai-sdk/provider-utils");
|
|
3173
|
+
var import_v416 = require("zod/v4");
|
|
3063
3174
|
var TOP_LOGPROBS_MAX = 20;
|
|
3064
3175
|
var openaiResponsesReasoningModelIds = [
|
|
3065
3176
|
"o1",
|
|
@@ -3126,19 +3237,19 @@ var openaiResponsesModelIds = [
|
|
|
3126
3237
|
"gpt-5-chat-latest",
|
|
3127
3238
|
...openaiResponsesReasoningModelIds
|
|
3128
3239
|
];
|
|
3129
|
-
var openaiResponsesProviderOptionsSchema = (0,
|
|
3130
|
-
() => (0,
|
|
3131
|
-
|
|
3132
|
-
conversation:
|
|
3133
|
-
include:
|
|
3134
|
-
|
|
3240
|
+
var openaiResponsesProviderOptionsSchema = (0, import_provider_utils23.lazySchema)(
|
|
3241
|
+
() => (0, import_provider_utils23.zodSchema)(
|
|
3242
|
+
import_v416.z.object({
|
|
3243
|
+
conversation: import_v416.z.string().nullish(),
|
|
3244
|
+
include: import_v416.z.array(
|
|
3245
|
+
import_v416.z.enum([
|
|
3135
3246
|
"reasoning.encrypted_content",
|
|
3136
3247
|
// handled internally by default, only needed for unknown reasoning models
|
|
3137
3248
|
"file_search_call.results",
|
|
3138
3249
|
"message.output_text.logprobs"
|
|
3139
3250
|
])
|
|
3140
3251
|
).nullish(),
|
|
3141
|
-
instructions:
|
|
3252
|
+
instructions: import_v416.z.string().nullish(),
|
|
3142
3253
|
/**
|
|
3143
3254
|
* Return the log probabilities of the tokens.
|
|
3144
3255
|
*
|
|
@@ -3151,17 +3262,17 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils22.lazySchem
|
|
|
3151
3262
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
3152
3263
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
3153
3264
|
*/
|
|
3154
|
-
logprobs:
|
|
3265
|
+
logprobs: import_v416.z.union([import_v416.z.boolean(), import_v416.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
3155
3266
|
/**
|
|
3156
3267
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
3157
3268
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
3158
3269
|
* Any further attempts to call a tool by the model will be ignored.
|
|
3159
3270
|
*/
|
|
3160
|
-
maxToolCalls:
|
|
3161
|
-
metadata:
|
|
3162
|
-
parallelToolCalls:
|
|
3163
|
-
previousResponseId:
|
|
3164
|
-
promptCacheKey:
|
|
3271
|
+
maxToolCalls: import_v416.z.number().nullish(),
|
|
3272
|
+
metadata: import_v416.z.any().nullish(),
|
|
3273
|
+
parallelToolCalls: import_v416.z.boolean().nullish(),
|
|
3274
|
+
previousResponseId: import_v416.z.string().nullish(),
|
|
3275
|
+
promptCacheKey: import_v416.z.string().nullish(),
|
|
3165
3276
|
/**
|
|
3166
3277
|
* The retention policy for the prompt cache.
|
|
3167
3278
|
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
@@ -3170,60 +3281,60 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils22.lazySchem
|
|
|
3170
3281
|
*
|
|
3171
3282
|
* @default 'in_memory'
|
|
3172
3283
|
*/
|
|
3173
|
-
promptCacheRetention:
|
|
3174
|
-
reasoningEffort:
|
|
3175
|
-
reasoningSummary:
|
|
3176
|
-
safetyIdentifier:
|
|
3177
|
-
serviceTier:
|
|
3178
|
-
store:
|
|
3179
|
-
strictJsonSchema:
|
|
3180
|
-
textVerbosity:
|
|
3181
|
-
truncation:
|
|
3182
|
-
user:
|
|
3284
|
+
promptCacheRetention: import_v416.z.enum(["in_memory", "24h"]).nullish(),
|
|
3285
|
+
reasoningEffort: import_v416.z.string().nullish(),
|
|
3286
|
+
reasoningSummary: import_v416.z.string().nullish(),
|
|
3287
|
+
safetyIdentifier: import_v416.z.string().nullish(),
|
|
3288
|
+
serviceTier: import_v416.z.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
3289
|
+
store: import_v416.z.boolean().nullish(),
|
|
3290
|
+
strictJsonSchema: import_v416.z.boolean().nullish(),
|
|
3291
|
+
textVerbosity: import_v416.z.enum(["low", "medium", "high"]).nullish(),
|
|
3292
|
+
truncation: import_v416.z.enum(["auto", "disabled"]).nullish(),
|
|
3293
|
+
user: import_v416.z.string().nullish()
|
|
3183
3294
|
})
|
|
3184
3295
|
)
|
|
3185
3296
|
);
|
|
3186
3297
|
|
|
3187
3298
|
// src/responses/openai-responses-prepare-tools.ts
|
|
3188
3299
|
var import_provider7 = require("@ai-sdk/provider");
|
|
3189
|
-
var
|
|
3300
|
+
var import_provider_utils30 = require("@ai-sdk/provider-utils");
|
|
3190
3301
|
|
|
3191
3302
|
// src/tool/code-interpreter.ts
|
|
3192
|
-
var
|
|
3193
|
-
var
|
|
3194
|
-
var codeInterpreterInputSchema = (0,
|
|
3195
|
-
() => (0,
|
|
3196
|
-
|
|
3197
|
-
code:
|
|
3198
|
-
containerId:
|
|
3303
|
+
var import_provider_utils24 = require("@ai-sdk/provider-utils");
|
|
3304
|
+
var import_v417 = require("zod/v4");
|
|
3305
|
+
var codeInterpreterInputSchema = (0, import_provider_utils24.lazySchema)(
|
|
3306
|
+
() => (0, import_provider_utils24.zodSchema)(
|
|
3307
|
+
import_v417.z.object({
|
|
3308
|
+
code: import_v417.z.string().nullish(),
|
|
3309
|
+
containerId: import_v417.z.string()
|
|
3199
3310
|
})
|
|
3200
3311
|
)
|
|
3201
3312
|
);
|
|
3202
|
-
var codeInterpreterOutputSchema = (0,
|
|
3203
|
-
() => (0,
|
|
3204
|
-
|
|
3205
|
-
outputs:
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3313
|
+
var codeInterpreterOutputSchema = (0, import_provider_utils24.lazySchema)(
|
|
3314
|
+
() => (0, import_provider_utils24.zodSchema)(
|
|
3315
|
+
import_v417.z.object({
|
|
3316
|
+
outputs: import_v417.z.array(
|
|
3317
|
+
import_v417.z.discriminatedUnion("type", [
|
|
3318
|
+
import_v417.z.object({ type: import_v417.z.literal("logs"), logs: import_v417.z.string() }),
|
|
3319
|
+
import_v417.z.object({ type: import_v417.z.literal("image"), url: import_v417.z.string() })
|
|
3209
3320
|
])
|
|
3210
3321
|
).nullish()
|
|
3211
3322
|
})
|
|
3212
3323
|
)
|
|
3213
3324
|
);
|
|
3214
|
-
var codeInterpreterArgsSchema = (0,
|
|
3215
|
-
() => (0,
|
|
3216
|
-
|
|
3217
|
-
container:
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
fileIds:
|
|
3325
|
+
var codeInterpreterArgsSchema = (0, import_provider_utils24.lazySchema)(
|
|
3326
|
+
() => (0, import_provider_utils24.zodSchema)(
|
|
3327
|
+
import_v417.z.object({
|
|
3328
|
+
container: import_v417.z.union([
|
|
3329
|
+
import_v417.z.string(),
|
|
3330
|
+
import_v417.z.object({
|
|
3331
|
+
fileIds: import_v417.z.array(import_v417.z.string()).optional()
|
|
3221
3332
|
})
|
|
3222
3333
|
]).optional()
|
|
3223
3334
|
})
|
|
3224
3335
|
)
|
|
3225
3336
|
);
|
|
3226
|
-
var codeInterpreterToolFactory = (0,
|
|
3337
|
+
var codeInterpreterToolFactory = (0, import_provider_utils24.createProviderToolFactoryWithOutputSchema)({
|
|
3227
3338
|
id: "openai.code_interpreter",
|
|
3228
3339
|
inputSchema: codeInterpreterInputSchema,
|
|
3229
3340
|
outputSchema: codeInterpreterOutputSchema
|
|
@@ -3233,81 +3344,81 @@ var codeInterpreter = (args = {}) => {
|
|
|
3233
3344
|
};
|
|
3234
3345
|
|
|
3235
3346
|
// src/tool/file-search.ts
|
|
3236
|
-
var
|
|
3237
|
-
var
|
|
3238
|
-
var comparisonFilterSchema =
|
|
3239
|
-
key:
|
|
3240
|
-
type:
|
|
3241
|
-
value:
|
|
3347
|
+
var import_provider_utils25 = require("@ai-sdk/provider-utils");
|
|
3348
|
+
var import_v418 = require("zod/v4");
|
|
3349
|
+
var comparisonFilterSchema = import_v418.z.object({
|
|
3350
|
+
key: import_v418.z.string(),
|
|
3351
|
+
type: import_v418.z.enum(["eq", "ne", "gt", "gte", "lt", "lte"]),
|
|
3352
|
+
value: import_v418.z.union([import_v418.z.string(), import_v418.z.number(), import_v418.z.boolean()])
|
|
3242
3353
|
});
|
|
3243
|
-
var compoundFilterSchema =
|
|
3244
|
-
type:
|
|
3245
|
-
filters:
|
|
3246
|
-
|
|
3354
|
+
var compoundFilterSchema = import_v418.z.object({
|
|
3355
|
+
type: import_v418.z.enum(["and", "or"]),
|
|
3356
|
+
filters: import_v418.z.array(
|
|
3357
|
+
import_v418.z.union([comparisonFilterSchema, import_v418.z.lazy(() => compoundFilterSchema)])
|
|
3247
3358
|
)
|
|
3248
3359
|
});
|
|
3249
|
-
var fileSearchArgsSchema = (0,
|
|
3250
|
-
() => (0,
|
|
3251
|
-
|
|
3252
|
-
vectorStoreIds:
|
|
3253
|
-
maxNumResults:
|
|
3254
|
-
ranking:
|
|
3255
|
-
ranker:
|
|
3256
|
-
scoreThreshold:
|
|
3360
|
+
var fileSearchArgsSchema = (0, import_provider_utils25.lazySchema)(
|
|
3361
|
+
() => (0, import_provider_utils25.zodSchema)(
|
|
3362
|
+
import_v418.z.object({
|
|
3363
|
+
vectorStoreIds: import_v418.z.array(import_v418.z.string()),
|
|
3364
|
+
maxNumResults: import_v418.z.number().optional(),
|
|
3365
|
+
ranking: import_v418.z.object({
|
|
3366
|
+
ranker: import_v418.z.string().optional(),
|
|
3367
|
+
scoreThreshold: import_v418.z.number().optional()
|
|
3257
3368
|
}).optional(),
|
|
3258
|
-
filters:
|
|
3369
|
+
filters: import_v418.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
3259
3370
|
})
|
|
3260
3371
|
)
|
|
3261
3372
|
);
|
|
3262
|
-
var fileSearchOutputSchema = (0,
|
|
3263
|
-
() => (0,
|
|
3264
|
-
|
|
3265
|
-
queries:
|
|
3266
|
-
results:
|
|
3267
|
-
|
|
3268
|
-
attributes:
|
|
3269
|
-
fileId:
|
|
3270
|
-
filename:
|
|
3271
|
-
score:
|
|
3272
|
-
text:
|
|
3373
|
+
var fileSearchOutputSchema = (0, import_provider_utils25.lazySchema)(
|
|
3374
|
+
() => (0, import_provider_utils25.zodSchema)(
|
|
3375
|
+
import_v418.z.object({
|
|
3376
|
+
queries: import_v418.z.array(import_v418.z.string()),
|
|
3377
|
+
results: import_v418.z.array(
|
|
3378
|
+
import_v418.z.object({
|
|
3379
|
+
attributes: import_v418.z.record(import_v418.z.string(), import_v418.z.unknown()),
|
|
3380
|
+
fileId: import_v418.z.string(),
|
|
3381
|
+
filename: import_v418.z.string(),
|
|
3382
|
+
score: import_v418.z.number(),
|
|
3383
|
+
text: import_v418.z.string()
|
|
3273
3384
|
})
|
|
3274
3385
|
).nullable()
|
|
3275
3386
|
})
|
|
3276
3387
|
)
|
|
3277
3388
|
);
|
|
3278
|
-
var fileSearch = (0,
|
|
3389
|
+
var fileSearch = (0, import_provider_utils25.createProviderToolFactoryWithOutputSchema)({
|
|
3279
3390
|
id: "openai.file_search",
|
|
3280
|
-
inputSchema:
|
|
3391
|
+
inputSchema: import_v418.z.object({}),
|
|
3281
3392
|
outputSchema: fileSearchOutputSchema
|
|
3282
3393
|
});
|
|
3283
3394
|
|
|
3284
3395
|
// src/tool/image-generation.ts
|
|
3285
|
-
var
|
|
3286
|
-
var
|
|
3287
|
-
var imageGenerationArgsSchema = (0,
|
|
3288
|
-
() => (0,
|
|
3289
|
-
|
|
3290
|
-
background:
|
|
3291
|
-
inputFidelity:
|
|
3292
|
-
inputImageMask:
|
|
3293
|
-
fileId:
|
|
3294
|
-
imageUrl:
|
|
3396
|
+
var import_provider_utils26 = require("@ai-sdk/provider-utils");
|
|
3397
|
+
var import_v419 = require("zod/v4");
|
|
3398
|
+
var imageGenerationArgsSchema = (0, import_provider_utils26.lazySchema)(
|
|
3399
|
+
() => (0, import_provider_utils26.zodSchema)(
|
|
3400
|
+
import_v419.z.object({
|
|
3401
|
+
background: import_v419.z.enum(["auto", "opaque", "transparent"]).optional(),
|
|
3402
|
+
inputFidelity: import_v419.z.enum(["low", "high"]).optional(),
|
|
3403
|
+
inputImageMask: import_v419.z.object({
|
|
3404
|
+
fileId: import_v419.z.string().optional(),
|
|
3405
|
+
imageUrl: import_v419.z.string().optional()
|
|
3295
3406
|
}).optional(),
|
|
3296
|
-
model:
|
|
3297
|
-
moderation:
|
|
3298
|
-
outputCompression:
|
|
3299
|
-
outputFormat:
|
|
3300
|
-
partialImages:
|
|
3301
|
-
quality:
|
|
3302
|
-
size:
|
|
3407
|
+
model: import_v419.z.string().optional(),
|
|
3408
|
+
moderation: import_v419.z.enum(["auto"]).optional(),
|
|
3409
|
+
outputCompression: import_v419.z.number().int().min(0).max(100).optional(),
|
|
3410
|
+
outputFormat: import_v419.z.enum(["png", "jpeg", "webp"]).optional(),
|
|
3411
|
+
partialImages: import_v419.z.number().int().min(0).max(3).optional(),
|
|
3412
|
+
quality: import_v419.z.enum(["auto", "low", "medium", "high"]).optional(),
|
|
3413
|
+
size: import_v419.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
3303
3414
|
}).strict()
|
|
3304
3415
|
)
|
|
3305
3416
|
);
|
|
3306
|
-
var imageGenerationInputSchema = (0,
|
|
3307
|
-
var imageGenerationOutputSchema = (0,
|
|
3308
|
-
() => (0,
|
|
3417
|
+
var imageGenerationInputSchema = (0, import_provider_utils26.lazySchema)(() => (0, import_provider_utils26.zodSchema)(import_v419.z.object({})));
|
|
3418
|
+
var imageGenerationOutputSchema = (0, import_provider_utils26.lazySchema)(
|
|
3419
|
+
() => (0, import_provider_utils26.zodSchema)(import_v419.z.object({ result: import_v419.z.string() }))
|
|
3309
3420
|
);
|
|
3310
|
-
var imageGenerationToolFactory = (0,
|
|
3421
|
+
var imageGenerationToolFactory = (0, import_provider_utils26.createProviderToolFactoryWithOutputSchema)({
|
|
3311
3422
|
id: "openai.image_generation",
|
|
3312
3423
|
inputSchema: imageGenerationInputSchema,
|
|
3313
3424
|
outputSchema: imageGenerationOutputSchema
|
|
@@ -3317,32 +3428,32 @@ var imageGeneration = (args = {}) => {
|
|
|
3317
3428
|
};
|
|
3318
3429
|
|
|
3319
3430
|
// src/tool/mcp.ts
|
|
3320
|
-
var
|
|
3321
|
-
var
|
|
3322
|
-
var jsonValueSchema =
|
|
3323
|
-
() =>
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3431
|
+
var import_provider_utils27 = require("@ai-sdk/provider-utils");
|
|
3432
|
+
var import_v420 = require("zod/v4");
|
|
3433
|
+
var jsonValueSchema = import_v420.z.lazy(
|
|
3434
|
+
() => import_v420.z.union([
|
|
3435
|
+
import_v420.z.string(),
|
|
3436
|
+
import_v420.z.number(),
|
|
3437
|
+
import_v420.z.boolean(),
|
|
3438
|
+
import_v420.z.null(),
|
|
3439
|
+
import_v420.z.array(jsonValueSchema),
|
|
3440
|
+
import_v420.z.record(import_v420.z.string(), jsonValueSchema)
|
|
3330
3441
|
])
|
|
3331
3442
|
);
|
|
3332
|
-
var mcpArgsSchema = (0,
|
|
3333
|
-
() => (0,
|
|
3334
|
-
|
|
3335
|
-
serverLabel:
|
|
3336
|
-
allowedTools:
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
readOnly:
|
|
3340
|
-
toolNames:
|
|
3443
|
+
var mcpArgsSchema = (0, import_provider_utils27.lazySchema)(
|
|
3444
|
+
() => (0, import_provider_utils27.zodSchema)(
|
|
3445
|
+
import_v420.z.object({
|
|
3446
|
+
serverLabel: import_v420.z.string(),
|
|
3447
|
+
allowedTools: import_v420.z.union([
|
|
3448
|
+
import_v420.z.array(import_v420.z.string()),
|
|
3449
|
+
import_v420.z.object({
|
|
3450
|
+
readOnly: import_v420.z.boolean().optional(),
|
|
3451
|
+
toolNames: import_v420.z.array(import_v420.z.string()).optional()
|
|
3341
3452
|
})
|
|
3342
3453
|
]).optional(),
|
|
3343
|
-
authorization:
|
|
3344
|
-
connectorId:
|
|
3345
|
-
headers:
|
|
3454
|
+
authorization: import_v420.z.string().optional(),
|
|
3455
|
+
connectorId: import_v420.z.string().optional(),
|
|
3456
|
+
headers: import_v420.z.record(import_v420.z.string(), import_v420.z.string()).optional(),
|
|
3346
3457
|
// TODO: Integrate this MCP tool approval with our SDK's existing tool approval architecture
|
|
3347
3458
|
// requireApproval: z
|
|
3348
3459
|
// .union([
|
|
@@ -3353,114 +3464,63 @@ var mcpArgsSchema = (0, import_provider_utils26.lazySchema)(
|
|
|
3353
3464
|
// }),
|
|
3354
3465
|
// ])
|
|
3355
3466
|
// .optional(),
|
|
3356
|
-
serverDescription:
|
|
3357
|
-
serverUrl:
|
|
3467
|
+
serverDescription: import_v420.z.string().optional(),
|
|
3468
|
+
serverUrl: import_v420.z.string().optional()
|
|
3358
3469
|
}).refine(
|
|
3359
3470
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
3360
3471
|
"One of serverUrl or connectorId must be provided."
|
|
3361
3472
|
)
|
|
3362
3473
|
)
|
|
3363
3474
|
);
|
|
3364
|
-
var mcpInputSchema = (0,
|
|
3365
|
-
var mcpOutputSchema = (0,
|
|
3366
|
-
() => (0,
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
type:
|
|
3370
|
-
serverLabel:
|
|
3371
|
-
name:
|
|
3372
|
-
arguments:
|
|
3373
|
-
output:
|
|
3374
|
-
error:
|
|
3475
|
+
var mcpInputSchema = (0, import_provider_utils27.lazySchema)(() => (0, import_provider_utils27.zodSchema)(import_v420.z.object({})));
|
|
3476
|
+
var mcpOutputSchema = (0, import_provider_utils27.lazySchema)(
|
|
3477
|
+
() => (0, import_provider_utils27.zodSchema)(
|
|
3478
|
+
import_v420.z.discriminatedUnion("type", [
|
|
3479
|
+
import_v420.z.object({
|
|
3480
|
+
type: import_v420.z.literal("call"),
|
|
3481
|
+
serverLabel: import_v420.z.string(),
|
|
3482
|
+
name: import_v420.z.string(),
|
|
3483
|
+
arguments: import_v420.z.string(),
|
|
3484
|
+
output: import_v420.z.string().nullable().optional(),
|
|
3485
|
+
error: import_v420.z.union([import_v420.z.string(), jsonValueSchema]).optional()
|
|
3375
3486
|
}),
|
|
3376
|
-
|
|
3377
|
-
type:
|
|
3378
|
-
serverLabel:
|
|
3379
|
-
tools:
|
|
3380
|
-
|
|
3381
|
-
name:
|
|
3382
|
-
description:
|
|
3487
|
+
import_v420.z.object({
|
|
3488
|
+
type: import_v420.z.literal("listTools"),
|
|
3489
|
+
serverLabel: import_v420.z.string(),
|
|
3490
|
+
tools: import_v420.z.array(
|
|
3491
|
+
import_v420.z.object({
|
|
3492
|
+
name: import_v420.z.string(),
|
|
3493
|
+
description: import_v420.z.string().optional(),
|
|
3383
3494
|
inputSchema: jsonValueSchema,
|
|
3384
|
-
annotations:
|
|
3495
|
+
annotations: import_v420.z.record(import_v420.z.string(), jsonValueSchema).optional()
|
|
3385
3496
|
})
|
|
3386
3497
|
),
|
|
3387
|
-
error:
|
|
3498
|
+
error: import_v420.z.union([import_v420.z.string(), jsonValueSchema]).optional()
|
|
3388
3499
|
}),
|
|
3389
|
-
|
|
3390
|
-
type:
|
|
3391
|
-
serverLabel:
|
|
3392
|
-
name:
|
|
3393
|
-
arguments:
|
|
3394
|
-
approvalRequestId:
|
|
3500
|
+
import_v420.z.object({
|
|
3501
|
+
type: import_v420.z.literal("approvalRequest"),
|
|
3502
|
+
serverLabel: import_v420.z.string(),
|
|
3503
|
+
name: import_v420.z.string(),
|
|
3504
|
+
arguments: import_v420.z.string(),
|
|
3505
|
+
approvalRequestId: import_v420.z.string()
|
|
3395
3506
|
})
|
|
3396
3507
|
])
|
|
3397
3508
|
)
|
|
3398
3509
|
);
|
|
3399
|
-
var mcpToolFactory = (0,
|
|
3510
|
+
var mcpToolFactory = (0, import_provider_utils27.createProviderToolFactoryWithOutputSchema)({
|
|
3400
3511
|
id: "openai.mcp",
|
|
3401
3512
|
inputSchema: mcpInputSchema,
|
|
3402
3513
|
outputSchema: mcpOutputSchema
|
|
3403
3514
|
});
|
|
3404
3515
|
|
|
3405
3516
|
// src/tool/web-search.ts
|
|
3406
|
-
var import_provider_utils27 = require("@ai-sdk/provider-utils");
|
|
3407
|
-
var import_v420 = require("zod/v4");
|
|
3408
|
-
var webSearchArgsSchema = (0, import_provider_utils27.lazySchema)(
|
|
3409
|
-
() => (0, import_provider_utils27.zodSchema)(
|
|
3410
|
-
import_v420.z.object({
|
|
3411
|
-
externalWebAccess: import_v420.z.boolean().optional(),
|
|
3412
|
-
filters: import_v420.z.object({ allowedDomains: import_v420.z.array(import_v420.z.string()).optional() }).optional(),
|
|
3413
|
-
searchContextSize: import_v420.z.enum(["low", "medium", "high"]).optional(),
|
|
3414
|
-
userLocation: import_v420.z.object({
|
|
3415
|
-
type: import_v420.z.literal("approximate"),
|
|
3416
|
-
country: import_v420.z.string().optional(),
|
|
3417
|
-
city: import_v420.z.string().optional(),
|
|
3418
|
-
region: import_v420.z.string().optional(),
|
|
3419
|
-
timezone: import_v420.z.string().optional()
|
|
3420
|
-
}).optional()
|
|
3421
|
-
})
|
|
3422
|
-
)
|
|
3423
|
-
);
|
|
3424
|
-
var webSearchInputSchema = (0, import_provider_utils27.lazySchema)(() => (0, import_provider_utils27.zodSchema)(import_v420.z.object({})));
|
|
3425
|
-
var webSearchOutputSchema = (0, import_provider_utils27.lazySchema)(
|
|
3426
|
-
() => (0, import_provider_utils27.zodSchema)(
|
|
3427
|
-
import_v420.z.object({
|
|
3428
|
-
action: import_v420.z.discriminatedUnion("type", [
|
|
3429
|
-
import_v420.z.object({
|
|
3430
|
-
type: import_v420.z.literal("search"),
|
|
3431
|
-
query: import_v420.z.string().optional()
|
|
3432
|
-
}),
|
|
3433
|
-
import_v420.z.object({
|
|
3434
|
-
type: import_v420.z.literal("openPage"),
|
|
3435
|
-
url: import_v420.z.string()
|
|
3436
|
-
}),
|
|
3437
|
-
import_v420.z.object({
|
|
3438
|
-
type: import_v420.z.literal("find"),
|
|
3439
|
-
url: import_v420.z.string(),
|
|
3440
|
-
pattern: import_v420.z.string()
|
|
3441
|
-
})
|
|
3442
|
-
]),
|
|
3443
|
-
sources: import_v420.z.array(
|
|
3444
|
-
import_v420.z.discriminatedUnion("type", [
|
|
3445
|
-
import_v420.z.object({ type: import_v420.z.literal("url"), url: import_v420.z.string() }),
|
|
3446
|
-
import_v420.z.object({ type: import_v420.z.literal("api"), name: import_v420.z.string() })
|
|
3447
|
-
])
|
|
3448
|
-
).optional()
|
|
3449
|
-
})
|
|
3450
|
-
)
|
|
3451
|
-
);
|
|
3452
|
-
var webSearchToolFactory = (0, import_provider_utils27.createProviderToolFactoryWithOutputSchema)({
|
|
3453
|
-
id: "openai.web_search",
|
|
3454
|
-
inputSchema: webSearchInputSchema,
|
|
3455
|
-
outputSchema: webSearchOutputSchema
|
|
3456
|
-
});
|
|
3457
|
-
|
|
3458
|
-
// src/tool/web-search-preview.ts
|
|
3459
3517
|
var import_provider_utils28 = require("@ai-sdk/provider-utils");
|
|
3460
3518
|
var import_v421 = require("zod/v4");
|
|
3461
|
-
var
|
|
3519
|
+
var webSearchArgsSchema = (0, import_provider_utils28.lazySchema)(
|
|
3462
3520
|
() => (0, import_provider_utils28.zodSchema)(
|
|
3463
3521
|
import_v421.z.object({
|
|
3522
|
+
externalWebAccess: import_v421.z.boolean().optional(),
|
|
3523
|
+
filters: import_v421.z.object({ allowedDomains: import_v421.z.array(import_v421.z.string()).optional() }).optional(),
|
|
3464
3524
|
searchContextSize: import_v421.z.enum(["low", "medium", "high"]).optional(),
|
|
3465
3525
|
userLocation: import_v421.z.object({
|
|
3466
3526
|
type: import_v421.z.literal("approximate"),
|
|
@@ -3472,10 +3532,8 @@ var webSearchPreviewArgsSchema = (0, import_provider_utils28.lazySchema)(
|
|
|
3472
3532
|
})
|
|
3473
3533
|
)
|
|
3474
3534
|
);
|
|
3475
|
-
var
|
|
3476
|
-
|
|
3477
|
-
);
|
|
3478
|
-
var webSearchPreviewOutputSchema = (0, import_provider_utils28.lazySchema)(
|
|
3535
|
+
var webSearchInputSchema = (0, import_provider_utils28.lazySchema)(() => (0, import_provider_utils28.zodSchema)(import_v421.z.object({})));
|
|
3536
|
+
var webSearchOutputSchema = (0, import_provider_utils28.lazySchema)(
|
|
3479
3537
|
() => (0, import_provider_utils28.zodSchema)(
|
|
3480
3538
|
import_v421.z.object({
|
|
3481
3539
|
action: import_v421.z.discriminatedUnion("type", [
|
|
@@ -3492,11 +3550,64 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils28.lazySchema)(
|
|
|
3492
3550
|
url: import_v421.z.string(),
|
|
3493
3551
|
pattern: import_v421.z.string()
|
|
3494
3552
|
})
|
|
3553
|
+
]),
|
|
3554
|
+
sources: import_v421.z.array(
|
|
3555
|
+
import_v421.z.discriminatedUnion("type", [
|
|
3556
|
+
import_v421.z.object({ type: import_v421.z.literal("url"), url: import_v421.z.string() }),
|
|
3557
|
+
import_v421.z.object({ type: import_v421.z.literal("api"), name: import_v421.z.string() })
|
|
3558
|
+
])
|
|
3559
|
+
).optional()
|
|
3560
|
+
})
|
|
3561
|
+
)
|
|
3562
|
+
);
|
|
3563
|
+
var webSearchToolFactory = (0, import_provider_utils28.createProviderToolFactoryWithOutputSchema)({
|
|
3564
|
+
id: "openai.web_search",
|
|
3565
|
+
inputSchema: webSearchInputSchema,
|
|
3566
|
+
outputSchema: webSearchOutputSchema
|
|
3567
|
+
});
|
|
3568
|
+
|
|
3569
|
+
// src/tool/web-search-preview.ts
|
|
3570
|
+
var import_provider_utils29 = require("@ai-sdk/provider-utils");
|
|
3571
|
+
var import_v422 = require("zod/v4");
|
|
3572
|
+
var webSearchPreviewArgsSchema = (0, import_provider_utils29.lazySchema)(
|
|
3573
|
+
() => (0, import_provider_utils29.zodSchema)(
|
|
3574
|
+
import_v422.z.object({
|
|
3575
|
+
searchContextSize: import_v422.z.enum(["low", "medium", "high"]).optional(),
|
|
3576
|
+
userLocation: import_v422.z.object({
|
|
3577
|
+
type: import_v422.z.literal("approximate"),
|
|
3578
|
+
country: import_v422.z.string().optional(),
|
|
3579
|
+
city: import_v422.z.string().optional(),
|
|
3580
|
+
region: import_v422.z.string().optional(),
|
|
3581
|
+
timezone: import_v422.z.string().optional()
|
|
3582
|
+
}).optional()
|
|
3583
|
+
})
|
|
3584
|
+
)
|
|
3585
|
+
);
|
|
3586
|
+
var webSearchPreviewInputSchema = (0, import_provider_utils29.lazySchema)(
|
|
3587
|
+
() => (0, import_provider_utils29.zodSchema)(import_v422.z.object({}))
|
|
3588
|
+
);
|
|
3589
|
+
var webSearchPreviewOutputSchema = (0, import_provider_utils29.lazySchema)(
|
|
3590
|
+
() => (0, import_provider_utils29.zodSchema)(
|
|
3591
|
+
import_v422.z.object({
|
|
3592
|
+
action: import_v422.z.discriminatedUnion("type", [
|
|
3593
|
+
import_v422.z.object({
|
|
3594
|
+
type: import_v422.z.literal("search"),
|
|
3595
|
+
query: import_v422.z.string().optional()
|
|
3596
|
+
}),
|
|
3597
|
+
import_v422.z.object({
|
|
3598
|
+
type: import_v422.z.literal("openPage"),
|
|
3599
|
+
url: import_v422.z.string()
|
|
3600
|
+
}),
|
|
3601
|
+
import_v422.z.object({
|
|
3602
|
+
type: import_v422.z.literal("find"),
|
|
3603
|
+
url: import_v422.z.string(),
|
|
3604
|
+
pattern: import_v422.z.string()
|
|
3605
|
+
})
|
|
3495
3606
|
])
|
|
3496
3607
|
})
|
|
3497
3608
|
)
|
|
3498
3609
|
);
|
|
3499
|
-
var webSearchPreview = (0,
|
|
3610
|
+
var webSearchPreview = (0, import_provider_utils29.createProviderToolFactoryWithOutputSchema)({
|
|
3500
3611
|
id: "openai.web_search_preview",
|
|
3501
3612
|
inputSchema: webSearchPreviewInputSchema,
|
|
3502
3613
|
outputSchema: webSearchPreviewOutputSchema
|
|
@@ -3528,7 +3639,7 @@ async function prepareResponsesTools({
|
|
|
3528
3639
|
case "provider": {
|
|
3529
3640
|
switch (tool.id) {
|
|
3530
3641
|
case "openai.file_search": {
|
|
3531
|
-
const args = await (0,
|
|
3642
|
+
const args = await (0, import_provider_utils30.validateTypes)({
|
|
3532
3643
|
value: tool.args,
|
|
3533
3644
|
schema: fileSearchArgsSchema
|
|
3534
3645
|
});
|
|
@@ -3550,8 +3661,14 @@ async function prepareResponsesTools({
|
|
|
3550
3661
|
});
|
|
3551
3662
|
break;
|
|
3552
3663
|
}
|
|
3664
|
+
case "openai.apply_patch": {
|
|
3665
|
+
openaiTools.push({
|
|
3666
|
+
type: "apply_patch"
|
|
3667
|
+
});
|
|
3668
|
+
break;
|
|
3669
|
+
}
|
|
3553
3670
|
case "openai.web_search_preview": {
|
|
3554
|
-
const args = await (0,
|
|
3671
|
+
const args = await (0, import_provider_utils30.validateTypes)({
|
|
3555
3672
|
value: tool.args,
|
|
3556
3673
|
schema: webSearchPreviewArgsSchema
|
|
3557
3674
|
});
|
|
@@ -3563,7 +3680,7 @@ async function prepareResponsesTools({
|
|
|
3563
3680
|
break;
|
|
3564
3681
|
}
|
|
3565
3682
|
case "openai.web_search": {
|
|
3566
|
-
const args = await (0,
|
|
3683
|
+
const args = await (0, import_provider_utils30.validateTypes)({
|
|
3567
3684
|
value: tool.args,
|
|
3568
3685
|
schema: webSearchArgsSchema
|
|
3569
3686
|
});
|
|
@@ -3577,7 +3694,7 @@ async function prepareResponsesTools({
|
|
|
3577
3694
|
break;
|
|
3578
3695
|
}
|
|
3579
3696
|
case "openai.code_interpreter": {
|
|
3580
|
-
const args = await (0,
|
|
3697
|
+
const args = await (0, import_provider_utils30.validateTypes)({
|
|
3581
3698
|
value: tool.args,
|
|
3582
3699
|
schema: codeInterpreterArgsSchema
|
|
3583
3700
|
});
|
|
@@ -3588,7 +3705,7 @@ async function prepareResponsesTools({
|
|
|
3588
3705
|
break;
|
|
3589
3706
|
}
|
|
3590
3707
|
case "openai.image_generation": {
|
|
3591
|
-
const args = await (0,
|
|
3708
|
+
const args = await (0, import_provider_utils30.validateTypes)({
|
|
3592
3709
|
value: tool.args,
|
|
3593
3710
|
schema: imageGenerationArgsSchema
|
|
3594
3711
|
});
|
|
@@ -3611,7 +3728,7 @@ async function prepareResponsesTools({
|
|
|
3611
3728
|
break;
|
|
3612
3729
|
}
|
|
3613
3730
|
case "openai.mcp": {
|
|
3614
|
-
const args = await (0,
|
|
3731
|
+
const args = await (0, import_provider_utils30.validateTypes)({
|
|
3615
3732
|
value: tool.args,
|
|
3616
3733
|
schema: mcpArgsSchema
|
|
3617
3734
|
});
|
|
@@ -3654,7 +3771,7 @@ async function prepareResponsesTools({
|
|
|
3654
3771
|
case "tool":
|
|
3655
3772
|
return {
|
|
3656
3773
|
tools: openaiTools,
|
|
3657
|
-
toolChoice: toolChoice.toolName === "code_interpreter" || toolChoice.toolName === "file_search" || toolChoice.toolName === "image_generation" || toolChoice.toolName === "web_search_preview" || toolChoice.toolName === "web_search" || toolChoice.toolName === "mcp" ? { type: toolChoice.toolName } : { type: "function", name: toolChoice.toolName },
|
|
3774
|
+
toolChoice: toolChoice.toolName === "code_interpreter" || toolChoice.toolName === "file_search" || toolChoice.toolName === "image_generation" || toolChoice.toolName === "web_search_preview" || toolChoice.toolName === "web_search" || toolChoice.toolName === "mcp" || toolChoice.toolName === "apply_patch" ? { type: toolChoice.toolName } : { type: "function", name: toolChoice.toolName },
|
|
3658
3775
|
toolWarnings
|
|
3659
3776
|
};
|
|
3660
3777
|
default: {
|
|
@@ -3713,7 +3830,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3713
3830
|
if (stopSequences != null) {
|
|
3714
3831
|
warnings.push({ type: "unsupported", feature: "stopSequences" });
|
|
3715
3832
|
}
|
|
3716
|
-
const openaiOptions = await (0,
|
|
3833
|
+
const openaiOptions = await (0, import_provider_utils31.parseProviderOptions)({
|
|
3717
3834
|
provider: "openai",
|
|
3718
3835
|
providerOptions,
|
|
3719
3836
|
schema: openaiResponsesProviderOptionsSchema
|
|
@@ -3725,7 +3842,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3725
3842
|
details: "conversation and previousResponseId cannot be used together"
|
|
3726
3843
|
});
|
|
3727
3844
|
}
|
|
3728
|
-
const toolNameMapping = (0,
|
|
3845
|
+
const toolNameMapping = (0, import_provider_utils31.createToolNameMapping)({
|
|
3729
3846
|
tools,
|
|
3730
3847
|
providerToolNames: {
|
|
3731
3848
|
"openai.code_interpreter": "code_interpreter",
|
|
@@ -3734,7 +3851,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3734
3851
|
"openai.local_shell": "local_shell",
|
|
3735
3852
|
"openai.web_search": "web_search",
|
|
3736
3853
|
"openai.web_search_preview": "web_search_preview",
|
|
3737
|
-
"openai.mcp": "mcp"
|
|
3854
|
+
"openai.mcp": "mcp",
|
|
3855
|
+
"openai.apply_patch": "apply_patch"
|
|
3738
3856
|
}
|
|
3739
3857
|
});
|
|
3740
3858
|
const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
|
|
@@ -3743,10 +3861,11 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3743
3861
|
systemMessageMode: modelConfig.systemMessageMode,
|
|
3744
3862
|
fileIdPrefixes: this.config.fileIdPrefixes,
|
|
3745
3863
|
store: (_a = openaiOptions == null ? void 0 : openaiOptions.store) != null ? _a : true,
|
|
3746
|
-
hasLocalShellTool: hasOpenAITool("openai.local_shell")
|
|
3864
|
+
hasLocalShellTool: hasOpenAITool("openai.local_shell"),
|
|
3865
|
+
hasApplyPatchTool: hasOpenAITool("openai.apply_patch")
|
|
3747
3866
|
});
|
|
3748
3867
|
warnings.push(...inputWarnings);
|
|
3749
|
-
const strictJsonSchema = (_b = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _b :
|
|
3868
|
+
const strictJsonSchema = (_b = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _b : true;
|
|
3750
3869
|
let include = openaiOptions == null ? void 0 : openaiOptions.include;
|
|
3751
3870
|
function addInclude(key) {
|
|
3752
3871
|
if (include == null) {
|
|
@@ -3912,12 +4031,12 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3912
4031
|
responseHeaders,
|
|
3913
4032
|
value: response,
|
|
3914
4033
|
rawValue: rawResponse
|
|
3915
|
-
} = await (0,
|
|
4034
|
+
} = await (0, import_provider_utils31.postJsonToApi)({
|
|
3916
4035
|
url,
|
|
3917
|
-
headers: (0,
|
|
4036
|
+
headers: (0, import_provider_utils31.combineHeaders)(this.config.headers(), options.headers),
|
|
3918
4037
|
body,
|
|
3919
4038
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
3920
|
-
successfulResponseHandler: (0,
|
|
4039
|
+
successfulResponseHandler: (0, import_provider_utils31.createJsonResponseHandler)(
|
|
3921
4040
|
openaiResponsesResponseSchema
|
|
3922
4041
|
),
|
|
3923
4042
|
abortSignal: options.abortSignal,
|
|
@@ -4014,7 +4133,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4014
4133
|
content.push({
|
|
4015
4134
|
type: "source",
|
|
4016
4135
|
sourceType: "url",
|
|
4017
|
-
id: (_f = (_e = (_d = this.config).generateId) == null ? void 0 : _e.call(_d)) != null ? _f : (0,
|
|
4136
|
+
id: (_f = (_e = (_d = this.config).generateId) == null ? void 0 : _e.call(_d)) != null ? _f : (0, import_provider_utils31.generateId)(),
|
|
4018
4137
|
url: annotation.url,
|
|
4019
4138
|
title: annotation.title
|
|
4020
4139
|
});
|
|
@@ -4022,7 +4141,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4022
4141
|
content.push({
|
|
4023
4142
|
type: "source",
|
|
4024
4143
|
sourceType: "document",
|
|
4025
|
-
id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0,
|
|
4144
|
+
id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0, import_provider_utils31.generateId)(),
|
|
4026
4145
|
mediaType: "text/plain",
|
|
4027
4146
|
title: (_k = (_j = annotation.quote) != null ? _j : annotation.filename) != null ? _k : "Document",
|
|
4028
4147
|
filename: (_l = annotation.filename) != null ? _l : annotation.file_id,
|
|
@@ -4038,7 +4157,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4038
4157
|
content.push({
|
|
4039
4158
|
type: "source",
|
|
4040
4159
|
sourceType: "document",
|
|
4041
|
-
id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0,
|
|
4160
|
+
id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils31.generateId)(),
|
|
4042
4161
|
mediaType: "text/plain",
|
|
4043
4162
|
title: (_q = (_p = annotation.filename) != null ? _p : annotation.file_id) != null ? _q : "Document",
|
|
4044
4163
|
filename: (_r = annotation.filename) != null ? _r : annotation.file_id,
|
|
@@ -4054,7 +4173,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4054
4173
|
content.push({
|
|
4055
4174
|
type: "source",
|
|
4056
4175
|
sourceType: "document",
|
|
4057
|
-
id: (_u = (_t = (_s = this.config).generateId) == null ? void 0 : _t.call(_s)) != null ? _u : (0,
|
|
4176
|
+
id: (_u = (_t = (_s = this.config).generateId) == null ? void 0 : _t.call(_s)) != null ? _u : (0, import_provider_utils31.generateId)(),
|
|
4058
4177
|
mediaType: "application/octet-stream",
|
|
4059
4178
|
title: annotation.file_id,
|
|
4060
4179
|
filename: annotation.file_id,
|
|
@@ -4244,6 +4363,23 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4244
4363
|
});
|
|
4245
4364
|
break;
|
|
4246
4365
|
}
|
|
4366
|
+
case "apply_patch_call": {
|
|
4367
|
+
content.push({
|
|
4368
|
+
type: "tool-call",
|
|
4369
|
+
toolCallId: part.call_id,
|
|
4370
|
+
toolName: toolNameMapping.toCustomToolName("apply_patch"),
|
|
4371
|
+
input: JSON.stringify({
|
|
4372
|
+
callId: part.call_id,
|
|
4373
|
+
operation: part.operation
|
|
4374
|
+
}),
|
|
4375
|
+
providerMetadata: {
|
|
4376
|
+
[providerKey]: {
|
|
4377
|
+
itemId: part.id
|
|
4378
|
+
}
|
|
4379
|
+
}
|
|
4380
|
+
});
|
|
4381
|
+
break;
|
|
4382
|
+
}
|
|
4247
4383
|
}
|
|
4248
4384
|
}
|
|
4249
4385
|
const providerMetadata = {
|
|
@@ -4289,18 +4425,18 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4289
4425
|
toolNameMapping,
|
|
4290
4426
|
store
|
|
4291
4427
|
} = await this.getArgs(options);
|
|
4292
|
-
const { responseHeaders, value: response } = await (0,
|
|
4428
|
+
const { responseHeaders, value: response } = await (0, import_provider_utils31.postJsonToApi)({
|
|
4293
4429
|
url: this.config.url({
|
|
4294
4430
|
path: "/responses",
|
|
4295
4431
|
modelId: this.modelId
|
|
4296
4432
|
}),
|
|
4297
|
-
headers: (0,
|
|
4433
|
+
headers: (0, import_provider_utils31.combineHeaders)(this.config.headers(), options.headers),
|
|
4298
4434
|
body: {
|
|
4299
4435
|
...body,
|
|
4300
4436
|
stream: true
|
|
4301
4437
|
},
|
|
4302
4438
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
4303
|
-
successfulResponseHandler: (0,
|
|
4439
|
+
successfulResponseHandler: (0, import_provider_utils31.createEventSourceResponseHandler)(
|
|
4304
4440
|
openaiResponsesChunkSchema
|
|
4305
4441
|
),
|
|
4306
4442
|
abortSignal: options.abortSignal,
|
|
@@ -4431,6 +4567,27 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4431
4567
|
input: "{}",
|
|
4432
4568
|
providerExecuted: true
|
|
4433
4569
|
});
|
|
4570
|
+
} else if (value.item.type === "apply_patch_call") {
|
|
4571
|
+
ongoingToolCalls[value.output_index] = {
|
|
4572
|
+
toolName: toolNameMapping.toCustomToolName("apply_patch"),
|
|
4573
|
+
toolCallId: value.item.call_id
|
|
4574
|
+
};
|
|
4575
|
+
if (value.item.status === "completed") {
|
|
4576
|
+
controller.enqueue({
|
|
4577
|
+
type: "tool-call",
|
|
4578
|
+
toolCallId: value.item.call_id,
|
|
4579
|
+
toolName: toolNameMapping.toCustomToolName("apply_patch"),
|
|
4580
|
+
input: JSON.stringify({
|
|
4581
|
+
callId: value.item.call_id,
|
|
4582
|
+
operation: value.item.operation
|
|
4583
|
+
}),
|
|
4584
|
+
providerMetadata: {
|
|
4585
|
+
[providerKey]: {
|
|
4586
|
+
itemId: value.item.id
|
|
4587
|
+
}
|
|
4588
|
+
}
|
|
4589
|
+
});
|
|
4590
|
+
}
|
|
4434
4591
|
} else if (value.item.type === "message") {
|
|
4435
4592
|
ongoingAnnotations.splice(0, ongoingAnnotations.length);
|
|
4436
4593
|
controller.enqueue({
|
|
@@ -4594,6 +4751,24 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4594
4751
|
...value.item.error != null ? { error: value.item.error } : {}
|
|
4595
4752
|
}
|
|
4596
4753
|
});
|
|
4754
|
+
} else if (value.item.type === "apply_patch_call") {
|
|
4755
|
+
ongoingToolCalls[value.output_index] = void 0;
|
|
4756
|
+
if (value.item.status === "completed") {
|
|
4757
|
+
controller.enqueue({
|
|
4758
|
+
type: "tool-call",
|
|
4759
|
+
toolCallId: value.item.call_id,
|
|
4760
|
+
toolName: toolNameMapping.toCustomToolName("apply_patch"),
|
|
4761
|
+
input: JSON.stringify({
|
|
4762
|
+
callId: value.item.call_id,
|
|
4763
|
+
operation: value.item.operation
|
|
4764
|
+
}),
|
|
4765
|
+
providerMetadata: {
|
|
4766
|
+
[providerKey]: {
|
|
4767
|
+
itemId: value.item.id
|
|
4768
|
+
}
|
|
4769
|
+
}
|
|
4770
|
+
});
|
|
4771
|
+
}
|
|
4597
4772
|
} else if (value.item.type === "mcp_approval_request") {
|
|
4598
4773
|
ongoingToolCalls[value.output_index] = void 0;
|
|
4599
4774
|
controller.enqueue({
|
|
@@ -4791,7 +4966,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4791
4966
|
controller.enqueue({
|
|
4792
4967
|
type: "source",
|
|
4793
4968
|
sourceType: "url",
|
|
4794
|
-
id: (_p = (_o = (_n = self.config).generateId) == null ? void 0 : _o.call(_n)) != null ? _p : (0,
|
|
4969
|
+
id: (_p = (_o = (_n = self.config).generateId) == null ? void 0 : _o.call(_n)) != null ? _p : (0, import_provider_utils31.generateId)(),
|
|
4795
4970
|
url: value.annotation.url,
|
|
4796
4971
|
title: value.annotation.title
|
|
4797
4972
|
});
|
|
@@ -4799,7 +4974,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4799
4974
|
controller.enqueue({
|
|
4800
4975
|
type: "source",
|
|
4801
4976
|
sourceType: "document",
|
|
4802
|
-
id: (_s = (_r = (_q = self.config).generateId) == null ? void 0 : _r.call(_q)) != null ? _s : (0,
|
|
4977
|
+
id: (_s = (_r = (_q = self.config).generateId) == null ? void 0 : _r.call(_q)) != null ? _s : (0, import_provider_utils31.generateId)(),
|
|
4803
4978
|
mediaType: "text/plain",
|
|
4804
4979
|
title: (_u = (_t = value.annotation.quote) != null ? _t : value.annotation.filename) != null ? _u : "Document",
|
|
4805
4980
|
filename: (_v = value.annotation.filename) != null ? _v : value.annotation.file_id,
|
|
@@ -4815,7 +4990,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4815
4990
|
controller.enqueue({
|
|
4816
4991
|
type: "source",
|
|
4817
4992
|
sourceType: "document",
|
|
4818
|
-
id: (_y = (_x = (_w = self.config).generateId) == null ? void 0 : _x.call(_w)) != null ? _y : (0,
|
|
4993
|
+
id: (_y = (_x = (_w = self.config).generateId) == null ? void 0 : _x.call(_w)) != null ? _y : (0, import_provider_utils31.generateId)(),
|
|
4819
4994
|
mediaType: "text/plain",
|
|
4820
4995
|
title: (_A = (_z = value.annotation.filename) != null ? _z : value.annotation.file_id) != null ? _A : "Document",
|
|
4821
4996
|
filename: (_B = value.annotation.filename) != null ? _B : value.annotation.file_id,
|
|
@@ -4831,7 +5006,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4831
5006
|
controller.enqueue({
|
|
4832
5007
|
type: "source",
|
|
4833
5008
|
sourceType: "document",
|
|
4834
|
-
id: (_E = (_D = (_C = self.config).generateId) == null ? void 0 : _D.call(_C)) != null ? _E : (0,
|
|
5009
|
+
id: (_E = (_D = (_C = self.config).generateId) == null ? void 0 : _D.call(_C)) != null ? _E : (0, import_provider_utils31.generateId)(),
|
|
4835
5010
|
mediaType: "application/octet-stream",
|
|
4836
5011
|
title: value.annotation.file_id,
|
|
4837
5012
|
filename: value.annotation.file_id,
|
|
@@ -4944,6 +5119,11 @@ function mapWebSearchOutput(action) {
|
|
|
4944
5119
|
OpenAIResponsesLanguageModel,
|
|
4945
5120
|
OpenAISpeechModel,
|
|
4946
5121
|
OpenAITranscriptionModel,
|
|
5122
|
+
applyPatch,
|
|
5123
|
+
applyPatchArgsSchema,
|
|
5124
|
+
applyPatchInputSchema,
|
|
5125
|
+
applyPatchOutputSchema,
|
|
5126
|
+
applyPatchToolFactory,
|
|
4947
5127
|
codeInterpreter,
|
|
4948
5128
|
codeInterpreterArgsSchema,
|
|
4949
5129
|
codeInterpreterInputSchema,
|