@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.mjs
CHANGED
|
@@ -444,12 +444,6 @@ var openaiChatLanguageModelOptions = lazySchema2(
|
|
|
444
444
|
* Parameters for prediction mode.
|
|
445
445
|
*/
|
|
446
446
|
prediction: z3.record(z3.string(), z3.any()).optional(),
|
|
447
|
-
/**
|
|
448
|
-
* Whether to use structured outputs.
|
|
449
|
-
*
|
|
450
|
-
* @default true
|
|
451
|
-
*/
|
|
452
|
-
structuredOutputs: z3.boolean().optional(),
|
|
453
447
|
/**
|
|
454
448
|
* Service tier for the request.
|
|
455
449
|
* - 'auto': Default service tier. The request will be processed with the service tier configured in the
|
|
@@ -464,7 +458,7 @@ var openaiChatLanguageModelOptions = lazySchema2(
|
|
|
464
458
|
/**
|
|
465
459
|
* Whether to use strict JSON schema validation.
|
|
466
460
|
*
|
|
467
|
-
* @default
|
|
461
|
+
* @default true
|
|
468
462
|
*/
|
|
469
463
|
strictJsonSchema: z3.boolean().optional(),
|
|
470
464
|
/**
|
|
@@ -505,7 +499,6 @@ import {
|
|
|
505
499
|
function prepareChatTools({
|
|
506
500
|
tools,
|
|
507
501
|
toolChoice,
|
|
508
|
-
structuredOutputs,
|
|
509
502
|
strictJsonSchema
|
|
510
503
|
}) {
|
|
511
504
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
@@ -523,7 +516,7 @@ function prepareChatTools({
|
|
|
523
516
|
name: tool.name,
|
|
524
517
|
description: tool.description,
|
|
525
518
|
parameters: tool.inputSchema,
|
|
526
|
-
strict:
|
|
519
|
+
strict: strictJsonSchema
|
|
527
520
|
}
|
|
528
521
|
});
|
|
529
522
|
break;
|
|
@@ -592,24 +585,16 @@ var OpenAIChatLanguageModel = class {
|
|
|
592
585
|
toolChoice,
|
|
593
586
|
providerOptions
|
|
594
587
|
}) {
|
|
595
|
-
var _a, _b, _c
|
|
588
|
+
var _a, _b, _c;
|
|
596
589
|
const warnings = [];
|
|
597
590
|
const openaiOptions = (_a = await parseProviderOptions({
|
|
598
591
|
provider: "openai",
|
|
599
592
|
providerOptions,
|
|
600
593
|
schema: openaiChatLanguageModelOptions
|
|
601
594
|
})) != null ? _a : {};
|
|
602
|
-
const structuredOutputs = (_b = openaiOptions.structuredOutputs) != null ? _b : true;
|
|
603
595
|
if (topK != null) {
|
|
604
596
|
warnings.push({ type: "unsupported", feature: "topK" });
|
|
605
597
|
}
|
|
606
|
-
if ((responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !structuredOutputs) {
|
|
607
|
-
warnings.push({
|
|
608
|
-
type: "unsupported",
|
|
609
|
-
feature: "responseFormat",
|
|
610
|
-
details: "JSON response format schema is only supported with structuredOutputs"
|
|
611
|
-
});
|
|
612
|
-
}
|
|
613
598
|
const { messages, warnings: messageWarnings } = convertToOpenAIChatMessages(
|
|
614
599
|
{
|
|
615
600
|
prompt,
|
|
@@ -617,7 +602,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
617
602
|
}
|
|
618
603
|
);
|
|
619
604
|
warnings.push(...messageWarnings);
|
|
620
|
-
const strictJsonSchema = (
|
|
605
|
+
const strictJsonSchema = (_b = openaiOptions.strictJsonSchema) != null ? _b : true;
|
|
621
606
|
const baseArgs = {
|
|
622
607
|
// model id:
|
|
623
608
|
model: this.modelId,
|
|
@@ -633,12 +618,12 @@ var OpenAIChatLanguageModel = class {
|
|
|
633
618
|
top_p: topP,
|
|
634
619
|
frequency_penalty: frequencyPenalty,
|
|
635
620
|
presence_penalty: presencePenalty,
|
|
636
|
-
response_format: (responseFormat == null ? void 0 : responseFormat.type) === "json" ?
|
|
621
|
+
response_format: (responseFormat == null ? void 0 : responseFormat.type) === "json" ? responseFormat.schema != null ? {
|
|
637
622
|
type: "json_schema",
|
|
638
623
|
json_schema: {
|
|
639
624
|
schema: responseFormat.schema,
|
|
640
625
|
strict: strictJsonSchema,
|
|
641
|
-
name: (
|
|
626
|
+
name: (_c = responseFormat.name) != null ? _c : "response",
|
|
642
627
|
description: responseFormat.description
|
|
643
628
|
}
|
|
644
629
|
} : { type: "json_object" } : void 0,
|
|
@@ -752,7 +737,6 @@ var OpenAIChatLanguageModel = class {
|
|
|
752
737
|
} = prepareChatTools({
|
|
753
738
|
tools,
|
|
754
739
|
toolChoice,
|
|
755
|
-
structuredOutputs,
|
|
756
740
|
strictJsonSchema
|
|
757
741
|
});
|
|
758
742
|
return {
|
|
@@ -2144,33 +2128,79 @@ import {
|
|
|
2144
2128
|
parseProviderOptions as parseProviderOptions6,
|
|
2145
2129
|
validateTypes
|
|
2146
2130
|
} from "@ai-sdk/provider-utils";
|
|
2147
|
-
import { z as
|
|
2131
|
+
import { z as z14 } from "zod/v4";
|
|
2148
2132
|
|
|
2149
|
-
// src/tool/
|
|
2133
|
+
// src/tool/apply-patch.ts
|
|
2150
2134
|
import {
|
|
2151
2135
|
createProviderToolFactoryWithOutputSchema,
|
|
2152
2136
|
lazySchema as lazySchema11,
|
|
2153
2137
|
zodSchema as zodSchema11
|
|
2154
2138
|
} from "@ai-sdk/provider-utils";
|
|
2155
2139
|
import { z as z12 } from "zod/v4";
|
|
2156
|
-
var
|
|
2140
|
+
var applyPatchInputSchema = lazySchema11(
|
|
2157
2141
|
() => zodSchema11(
|
|
2158
2142
|
z12.object({
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2143
|
+
callId: z12.string(),
|
|
2144
|
+
operation: z12.discriminatedUnion("type", [
|
|
2145
|
+
z12.object({
|
|
2146
|
+
type: z12.literal("create_file"),
|
|
2147
|
+
path: z12.string(),
|
|
2148
|
+
diff: z12.string()
|
|
2149
|
+
}),
|
|
2150
|
+
z12.object({
|
|
2151
|
+
type: z12.literal("delete_file"),
|
|
2152
|
+
path: z12.string()
|
|
2153
|
+
}),
|
|
2154
|
+
z12.object({
|
|
2155
|
+
type: z12.literal("update_file"),
|
|
2156
|
+
path: z12.string(),
|
|
2157
|
+
diff: z12.string()
|
|
2158
|
+
})
|
|
2159
|
+
])
|
|
2160
|
+
})
|
|
2161
|
+
)
|
|
2162
|
+
);
|
|
2163
|
+
var applyPatchOutputSchema = lazySchema11(
|
|
2164
|
+
() => zodSchema11(
|
|
2165
|
+
z12.object({
|
|
2166
|
+
status: z12.enum(["completed", "failed"]),
|
|
2167
|
+
output: z12.string().optional()
|
|
2168
|
+
})
|
|
2169
|
+
)
|
|
2170
|
+
);
|
|
2171
|
+
var applyPatchArgsSchema = lazySchema11(() => zodSchema11(z12.object({})));
|
|
2172
|
+
var applyPatchToolFactory = createProviderToolFactoryWithOutputSchema({
|
|
2173
|
+
id: "openai.apply_patch",
|
|
2174
|
+
inputSchema: applyPatchInputSchema,
|
|
2175
|
+
outputSchema: applyPatchOutputSchema
|
|
2176
|
+
});
|
|
2177
|
+
var applyPatch = () => applyPatchToolFactory({});
|
|
2178
|
+
|
|
2179
|
+
// src/tool/local-shell.ts
|
|
2180
|
+
import {
|
|
2181
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
|
|
2182
|
+
lazySchema as lazySchema12,
|
|
2183
|
+
zodSchema as zodSchema12
|
|
2184
|
+
} from "@ai-sdk/provider-utils";
|
|
2185
|
+
import { z as z13 } from "zod/v4";
|
|
2186
|
+
var localShellInputSchema = lazySchema12(
|
|
2187
|
+
() => zodSchema12(
|
|
2188
|
+
z13.object({
|
|
2189
|
+
action: z13.object({
|
|
2190
|
+
type: z13.literal("exec"),
|
|
2191
|
+
command: z13.array(z13.string()),
|
|
2192
|
+
timeoutMs: z13.number().optional(),
|
|
2193
|
+
user: z13.string().optional(),
|
|
2194
|
+
workingDirectory: z13.string().optional(),
|
|
2195
|
+
env: z13.record(z13.string(), z13.string()).optional()
|
|
2166
2196
|
})
|
|
2167
2197
|
})
|
|
2168
2198
|
)
|
|
2169
2199
|
);
|
|
2170
|
-
var localShellOutputSchema =
|
|
2171
|
-
() =>
|
|
2200
|
+
var localShellOutputSchema = lazySchema12(
|
|
2201
|
+
() => zodSchema12(z13.object({ output: z13.string() }))
|
|
2172
2202
|
);
|
|
2173
|
-
var localShell =
|
|
2203
|
+
var localShell = createProviderToolFactoryWithOutputSchema2({
|
|
2174
2204
|
id: "openai.local_shell",
|
|
2175
2205
|
inputSchema: localShellInputSchema,
|
|
2176
2206
|
outputSchema: localShellOutputSchema
|
|
@@ -2187,7 +2217,8 @@ async function convertToOpenAIResponsesInput({
|
|
|
2187
2217
|
systemMessageMode,
|
|
2188
2218
|
fileIdPrefixes,
|
|
2189
2219
|
store,
|
|
2190
|
-
hasLocalShellTool = false
|
|
2220
|
+
hasLocalShellTool = false,
|
|
2221
|
+
hasApplyPatchTool = false
|
|
2191
2222
|
}) {
|
|
2192
2223
|
var _a, _b, _c, _d, _e;
|
|
2193
2224
|
const input = [];
|
|
@@ -2410,6 +2441,19 @@ async function convertToOpenAIResponsesInput({
|
|
|
2410
2441
|
});
|
|
2411
2442
|
break;
|
|
2412
2443
|
}
|
|
2444
|
+
if (hasApplyPatchTool && part.toolName === "apply_patch" && output.type === "json") {
|
|
2445
|
+
const parsedOutput = await validateTypes({
|
|
2446
|
+
value: output.value,
|
|
2447
|
+
schema: applyPatchOutputSchema
|
|
2448
|
+
});
|
|
2449
|
+
input.push({
|
|
2450
|
+
type: "apply_patch_call_output",
|
|
2451
|
+
call_id: part.toolCallId,
|
|
2452
|
+
status: parsedOutput.status,
|
|
2453
|
+
output: parsedOutput.output
|
|
2454
|
+
});
|
|
2455
|
+
break;
|
|
2456
|
+
}
|
|
2413
2457
|
let contentValue;
|
|
2414
2458
|
switch (output.type) {
|
|
2415
2459
|
case "text":
|
|
@@ -2470,9 +2514,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
2470
2514
|
}
|
|
2471
2515
|
return { input, warnings };
|
|
2472
2516
|
}
|
|
2473
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
2474
|
-
itemId:
|
|
2475
|
-
reasoningEncryptedContent:
|
|
2517
|
+
var openaiResponsesReasoningProviderOptionsSchema = z14.object({
|
|
2518
|
+
itemId: z14.string().nullish(),
|
|
2519
|
+
reasoningEncryptedContent: z14.string().nullish()
|
|
2476
2520
|
});
|
|
2477
2521
|
|
|
2478
2522
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -2494,349 +2538,393 @@ function mapOpenAIResponseFinishReason({
|
|
|
2494
2538
|
}
|
|
2495
2539
|
|
|
2496
2540
|
// src/responses/openai-responses-api.ts
|
|
2497
|
-
import { lazySchema as
|
|
2498
|
-
import { z as
|
|
2499
|
-
var openaiResponsesChunkSchema =
|
|
2500
|
-
() =>
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
type:
|
|
2504
|
-
item_id:
|
|
2505
|
-
delta:
|
|
2506
|
-
logprobs:
|
|
2507
|
-
|
|
2508
|
-
token:
|
|
2509
|
-
logprob:
|
|
2510
|
-
top_logprobs:
|
|
2511
|
-
|
|
2512
|
-
token:
|
|
2513
|
-
logprob:
|
|
2541
|
+
import { lazySchema as lazySchema13, zodSchema as zodSchema13 } from "@ai-sdk/provider-utils";
|
|
2542
|
+
import { z as z15 } from "zod/v4";
|
|
2543
|
+
var openaiResponsesChunkSchema = lazySchema13(
|
|
2544
|
+
() => zodSchema13(
|
|
2545
|
+
z15.union([
|
|
2546
|
+
z15.object({
|
|
2547
|
+
type: z15.literal("response.output_text.delta"),
|
|
2548
|
+
item_id: z15.string(),
|
|
2549
|
+
delta: z15.string(),
|
|
2550
|
+
logprobs: z15.array(
|
|
2551
|
+
z15.object({
|
|
2552
|
+
token: z15.string(),
|
|
2553
|
+
logprob: z15.number(),
|
|
2554
|
+
top_logprobs: z15.array(
|
|
2555
|
+
z15.object({
|
|
2556
|
+
token: z15.string(),
|
|
2557
|
+
logprob: z15.number()
|
|
2514
2558
|
})
|
|
2515
2559
|
)
|
|
2516
2560
|
})
|
|
2517
2561
|
).nullish()
|
|
2518
2562
|
}),
|
|
2519
|
-
|
|
2520
|
-
type:
|
|
2521
|
-
response:
|
|
2522
|
-
incomplete_details:
|
|
2523
|
-
usage:
|
|
2524
|
-
input_tokens:
|
|
2525
|
-
input_tokens_details:
|
|
2526
|
-
output_tokens:
|
|
2527
|
-
output_tokens_details:
|
|
2563
|
+
z15.object({
|
|
2564
|
+
type: z15.enum(["response.completed", "response.incomplete"]),
|
|
2565
|
+
response: z15.object({
|
|
2566
|
+
incomplete_details: z15.object({ reason: z15.string() }).nullish(),
|
|
2567
|
+
usage: z15.object({
|
|
2568
|
+
input_tokens: z15.number(),
|
|
2569
|
+
input_tokens_details: z15.object({ cached_tokens: z15.number().nullish() }).nullish(),
|
|
2570
|
+
output_tokens: z15.number(),
|
|
2571
|
+
output_tokens_details: z15.object({ reasoning_tokens: z15.number().nullish() }).nullish()
|
|
2528
2572
|
}),
|
|
2529
|
-
service_tier:
|
|
2573
|
+
service_tier: z15.string().nullish()
|
|
2530
2574
|
})
|
|
2531
2575
|
}),
|
|
2532
|
-
|
|
2533
|
-
type:
|
|
2534
|
-
response:
|
|
2535
|
-
id:
|
|
2536
|
-
created_at:
|
|
2537
|
-
model:
|
|
2538
|
-
service_tier:
|
|
2576
|
+
z15.object({
|
|
2577
|
+
type: z15.literal("response.created"),
|
|
2578
|
+
response: z15.object({
|
|
2579
|
+
id: z15.string(),
|
|
2580
|
+
created_at: z15.number(),
|
|
2581
|
+
model: z15.string(),
|
|
2582
|
+
service_tier: z15.string().nullish()
|
|
2539
2583
|
})
|
|
2540
2584
|
}),
|
|
2541
|
-
|
|
2542
|
-
type:
|
|
2543
|
-
output_index:
|
|
2544
|
-
item:
|
|
2545
|
-
|
|
2546
|
-
type:
|
|
2547
|
-
id:
|
|
2585
|
+
z15.object({
|
|
2586
|
+
type: z15.literal("response.output_item.added"),
|
|
2587
|
+
output_index: z15.number(),
|
|
2588
|
+
item: z15.discriminatedUnion("type", [
|
|
2589
|
+
z15.object({
|
|
2590
|
+
type: z15.literal("message"),
|
|
2591
|
+
id: z15.string()
|
|
2548
2592
|
}),
|
|
2549
|
-
|
|
2550
|
-
type:
|
|
2551
|
-
id:
|
|
2552
|
-
encrypted_content:
|
|
2593
|
+
z15.object({
|
|
2594
|
+
type: z15.literal("reasoning"),
|
|
2595
|
+
id: z15.string(),
|
|
2596
|
+
encrypted_content: z15.string().nullish()
|
|
2553
2597
|
}),
|
|
2554
|
-
|
|
2555
|
-
type:
|
|
2556
|
-
id:
|
|
2557
|
-
call_id:
|
|
2558
|
-
name:
|
|
2559
|
-
arguments:
|
|
2598
|
+
z15.object({
|
|
2599
|
+
type: z15.literal("function_call"),
|
|
2600
|
+
id: z15.string(),
|
|
2601
|
+
call_id: z15.string(),
|
|
2602
|
+
name: z15.string(),
|
|
2603
|
+
arguments: z15.string()
|
|
2560
2604
|
}),
|
|
2561
|
-
|
|
2562
|
-
type:
|
|
2563
|
-
id:
|
|
2564
|
-
status:
|
|
2605
|
+
z15.object({
|
|
2606
|
+
type: z15.literal("web_search_call"),
|
|
2607
|
+
id: z15.string(),
|
|
2608
|
+
status: z15.string()
|
|
2565
2609
|
}),
|
|
2566
|
-
|
|
2567
|
-
type:
|
|
2568
|
-
id:
|
|
2569
|
-
status:
|
|
2610
|
+
z15.object({
|
|
2611
|
+
type: z15.literal("computer_call"),
|
|
2612
|
+
id: z15.string(),
|
|
2613
|
+
status: z15.string()
|
|
2570
2614
|
}),
|
|
2571
|
-
|
|
2572
|
-
type:
|
|
2573
|
-
id:
|
|
2615
|
+
z15.object({
|
|
2616
|
+
type: z15.literal("file_search_call"),
|
|
2617
|
+
id: z15.string()
|
|
2574
2618
|
}),
|
|
2575
|
-
|
|
2576
|
-
type:
|
|
2577
|
-
id:
|
|
2619
|
+
z15.object({
|
|
2620
|
+
type: z15.literal("image_generation_call"),
|
|
2621
|
+
id: z15.string()
|
|
2578
2622
|
}),
|
|
2579
|
-
|
|
2580
|
-
type:
|
|
2581
|
-
id:
|
|
2582
|
-
container_id:
|
|
2583
|
-
code:
|
|
2584
|
-
outputs:
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2623
|
+
z15.object({
|
|
2624
|
+
type: z15.literal("code_interpreter_call"),
|
|
2625
|
+
id: z15.string(),
|
|
2626
|
+
container_id: z15.string(),
|
|
2627
|
+
code: z15.string().nullable(),
|
|
2628
|
+
outputs: z15.array(
|
|
2629
|
+
z15.discriminatedUnion("type", [
|
|
2630
|
+
z15.object({ type: z15.literal("logs"), logs: z15.string() }),
|
|
2631
|
+
z15.object({ type: z15.literal("image"), url: z15.string() })
|
|
2588
2632
|
])
|
|
2589
2633
|
).nullable(),
|
|
2590
|
-
status:
|
|
2634
|
+
status: z15.string()
|
|
2635
|
+
}),
|
|
2636
|
+
z15.object({
|
|
2637
|
+
type: z15.literal("mcp_call"),
|
|
2638
|
+
id: z15.string(),
|
|
2639
|
+
status: z15.string()
|
|
2591
2640
|
}),
|
|
2592
|
-
|
|
2593
|
-
type:
|
|
2594
|
-
id:
|
|
2595
|
-
status: z14.string()
|
|
2641
|
+
z15.object({
|
|
2642
|
+
type: z15.literal("mcp_list_tools"),
|
|
2643
|
+
id: z15.string()
|
|
2596
2644
|
}),
|
|
2597
|
-
|
|
2598
|
-
type:
|
|
2599
|
-
id:
|
|
2645
|
+
z15.object({
|
|
2646
|
+
type: z15.literal("mcp_approval_request"),
|
|
2647
|
+
id: z15.string()
|
|
2600
2648
|
}),
|
|
2601
|
-
|
|
2602
|
-
type:
|
|
2603
|
-
id:
|
|
2649
|
+
z15.object({
|
|
2650
|
+
type: z15.literal("apply_patch_call"),
|
|
2651
|
+
id: z15.string(),
|
|
2652
|
+
call_id: z15.string(),
|
|
2653
|
+
status: z15.enum(["in_progress", "completed"]),
|
|
2654
|
+
operation: z15.discriminatedUnion("type", [
|
|
2655
|
+
z15.object({
|
|
2656
|
+
type: z15.literal("create_file"),
|
|
2657
|
+
path: z15.string(),
|
|
2658
|
+
diff: z15.string()
|
|
2659
|
+
}),
|
|
2660
|
+
z15.object({
|
|
2661
|
+
type: z15.literal("delete_file"),
|
|
2662
|
+
path: z15.string()
|
|
2663
|
+
}),
|
|
2664
|
+
z15.object({
|
|
2665
|
+
type: z15.literal("update_file"),
|
|
2666
|
+
path: z15.string(),
|
|
2667
|
+
diff: z15.string()
|
|
2668
|
+
})
|
|
2669
|
+
])
|
|
2604
2670
|
})
|
|
2605
2671
|
])
|
|
2606
2672
|
}),
|
|
2607
|
-
|
|
2608
|
-
type:
|
|
2609
|
-
output_index:
|
|
2610
|
-
item:
|
|
2611
|
-
|
|
2612
|
-
type:
|
|
2613
|
-
id:
|
|
2673
|
+
z15.object({
|
|
2674
|
+
type: z15.literal("response.output_item.done"),
|
|
2675
|
+
output_index: z15.number(),
|
|
2676
|
+
item: z15.discriminatedUnion("type", [
|
|
2677
|
+
z15.object({
|
|
2678
|
+
type: z15.literal("message"),
|
|
2679
|
+
id: z15.string()
|
|
2614
2680
|
}),
|
|
2615
|
-
|
|
2616
|
-
type:
|
|
2617
|
-
id:
|
|
2618
|
-
encrypted_content:
|
|
2681
|
+
z15.object({
|
|
2682
|
+
type: z15.literal("reasoning"),
|
|
2683
|
+
id: z15.string(),
|
|
2684
|
+
encrypted_content: z15.string().nullish()
|
|
2619
2685
|
}),
|
|
2620
|
-
|
|
2621
|
-
type:
|
|
2622
|
-
id:
|
|
2623
|
-
call_id:
|
|
2624
|
-
name:
|
|
2625
|
-
arguments:
|
|
2626
|
-
status:
|
|
2686
|
+
z15.object({
|
|
2687
|
+
type: z15.literal("function_call"),
|
|
2688
|
+
id: z15.string(),
|
|
2689
|
+
call_id: z15.string(),
|
|
2690
|
+
name: z15.string(),
|
|
2691
|
+
arguments: z15.string(),
|
|
2692
|
+
status: z15.literal("completed")
|
|
2627
2693
|
}),
|
|
2628
|
-
|
|
2629
|
-
type:
|
|
2630
|
-
id:
|
|
2631
|
-
code:
|
|
2632
|
-
container_id:
|
|
2633
|
-
outputs:
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2694
|
+
z15.object({
|
|
2695
|
+
type: z15.literal("code_interpreter_call"),
|
|
2696
|
+
id: z15.string(),
|
|
2697
|
+
code: z15.string().nullable(),
|
|
2698
|
+
container_id: z15.string(),
|
|
2699
|
+
outputs: z15.array(
|
|
2700
|
+
z15.discriminatedUnion("type", [
|
|
2701
|
+
z15.object({ type: z15.literal("logs"), logs: z15.string() }),
|
|
2702
|
+
z15.object({ type: z15.literal("image"), url: z15.string() })
|
|
2637
2703
|
])
|
|
2638
2704
|
).nullable()
|
|
2639
2705
|
}),
|
|
2640
|
-
|
|
2641
|
-
type:
|
|
2642
|
-
id:
|
|
2643
|
-
result:
|
|
2706
|
+
z15.object({
|
|
2707
|
+
type: z15.literal("image_generation_call"),
|
|
2708
|
+
id: z15.string(),
|
|
2709
|
+
result: z15.string()
|
|
2644
2710
|
}),
|
|
2645
|
-
|
|
2646
|
-
type:
|
|
2647
|
-
id:
|
|
2648
|
-
status:
|
|
2649
|
-
action:
|
|
2650
|
-
|
|
2651
|
-
type:
|
|
2652
|
-
query:
|
|
2653
|
-
sources:
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2711
|
+
z15.object({
|
|
2712
|
+
type: z15.literal("web_search_call"),
|
|
2713
|
+
id: z15.string(),
|
|
2714
|
+
status: z15.string(),
|
|
2715
|
+
action: z15.discriminatedUnion("type", [
|
|
2716
|
+
z15.object({
|
|
2717
|
+
type: z15.literal("search"),
|
|
2718
|
+
query: z15.string().nullish(),
|
|
2719
|
+
sources: z15.array(
|
|
2720
|
+
z15.discriminatedUnion("type", [
|
|
2721
|
+
z15.object({ type: z15.literal("url"), url: z15.string() }),
|
|
2722
|
+
z15.object({ type: z15.literal("api"), name: z15.string() })
|
|
2657
2723
|
])
|
|
2658
2724
|
).nullish()
|
|
2659
2725
|
}),
|
|
2660
|
-
|
|
2661
|
-
type:
|
|
2662
|
-
url:
|
|
2726
|
+
z15.object({
|
|
2727
|
+
type: z15.literal("open_page"),
|
|
2728
|
+
url: z15.string()
|
|
2663
2729
|
}),
|
|
2664
|
-
|
|
2665
|
-
type:
|
|
2666
|
-
url:
|
|
2667
|
-
pattern:
|
|
2730
|
+
z15.object({
|
|
2731
|
+
type: z15.literal("find"),
|
|
2732
|
+
url: z15.string(),
|
|
2733
|
+
pattern: z15.string()
|
|
2668
2734
|
})
|
|
2669
2735
|
])
|
|
2670
2736
|
}),
|
|
2671
|
-
|
|
2672
|
-
type:
|
|
2673
|
-
id:
|
|
2674
|
-
queries:
|
|
2675
|
-
results:
|
|
2676
|
-
|
|
2677
|
-
attributes:
|
|
2678
|
-
|
|
2679
|
-
|
|
2737
|
+
z15.object({
|
|
2738
|
+
type: z15.literal("file_search_call"),
|
|
2739
|
+
id: z15.string(),
|
|
2740
|
+
queries: z15.array(z15.string()),
|
|
2741
|
+
results: z15.array(
|
|
2742
|
+
z15.object({
|
|
2743
|
+
attributes: z15.record(
|
|
2744
|
+
z15.string(),
|
|
2745
|
+
z15.union([z15.string(), z15.number(), z15.boolean()])
|
|
2680
2746
|
),
|
|
2681
|
-
file_id:
|
|
2682
|
-
filename:
|
|
2683
|
-
score:
|
|
2684
|
-
text:
|
|
2747
|
+
file_id: z15.string(),
|
|
2748
|
+
filename: z15.string(),
|
|
2749
|
+
score: z15.number(),
|
|
2750
|
+
text: z15.string()
|
|
2685
2751
|
})
|
|
2686
2752
|
).nullish()
|
|
2687
2753
|
}),
|
|
2688
|
-
|
|
2689
|
-
type:
|
|
2690
|
-
id:
|
|
2691
|
-
call_id:
|
|
2692
|
-
action:
|
|
2693
|
-
type:
|
|
2694
|
-
command:
|
|
2695
|
-
timeout_ms:
|
|
2696
|
-
user:
|
|
2697
|
-
working_directory:
|
|
2698
|
-
env:
|
|
2754
|
+
z15.object({
|
|
2755
|
+
type: z15.literal("local_shell_call"),
|
|
2756
|
+
id: z15.string(),
|
|
2757
|
+
call_id: z15.string(),
|
|
2758
|
+
action: z15.object({
|
|
2759
|
+
type: z15.literal("exec"),
|
|
2760
|
+
command: z15.array(z15.string()),
|
|
2761
|
+
timeout_ms: z15.number().optional(),
|
|
2762
|
+
user: z15.string().optional(),
|
|
2763
|
+
working_directory: z15.string().optional(),
|
|
2764
|
+
env: z15.record(z15.string(), z15.string()).optional()
|
|
2699
2765
|
})
|
|
2700
2766
|
}),
|
|
2701
|
-
|
|
2702
|
-
type:
|
|
2703
|
-
id:
|
|
2704
|
-
status:
|
|
2767
|
+
z15.object({
|
|
2768
|
+
type: z15.literal("computer_call"),
|
|
2769
|
+
id: z15.string(),
|
|
2770
|
+
status: z15.literal("completed")
|
|
2705
2771
|
}),
|
|
2706
|
-
|
|
2707
|
-
type:
|
|
2708
|
-
id:
|
|
2709
|
-
status:
|
|
2710
|
-
arguments:
|
|
2711
|
-
name:
|
|
2712
|
-
server_label:
|
|
2713
|
-
output:
|
|
2714
|
-
error:
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
type:
|
|
2718
|
-
code:
|
|
2719
|
-
message:
|
|
2772
|
+
z15.object({
|
|
2773
|
+
type: z15.literal("mcp_call"),
|
|
2774
|
+
id: z15.string(),
|
|
2775
|
+
status: z15.string(),
|
|
2776
|
+
arguments: z15.string(),
|
|
2777
|
+
name: z15.string(),
|
|
2778
|
+
server_label: z15.string(),
|
|
2779
|
+
output: z15.string().nullish(),
|
|
2780
|
+
error: z15.union([
|
|
2781
|
+
z15.string(),
|
|
2782
|
+
z15.object({
|
|
2783
|
+
type: z15.string().optional(),
|
|
2784
|
+
code: z15.union([z15.number(), z15.string()]).optional(),
|
|
2785
|
+
message: z15.string().optional()
|
|
2720
2786
|
}).loose()
|
|
2721
2787
|
]).nullish()
|
|
2722
2788
|
}),
|
|
2723
|
-
|
|
2724
|
-
type:
|
|
2725
|
-
id:
|
|
2726
|
-
server_label:
|
|
2727
|
-
tools:
|
|
2728
|
-
|
|
2729
|
-
name:
|
|
2730
|
-
description:
|
|
2731
|
-
input_schema:
|
|
2732
|
-
annotations:
|
|
2789
|
+
z15.object({
|
|
2790
|
+
type: z15.literal("mcp_list_tools"),
|
|
2791
|
+
id: z15.string(),
|
|
2792
|
+
server_label: z15.string(),
|
|
2793
|
+
tools: z15.array(
|
|
2794
|
+
z15.object({
|
|
2795
|
+
name: z15.string(),
|
|
2796
|
+
description: z15.string().optional(),
|
|
2797
|
+
input_schema: z15.any(),
|
|
2798
|
+
annotations: z15.record(z15.string(), z15.unknown()).optional()
|
|
2733
2799
|
})
|
|
2734
2800
|
),
|
|
2735
|
-
error:
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
type:
|
|
2739
|
-
code:
|
|
2740
|
-
message:
|
|
2801
|
+
error: z15.union([
|
|
2802
|
+
z15.string(),
|
|
2803
|
+
z15.object({
|
|
2804
|
+
type: z15.string().optional(),
|
|
2805
|
+
code: z15.union([z15.number(), z15.string()]).optional(),
|
|
2806
|
+
message: z15.string().optional()
|
|
2741
2807
|
}).loose()
|
|
2742
2808
|
]).optional()
|
|
2743
2809
|
}),
|
|
2744
|
-
|
|
2745
|
-
type:
|
|
2746
|
-
id:
|
|
2747
|
-
server_label:
|
|
2748
|
-
name:
|
|
2749
|
-
arguments:
|
|
2750
|
-
approval_request_id:
|
|
2810
|
+
z15.object({
|
|
2811
|
+
type: z15.literal("mcp_approval_request"),
|
|
2812
|
+
id: z15.string(),
|
|
2813
|
+
server_label: z15.string(),
|
|
2814
|
+
name: z15.string(),
|
|
2815
|
+
arguments: z15.string(),
|
|
2816
|
+
approval_request_id: z15.string()
|
|
2817
|
+
}),
|
|
2818
|
+
z15.object({
|
|
2819
|
+
type: z15.literal("apply_patch_call"),
|
|
2820
|
+
id: z15.string(),
|
|
2821
|
+
call_id: z15.string(),
|
|
2822
|
+
status: z15.enum(["in_progress", "completed"]),
|
|
2823
|
+
operation: z15.discriminatedUnion("type", [
|
|
2824
|
+
z15.object({
|
|
2825
|
+
type: z15.literal("create_file"),
|
|
2826
|
+
path: z15.string(),
|
|
2827
|
+
diff: z15.string()
|
|
2828
|
+
}),
|
|
2829
|
+
z15.object({
|
|
2830
|
+
type: z15.literal("delete_file"),
|
|
2831
|
+
path: z15.string()
|
|
2832
|
+
}),
|
|
2833
|
+
z15.object({
|
|
2834
|
+
type: z15.literal("update_file"),
|
|
2835
|
+
path: z15.string(),
|
|
2836
|
+
diff: z15.string()
|
|
2837
|
+
})
|
|
2838
|
+
])
|
|
2751
2839
|
})
|
|
2752
2840
|
])
|
|
2753
2841
|
}),
|
|
2754
|
-
|
|
2755
|
-
type:
|
|
2756
|
-
item_id:
|
|
2757
|
-
output_index:
|
|
2758
|
-
delta:
|
|
2842
|
+
z15.object({
|
|
2843
|
+
type: z15.literal("response.function_call_arguments.delta"),
|
|
2844
|
+
item_id: z15.string(),
|
|
2845
|
+
output_index: z15.number(),
|
|
2846
|
+
delta: z15.string()
|
|
2759
2847
|
}),
|
|
2760
|
-
|
|
2761
|
-
type:
|
|
2762
|
-
item_id:
|
|
2763
|
-
output_index:
|
|
2764
|
-
partial_image_b64:
|
|
2848
|
+
z15.object({
|
|
2849
|
+
type: z15.literal("response.image_generation_call.partial_image"),
|
|
2850
|
+
item_id: z15.string(),
|
|
2851
|
+
output_index: z15.number(),
|
|
2852
|
+
partial_image_b64: z15.string()
|
|
2765
2853
|
}),
|
|
2766
|
-
|
|
2767
|
-
type:
|
|
2768
|
-
item_id:
|
|
2769
|
-
output_index:
|
|
2770
|
-
delta:
|
|
2854
|
+
z15.object({
|
|
2855
|
+
type: z15.literal("response.code_interpreter_call_code.delta"),
|
|
2856
|
+
item_id: z15.string(),
|
|
2857
|
+
output_index: z15.number(),
|
|
2858
|
+
delta: z15.string()
|
|
2771
2859
|
}),
|
|
2772
|
-
|
|
2773
|
-
type:
|
|
2774
|
-
item_id:
|
|
2775
|
-
output_index:
|
|
2776
|
-
code:
|
|
2860
|
+
z15.object({
|
|
2861
|
+
type: z15.literal("response.code_interpreter_call_code.done"),
|
|
2862
|
+
item_id: z15.string(),
|
|
2863
|
+
output_index: z15.number(),
|
|
2864
|
+
code: z15.string()
|
|
2777
2865
|
}),
|
|
2778
|
-
|
|
2779
|
-
type:
|
|
2780
|
-
annotation:
|
|
2781
|
-
|
|
2782
|
-
type:
|
|
2783
|
-
start_index:
|
|
2784
|
-
end_index:
|
|
2785
|
-
url:
|
|
2786
|
-
title:
|
|
2866
|
+
z15.object({
|
|
2867
|
+
type: z15.literal("response.output_text.annotation.added"),
|
|
2868
|
+
annotation: z15.discriminatedUnion("type", [
|
|
2869
|
+
z15.object({
|
|
2870
|
+
type: z15.literal("url_citation"),
|
|
2871
|
+
start_index: z15.number(),
|
|
2872
|
+
end_index: z15.number(),
|
|
2873
|
+
url: z15.string(),
|
|
2874
|
+
title: z15.string()
|
|
2787
2875
|
}),
|
|
2788
|
-
|
|
2789
|
-
type:
|
|
2790
|
-
file_id:
|
|
2791
|
-
filename:
|
|
2792
|
-
index:
|
|
2793
|
-
start_index:
|
|
2794
|
-
end_index:
|
|
2795
|
-
quote:
|
|
2876
|
+
z15.object({
|
|
2877
|
+
type: z15.literal("file_citation"),
|
|
2878
|
+
file_id: z15.string(),
|
|
2879
|
+
filename: z15.string().nullish(),
|
|
2880
|
+
index: z15.number().nullish(),
|
|
2881
|
+
start_index: z15.number().nullish(),
|
|
2882
|
+
end_index: z15.number().nullish(),
|
|
2883
|
+
quote: z15.string().nullish()
|
|
2796
2884
|
}),
|
|
2797
|
-
|
|
2798
|
-
type:
|
|
2799
|
-
container_id:
|
|
2800
|
-
file_id:
|
|
2801
|
-
filename:
|
|
2802
|
-
start_index:
|
|
2803
|
-
end_index:
|
|
2804
|
-
index:
|
|
2885
|
+
z15.object({
|
|
2886
|
+
type: z15.literal("container_file_citation"),
|
|
2887
|
+
container_id: z15.string(),
|
|
2888
|
+
file_id: z15.string(),
|
|
2889
|
+
filename: z15.string().nullish(),
|
|
2890
|
+
start_index: z15.number().nullish(),
|
|
2891
|
+
end_index: z15.number().nullish(),
|
|
2892
|
+
index: z15.number().nullish()
|
|
2805
2893
|
}),
|
|
2806
|
-
|
|
2807
|
-
type:
|
|
2808
|
-
file_id:
|
|
2809
|
-
index:
|
|
2894
|
+
z15.object({
|
|
2895
|
+
type: z15.literal("file_path"),
|
|
2896
|
+
file_id: z15.string(),
|
|
2897
|
+
index: z15.number().nullish()
|
|
2810
2898
|
})
|
|
2811
2899
|
])
|
|
2812
2900
|
}),
|
|
2813
|
-
|
|
2814
|
-
type:
|
|
2815
|
-
item_id:
|
|
2816
|
-
summary_index:
|
|
2901
|
+
z15.object({
|
|
2902
|
+
type: z15.literal("response.reasoning_summary_part.added"),
|
|
2903
|
+
item_id: z15.string(),
|
|
2904
|
+
summary_index: z15.number()
|
|
2817
2905
|
}),
|
|
2818
|
-
|
|
2819
|
-
type:
|
|
2820
|
-
item_id:
|
|
2821
|
-
summary_index:
|
|
2822
|
-
delta:
|
|
2906
|
+
z15.object({
|
|
2907
|
+
type: z15.literal("response.reasoning_summary_text.delta"),
|
|
2908
|
+
item_id: z15.string(),
|
|
2909
|
+
summary_index: z15.number(),
|
|
2910
|
+
delta: z15.string()
|
|
2823
2911
|
}),
|
|
2824
|
-
|
|
2825
|
-
type:
|
|
2826
|
-
item_id:
|
|
2827
|
-
summary_index:
|
|
2912
|
+
z15.object({
|
|
2913
|
+
type: z15.literal("response.reasoning_summary_part.done"),
|
|
2914
|
+
item_id: z15.string(),
|
|
2915
|
+
summary_index: z15.number()
|
|
2828
2916
|
}),
|
|
2829
|
-
|
|
2830
|
-
type:
|
|
2831
|
-
sequence_number:
|
|
2832
|
-
error:
|
|
2833
|
-
type:
|
|
2834
|
-
code:
|
|
2835
|
-
message:
|
|
2836
|
-
param:
|
|
2917
|
+
z15.object({
|
|
2918
|
+
type: z15.literal("error"),
|
|
2919
|
+
sequence_number: z15.number(),
|
|
2920
|
+
error: z15.object({
|
|
2921
|
+
type: z15.string(),
|
|
2922
|
+
code: z15.string(),
|
|
2923
|
+
message: z15.string(),
|
|
2924
|
+
param: z15.string().nullish()
|
|
2837
2925
|
})
|
|
2838
2926
|
}),
|
|
2839
|
-
|
|
2927
|
+
z15.object({ type: z15.string() }).loose().transform((value) => ({
|
|
2840
2928
|
type: "unknown_chunk",
|
|
2841
2929
|
message: value.type
|
|
2842
2930
|
}))
|
|
@@ -2844,236 +2932,258 @@ var openaiResponsesChunkSchema = lazySchema12(
|
|
|
2844
2932
|
])
|
|
2845
2933
|
)
|
|
2846
2934
|
);
|
|
2847
|
-
var openaiResponsesResponseSchema =
|
|
2848
|
-
() =>
|
|
2849
|
-
|
|
2850
|
-
id:
|
|
2851
|
-
created_at:
|
|
2852
|
-
error:
|
|
2853
|
-
message:
|
|
2854
|
-
type:
|
|
2855
|
-
param:
|
|
2856
|
-
code:
|
|
2935
|
+
var openaiResponsesResponseSchema = lazySchema13(
|
|
2936
|
+
() => zodSchema13(
|
|
2937
|
+
z15.object({
|
|
2938
|
+
id: z15.string().optional(),
|
|
2939
|
+
created_at: z15.number().optional(),
|
|
2940
|
+
error: z15.object({
|
|
2941
|
+
message: z15.string(),
|
|
2942
|
+
type: z15.string(),
|
|
2943
|
+
param: z15.string().nullish(),
|
|
2944
|
+
code: z15.string()
|
|
2857
2945
|
}).nullish(),
|
|
2858
|
-
model:
|
|
2859
|
-
output:
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
type:
|
|
2863
|
-
role:
|
|
2864
|
-
id:
|
|
2865
|
-
content:
|
|
2866
|
-
|
|
2867
|
-
type:
|
|
2868
|
-
text:
|
|
2869
|
-
logprobs:
|
|
2870
|
-
|
|
2871
|
-
token:
|
|
2872
|
-
logprob:
|
|
2873
|
-
top_logprobs:
|
|
2874
|
-
|
|
2875
|
-
token:
|
|
2876
|
-
logprob:
|
|
2946
|
+
model: z15.string().optional(),
|
|
2947
|
+
output: z15.array(
|
|
2948
|
+
z15.discriminatedUnion("type", [
|
|
2949
|
+
z15.object({
|
|
2950
|
+
type: z15.literal("message"),
|
|
2951
|
+
role: z15.literal("assistant"),
|
|
2952
|
+
id: z15.string(),
|
|
2953
|
+
content: z15.array(
|
|
2954
|
+
z15.object({
|
|
2955
|
+
type: z15.literal("output_text"),
|
|
2956
|
+
text: z15.string(),
|
|
2957
|
+
logprobs: z15.array(
|
|
2958
|
+
z15.object({
|
|
2959
|
+
token: z15.string(),
|
|
2960
|
+
logprob: z15.number(),
|
|
2961
|
+
top_logprobs: z15.array(
|
|
2962
|
+
z15.object({
|
|
2963
|
+
token: z15.string(),
|
|
2964
|
+
logprob: z15.number()
|
|
2877
2965
|
})
|
|
2878
2966
|
)
|
|
2879
2967
|
})
|
|
2880
2968
|
).nullish(),
|
|
2881
|
-
annotations:
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
type:
|
|
2885
|
-
start_index:
|
|
2886
|
-
end_index:
|
|
2887
|
-
url:
|
|
2888
|
-
title:
|
|
2969
|
+
annotations: z15.array(
|
|
2970
|
+
z15.discriminatedUnion("type", [
|
|
2971
|
+
z15.object({
|
|
2972
|
+
type: z15.literal("url_citation"),
|
|
2973
|
+
start_index: z15.number(),
|
|
2974
|
+
end_index: z15.number(),
|
|
2975
|
+
url: z15.string(),
|
|
2976
|
+
title: z15.string()
|
|
2889
2977
|
}),
|
|
2890
|
-
|
|
2891
|
-
type:
|
|
2892
|
-
file_id:
|
|
2893
|
-
filename:
|
|
2894
|
-
index:
|
|
2895
|
-
start_index:
|
|
2896
|
-
end_index:
|
|
2897
|
-
quote:
|
|
2978
|
+
z15.object({
|
|
2979
|
+
type: z15.literal("file_citation"),
|
|
2980
|
+
file_id: z15.string(),
|
|
2981
|
+
filename: z15.string().nullish(),
|
|
2982
|
+
index: z15.number().nullish(),
|
|
2983
|
+
start_index: z15.number().nullish(),
|
|
2984
|
+
end_index: z15.number().nullish(),
|
|
2985
|
+
quote: z15.string().nullish()
|
|
2898
2986
|
}),
|
|
2899
|
-
|
|
2900
|
-
type:
|
|
2901
|
-
container_id:
|
|
2902
|
-
file_id:
|
|
2903
|
-
filename:
|
|
2904
|
-
start_index:
|
|
2905
|
-
end_index:
|
|
2906
|
-
index:
|
|
2987
|
+
z15.object({
|
|
2988
|
+
type: z15.literal("container_file_citation"),
|
|
2989
|
+
container_id: z15.string(),
|
|
2990
|
+
file_id: z15.string(),
|
|
2991
|
+
filename: z15.string().nullish(),
|
|
2992
|
+
start_index: z15.number().nullish(),
|
|
2993
|
+
end_index: z15.number().nullish(),
|
|
2994
|
+
index: z15.number().nullish()
|
|
2907
2995
|
}),
|
|
2908
|
-
|
|
2909
|
-
type:
|
|
2910
|
-
file_id:
|
|
2911
|
-
index:
|
|
2996
|
+
z15.object({
|
|
2997
|
+
type: z15.literal("file_path"),
|
|
2998
|
+
file_id: z15.string(),
|
|
2999
|
+
index: z15.number().nullish()
|
|
2912
3000
|
})
|
|
2913
3001
|
])
|
|
2914
3002
|
)
|
|
2915
3003
|
})
|
|
2916
3004
|
)
|
|
2917
3005
|
}),
|
|
2918
|
-
|
|
2919
|
-
type:
|
|
2920
|
-
id:
|
|
2921
|
-
status:
|
|
2922
|
-
action:
|
|
2923
|
-
|
|
2924
|
-
type:
|
|
2925
|
-
query:
|
|
2926
|
-
sources:
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
3006
|
+
z15.object({
|
|
3007
|
+
type: z15.literal("web_search_call"),
|
|
3008
|
+
id: z15.string(),
|
|
3009
|
+
status: z15.string(),
|
|
3010
|
+
action: z15.discriminatedUnion("type", [
|
|
3011
|
+
z15.object({
|
|
3012
|
+
type: z15.literal("search"),
|
|
3013
|
+
query: z15.string().nullish(),
|
|
3014
|
+
sources: z15.array(
|
|
3015
|
+
z15.discriminatedUnion("type", [
|
|
3016
|
+
z15.object({ type: z15.literal("url"), url: z15.string() }),
|
|
3017
|
+
z15.object({ type: z15.literal("api"), name: z15.string() })
|
|
2930
3018
|
])
|
|
2931
3019
|
).nullish()
|
|
2932
3020
|
}),
|
|
2933
|
-
|
|
2934
|
-
type:
|
|
2935
|
-
url:
|
|
3021
|
+
z15.object({
|
|
3022
|
+
type: z15.literal("open_page"),
|
|
3023
|
+
url: z15.string()
|
|
2936
3024
|
}),
|
|
2937
|
-
|
|
2938
|
-
type:
|
|
2939
|
-
url:
|
|
2940
|
-
pattern:
|
|
3025
|
+
z15.object({
|
|
3026
|
+
type: z15.literal("find"),
|
|
3027
|
+
url: z15.string(),
|
|
3028
|
+
pattern: z15.string()
|
|
2941
3029
|
})
|
|
2942
3030
|
])
|
|
2943
3031
|
}),
|
|
2944
|
-
|
|
2945
|
-
type:
|
|
2946
|
-
id:
|
|
2947
|
-
queries:
|
|
2948
|
-
results:
|
|
2949
|
-
|
|
2950
|
-
attributes:
|
|
2951
|
-
|
|
2952
|
-
|
|
3032
|
+
z15.object({
|
|
3033
|
+
type: z15.literal("file_search_call"),
|
|
3034
|
+
id: z15.string(),
|
|
3035
|
+
queries: z15.array(z15.string()),
|
|
3036
|
+
results: z15.array(
|
|
3037
|
+
z15.object({
|
|
3038
|
+
attributes: z15.record(
|
|
3039
|
+
z15.string(),
|
|
3040
|
+
z15.union([z15.string(), z15.number(), z15.boolean()])
|
|
2953
3041
|
),
|
|
2954
|
-
file_id:
|
|
2955
|
-
filename:
|
|
2956
|
-
score:
|
|
2957
|
-
text:
|
|
3042
|
+
file_id: z15.string(),
|
|
3043
|
+
filename: z15.string(),
|
|
3044
|
+
score: z15.number(),
|
|
3045
|
+
text: z15.string()
|
|
2958
3046
|
})
|
|
2959
3047
|
).nullish()
|
|
2960
3048
|
}),
|
|
2961
|
-
|
|
2962
|
-
type:
|
|
2963
|
-
id:
|
|
2964
|
-
code:
|
|
2965
|
-
container_id:
|
|
2966
|
-
outputs:
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
3049
|
+
z15.object({
|
|
3050
|
+
type: z15.literal("code_interpreter_call"),
|
|
3051
|
+
id: z15.string(),
|
|
3052
|
+
code: z15.string().nullable(),
|
|
3053
|
+
container_id: z15.string(),
|
|
3054
|
+
outputs: z15.array(
|
|
3055
|
+
z15.discriminatedUnion("type", [
|
|
3056
|
+
z15.object({ type: z15.literal("logs"), logs: z15.string() }),
|
|
3057
|
+
z15.object({ type: z15.literal("image"), url: z15.string() })
|
|
2970
3058
|
])
|
|
2971
3059
|
).nullable()
|
|
2972
3060
|
}),
|
|
2973
|
-
|
|
2974
|
-
type:
|
|
2975
|
-
id:
|
|
2976
|
-
result:
|
|
3061
|
+
z15.object({
|
|
3062
|
+
type: z15.literal("image_generation_call"),
|
|
3063
|
+
id: z15.string(),
|
|
3064
|
+
result: z15.string()
|
|
2977
3065
|
}),
|
|
2978
|
-
|
|
2979
|
-
type:
|
|
2980
|
-
id:
|
|
2981
|
-
call_id:
|
|
2982
|
-
action:
|
|
2983
|
-
type:
|
|
2984
|
-
command:
|
|
2985
|
-
timeout_ms:
|
|
2986
|
-
user:
|
|
2987
|
-
working_directory:
|
|
2988
|
-
env:
|
|
3066
|
+
z15.object({
|
|
3067
|
+
type: z15.literal("local_shell_call"),
|
|
3068
|
+
id: z15.string(),
|
|
3069
|
+
call_id: z15.string(),
|
|
3070
|
+
action: z15.object({
|
|
3071
|
+
type: z15.literal("exec"),
|
|
3072
|
+
command: z15.array(z15.string()),
|
|
3073
|
+
timeout_ms: z15.number().optional(),
|
|
3074
|
+
user: z15.string().optional(),
|
|
3075
|
+
working_directory: z15.string().optional(),
|
|
3076
|
+
env: z15.record(z15.string(), z15.string()).optional()
|
|
2989
3077
|
})
|
|
2990
3078
|
}),
|
|
2991
|
-
|
|
2992
|
-
type:
|
|
2993
|
-
call_id:
|
|
2994
|
-
name:
|
|
2995
|
-
arguments:
|
|
2996
|
-
id:
|
|
3079
|
+
z15.object({
|
|
3080
|
+
type: z15.literal("function_call"),
|
|
3081
|
+
call_id: z15.string(),
|
|
3082
|
+
name: z15.string(),
|
|
3083
|
+
arguments: z15.string(),
|
|
3084
|
+
id: z15.string()
|
|
2997
3085
|
}),
|
|
2998
|
-
|
|
2999
|
-
type:
|
|
3000
|
-
id:
|
|
3001
|
-
status:
|
|
3086
|
+
z15.object({
|
|
3087
|
+
type: z15.literal("computer_call"),
|
|
3088
|
+
id: z15.string(),
|
|
3089
|
+
status: z15.string().optional()
|
|
3002
3090
|
}),
|
|
3003
|
-
|
|
3004
|
-
type:
|
|
3005
|
-
id:
|
|
3006
|
-
encrypted_content:
|
|
3007
|
-
summary:
|
|
3008
|
-
|
|
3009
|
-
type:
|
|
3010
|
-
text:
|
|
3091
|
+
z15.object({
|
|
3092
|
+
type: z15.literal("reasoning"),
|
|
3093
|
+
id: z15.string(),
|
|
3094
|
+
encrypted_content: z15.string().nullish(),
|
|
3095
|
+
summary: z15.array(
|
|
3096
|
+
z15.object({
|
|
3097
|
+
type: z15.literal("summary_text"),
|
|
3098
|
+
text: z15.string()
|
|
3011
3099
|
})
|
|
3012
3100
|
)
|
|
3013
3101
|
}),
|
|
3014
|
-
|
|
3015
|
-
type:
|
|
3016
|
-
id:
|
|
3017
|
-
status:
|
|
3018
|
-
arguments:
|
|
3019
|
-
name:
|
|
3020
|
-
server_label:
|
|
3021
|
-
output:
|
|
3022
|
-
error:
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
type:
|
|
3026
|
-
code:
|
|
3027
|
-
message:
|
|
3102
|
+
z15.object({
|
|
3103
|
+
type: z15.literal("mcp_call"),
|
|
3104
|
+
id: z15.string(),
|
|
3105
|
+
status: z15.string(),
|
|
3106
|
+
arguments: z15.string(),
|
|
3107
|
+
name: z15.string(),
|
|
3108
|
+
server_label: z15.string(),
|
|
3109
|
+
output: z15.string().nullish(),
|
|
3110
|
+
error: z15.union([
|
|
3111
|
+
z15.string(),
|
|
3112
|
+
z15.object({
|
|
3113
|
+
type: z15.string().optional(),
|
|
3114
|
+
code: z15.union([z15.number(), z15.string()]).optional(),
|
|
3115
|
+
message: z15.string().optional()
|
|
3028
3116
|
}).loose()
|
|
3029
3117
|
]).nullish()
|
|
3030
3118
|
}),
|
|
3031
|
-
|
|
3032
|
-
type:
|
|
3033
|
-
id:
|
|
3034
|
-
server_label:
|
|
3035
|
-
tools:
|
|
3036
|
-
|
|
3037
|
-
name:
|
|
3038
|
-
description:
|
|
3039
|
-
input_schema:
|
|
3040
|
-
annotations:
|
|
3119
|
+
z15.object({
|
|
3120
|
+
type: z15.literal("mcp_list_tools"),
|
|
3121
|
+
id: z15.string(),
|
|
3122
|
+
server_label: z15.string(),
|
|
3123
|
+
tools: z15.array(
|
|
3124
|
+
z15.object({
|
|
3125
|
+
name: z15.string(),
|
|
3126
|
+
description: z15.string().optional(),
|
|
3127
|
+
input_schema: z15.any(),
|
|
3128
|
+
annotations: z15.record(z15.string(), z15.unknown()).optional()
|
|
3041
3129
|
})
|
|
3042
3130
|
),
|
|
3043
|
-
error:
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
type:
|
|
3047
|
-
code:
|
|
3048
|
-
message:
|
|
3131
|
+
error: z15.union([
|
|
3132
|
+
z15.string(),
|
|
3133
|
+
z15.object({
|
|
3134
|
+
type: z15.string().optional(),
|
|
3135
|
+
code: z15.union([z15.number(), z15.string()]).optional(),
|
|
3136
|
+
message: z15.string().optional()
|
|
3049
3137
|
}).loose()
|
|
3050
3138
|
]).optional()
|
|
3051
3139
|
}),
|
|
3052
|
-
|
|
3053
|
-
type:
|
|
3054
|
-
id:
|
|
3055
|
-
server_label:
|
|
3056
|
-
name:
|
|
3057
|
-
arguments:
|
|
3058
|
-
approval_request_id:
|
|
3140
|
+
z15.object({
|
|
3141
|
+
type: z15.literal("mcp_approval_request"),
|
|
3142
|
+
id: z15.string(),
|
|
3143
|
+
server_label: z15.string(),
|
|
3144
|
+
name: z15.string(),
|
|
3145
|
+
arguments: z15.string(),
|
|
3146
|
+
approval_request_id: z15.string()
|
|
3147
|
+
}),
|
|
3148
|
+
z15.object({
|
|
3149
|
+
type: z15.literal("apply_patch_call"),
|
|
3150
|
+
id: z15.string(),
|
|
3151
|
+
call_id: z15.string(),
|
|
3152
|
+
status: z15.enum(["in_progress", "completed"]),
|
|
3153
|
+
operation: z15.discriminatedUnion("type", [
|
|
3154
|
+
z15.object({
|
|
3155
|
+
type: z15.literal("create_file"),
|
|
3156
|
+
path: z15.string(),
|
|
3157
|
+
diff: z15.string()
|
|
3158
|
+
}),
|
|
3159
|
+
z15.object({
|
|
3160
|
+
type: z15.literal("delete_file"),
|
|
3161
|
+
path: z15.string()
|
|
3162
|
+
}),
|
|
3163
|
+
z15.object({
|
|
3164
|
+
type: z15.literal("update_file"),
|
|
3165
|
+
path: z15.string(),
|
|
3166
|
+
diff: z15.string()
|
|
3167
|
+
})
|
|
3168
|
+
])
|
|
3059
3169
|
})
|
|
3060
3170
|
])
|
|
3061
3171
|
).optional(),
|
|
3062
|
-
service_tier:
|
|
3063
|
-
incomplete_details:
|
|
3064
|
-
usage:
|
|
3065
|
-
input_tokens:
|
|
3066
|
-
input_tokens_details:
|
|
3067
|
-
output_tokens:
|
|
3068
|
-
output_tokens_details:
|
|
3172
|
+
service_tier: z15.string().nullish(),
|
|
3173
|
+
incomplete_details: z15.object({ reason: z15.string() }).nullish(),
|
|
3174
|
+
usage: z15.object({
|
|
3175
|
+
input_tokens: z15.number(),
|
|
3176
|
+
input_tokens_details: z15.object({ cached_tokens: z15.number().nullish() }).nullish(),
|
|
3177
|
+
output_tokens: z15.number(),
|
|
3178
|
+
output_tokens_details: z15.object({ reasoning_tokens: z15.number().nullish() }).nullish()
|
|
3069
3179
|
}).optional()
|
|
3070
3180
|
})
|
|
3071
3181
|
)
|
|
3072
3182
|
);
|
|
3073
3183
|
|
|
3074
3184
|
// src/responses/openai-responses-options.ts
|
|
3075
|
-
import { lazySchema as
|
|
3076
|
-
import { z as
|
|
3185
|
+
import { lazySchema as lazySchema14, zodSchema as zodSchema14 } from "@ai-sdk/provider-utils";
|
|
3186
|
+
import { z as z16 } from "zod/v4";
|
|
3077
3187
|
var TOP_LOGPROBS_MAX = 20;
|
|
3078
3188
|
var openaiResponsesReasoningModelIds = [
|
|
3079
3189
|
"o1",
|
|
@@ -3140,19 +3250,19 @@ var openaiResponsesModelIds = [
|
|
|
3140
3250
|
"gpt-5-chat-latest",
|
|
3141
3251
|
...openaiResponsesReasoningModelIds
|
|
3142
3252
|
];
|
|
3143
|
-
var openaiResponsesProviderOptionsSchema =
|
|
3144
|
-
() =>
|
|
3145
|
-
|
|
3146
|
-
conversation:
|
|
3147
|
-
include:
|
|
3148
|
-
|
|
3253
|
+
var openaiResponsesProviderOptionsSchema = lazySchema14(
|
|
3254
|
+
() => zodSchema14(
|
|
3255
|
+
z16.object({
|
|
3256
|
+
conversation: z16.string().nullish(),
|
|
3257
|
+
include: z16.array(
|
|
3258
|
+
z16.enum([
|
|
3149
3259
|
"reasoning.encrypted_content",
|
|
3150
3260
|
// handled internally by default, only needed for unknown reasoning models
|
|
3151
3261
|
"file_search_call.results",
|
|
3152
3262
|
"message.output_text.logprobs"
|
|
3153
3263
|
])
|
|
3154
3264
|
).nullish(),
|
|
3155
|
-
instructions:
|
|
3265
|
+
instructions: z16.string().nullish(),
|
|
3156
3266
|
/**
|
|
3157
3267
|
* Return the log probabilities of the tokens.
|
|
3158
3268
|
*
|
|
@@ -3165,17 +3275,17 @@ var openaiResponsesProviderOptionsSchema = lazySchema13(
|
|
|
3165
3275
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
3166
3276
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
3167
3277
|
*/
|
|
3168
|
-
logprobs:
|
|
3278
|
+
logprobs: z16.union([z16.boolean(), z16.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
3169
3279
|
/**
|
|
3170
3280
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
3171
3281
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
3172
3282
|
* Any further attempts to call a tool by the model will be ignored.
|
|
3173
3283
|
*/
|
|
3174
|
-
maxToolCalls:
|
|
3175
|
-
metadata:
|
|
3176
|
-
parallelToolCalls:
|
|
3177
|
-
previousResponseId:
|
|
3178
|
-
promptCacheKey:
|
|
3284
|
+
maxToolCalls: z16.number().nullish(),
|
|
3285
|
+
metadata: z16.any().nullish(),
|
|
3286
|
+
parallelToolCalls: z16.boolean().nullish(),
|
|
3287
|
+
previousResponseId: z16.string().nullish(),
|
|
3288
|
+
promptCacheKey: z16.string().nullish(),
|
|
3179
3289
|
/**
|
|
3180
3290
|
* The retention policy for the prompt cache.
|
|
3181
3291
|
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
@@ -3184,16 +3294,16 @@ var openaiResponsesProviderOptionsSchema = lazySchema13(
|
|
|
3184
3294
|
*
|
|
3185
3295
|
* @default 'in_memory'
|
|
3186
3296
|
*/
|
|
3187
|
-
promptCacheRetention:
|
|
3188
|
-
reasoningEffort:
|
|
3189
|
-
reasoningSummary:
|
|
3190
|
-
safetyIdentifier:
|
|
3191
|
-
serviceTier:
|
|
3192
|
-
store:
|
|
3193
|
-
strictJsonSchema:
|
|
3194
|
-
textVerbosity:
|
|
3195
|
-
truncation:
|
|
3196
|
-
user:
|
|
3297
|
+
promptCacheRetention: z16.enum(["in_memory", "24h"]).nullish(),
|
|
3298
|
+
reasoningEffort: z16.string().nullish(),
|
|
3299
|
+
reasoningSummary: z16.string().nullish(),
|
|
3300
|
+
safetyIdentifier: z16.string().nullish(),
|
|
3301
|
+
serviceTier: z16.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
3302
|
+
store: z16.boolean().nullish(),
|
|
3303
|
+
strictJsonSchema: z16.boolean().nullish(),
|
|
3304
|
+
textVerbosity: z16.enum(["low", "medium", "high"]).nullish(),
|
|
3305
|
+
truncation: z16.enum(["auto", "disabled"]).nullish(),
|
|
3306
|
+
user: z16.string().nullish()
|
|
3197
3307
|
})
|
|
3198
3308
|
)
|
|
3199
3309
|
);
|
|
@@ -3206,44 +3316,44 @@ import { validateTypes as validateTypes2 } from "@ai-sdk/provider-utils";
|
|
|
3206
3316
|
|
|
3207
3317
|
// src/tool/code-interpreter.ts
|
|
3208
3318
|
import {
|
|
3209
|
-
createProviderToolFactoryWithOutputSchema as
|
|
3210
|
-
lazySchema as
|
|
3211
|
-
zodSchema as
|
|
3319
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
|
|
3320
|
+
lazySchema as lazySchema15,
|
|
3321
|
+
zodSchema as zodSchema15
|
|
3212
3322
|
} from "@ai-sdk/provider-utils";
|
|
3213
|
-
import { z as
|
|
3214
|
-
var codeInterpreterInputSchema =
|
|
3215
|
-
() =>
|
|
3216
|
-
|
|
3217
|
-
code:
|
|
3218
|
-
containerId:
|
|
3323
|
+
import { z as z17 } from "zod/v4";
|
|
3324
|
+
var codeInterpreterInputSchema = lazySchema15(
|
|
3325
|
+
() => zodSchema15(
|
|
3326
|
+
z17.object({
|
|
3327
|
+
code: z17.string().nullish(),
|
|
3328
|
+
containerId: z17.string()
|
|
3219
3329
|
})
|
|
3220
3330
|
)
|
|
3221
3331
|
);
|
|
3222
|
-
var codeInterpreterOutputSchema =
|
|
3223
|
-
() =>
|
|
3224
|
-
|
|
3225
|
-
outputs:
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3332
|
+
var codeInterpreterOutputSchema = lazySchema15(
|
|
3333
|
+
() => zodSchema15(
|
|
3334
|
+
z17.object({
|
|
3335
|
+
outputs: z17.array(
|
|
3336
|
+
z17.discriminatedUnion("type", [
|
|
3337
|
+
z17.object({ type: z17.literal("logs"), logs: z17.string() }),
|
|
3338
|
+
z17.object({ type: z17.literal("image"), url: z17.string() })
|
|
3229
3339
|
])
|
|
3230
3340
|
).nullish()
|
|
3231
3341
|
})
|
|
3232
3342
|
)
|
|
3233
3343
|
);
|
|
3234
|
-
var codeInterpreterArgsSchema =
|
|
3235
|
-
() =>
|
|
3236
|
-
|
|
3237
|
-
container:
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
fileIds:
|
|
3344
|
+
var codeInterpreterArgsSchema = lazySchema15(
|
|
3345
|
+
() => zodSchema15(
|
|
3346
|
+
z17.object({
|
|
3347
|
+
container: z17.union([
|
|
3348
|
+
z17.string(),
|
|
3349
|
+
z17.object({
|
|
3350
|
+
fileIds: z17.array(z17.string()).optional()
|
|
3241
3351
|
})
|
|
3242
3352
|
]).optional()
|
|
3243
3353
|
})
|
|
3244
3354
|
)
|
|
3245
3355
|
);
|
|
3246
|
-
var codeInterpreterToolFactory =
|
|
3356
|
+
var codeInterpreterToolFactory = createProviderToolFactoryWithOutputSchema3({
|
|
3247
3357
|
id: "openai.code_interpreter",
|
|
3248
3358
|
inputSchema: codeInterpreterInputSchema,
|
|
3249
3359
|
outputSchema: codeInterpreterOutputSchema
|
|
@@ -3254,88 +3364,88 @@ var codeInterpreter = (args = {}) => {
|
|
|
3254
3364
|
|
|
3255
3365
|
// src/tool/file-search.ts
|
|
3256
3366
|
import {
|
|
3257
|
-
createProviderToolFactoryWithOutputSchema as
|
|
3258
|
-
lazySchema as
|
|
3259
|
-
zodSchema as
|
|
3367
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
|
|
3368
|
+
lazySchema as lazySchema16,
|
|
3369
|
+
zodSchema as zodSchema16
|
|
3260
3370
|
} from "@ai-sdk/provider-utils";
|
|
3261
|
-
import { z as
|
|
3262
|
-
var comparisonFilterSchema =
|
|
3263
|
-
key:
|
|
3264
|
-
type:
|
|
3265
|
-
value:
|
|
3371
|
+
import { z as z18 } from "zod/v4";
|
|
3372
|
+
var comparisonFilterSchema = z18.object({
|
|
3373
|
+
key: z18.string(),
|
|
3374
|
+
type: z18.enum(["eq", "ne", "gt", "gte", "lt", "lte"]),
|
|
3375
|
+
value: z18.union([z18.string(), z18.number(), z18.boolean()])
|
|
3266
3376
|
});
|
|
3267
|
-
var compoundFilterSchema =
|
|
3268
|
-
type:
|
|
3269
|
-
filters:
|
|
3270
|
-
|
|
3377
|
+
var compoundFilterSchema = z18.object({
|
|
3378
|
+
type: z18.enum(["and", "or"]),
|
|
3379
|
+
filters: z18.array(
|
|
3380
|
+
z18.union([comparisonFilterSchema, z18.lazy(() => compoundFilterSchema)])
|
|
3271
3381
|
)
|
|
3272
3382
|
});
|
|
3273
|
-
var fileSearchArgsSchema =
|
|
3274
|
-
() =>
|
|
3275
|
-
|
|
3276
|
-
vectorStoreIds:
|
|
3277
|
-
maxNumResults:
|
|
3278
|
-
ranking:
|
|
3279
|
-
ranker:
|
|
3280
|
-
scoreThreshold:
|
|
3383
|
+
var fileSearchArgsSchema = lazySchema16(
|
|
3384
|
+
() => zodSchema16(
|
|
3385
|
+
z18.object({
|
|
3386
|
+
vectorStoreIds: z18.array(z18.string()),
|
|
3387
|
+
maxNumResults: z18.number().optional(),
|
|
3388
|
+
ranking: z18.object({
|
|
3389
|
+
ranker: z18.string().optional(),
|
|
3390
|
+
scoreThreshold: z18.number().optional()
|
|
3281
3391
|
}).optional(),
|
|
3282
|
-
filters:
|
|
3392
|
+
filters: z18.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
3283
3393
|
})
|
|
3284
3394
|
)
|
|
3285
3395
|
);
|
|
3286
|
-
var fileSearchOutputSchema =
|
|
3287
|
-
() =>
|
|
3288
|
-
|
|
3289
|
-
queries:
|
|
3290
|
-
results:
|
|
3291
|
-
|
|
3292
|
-
attributes:
|
|
3293
|
-
fileId:
|
|
3294
|
-
filename:
|
|
3295
|
-
score:
|
|
3296
|
-
text:
|
|
3396
|
+
var fileSearchOutputSchema = lazySchema16(
|
|
3397
|
+
() => zodSchema16(
|
|
3398
|
+
z18.object({
|
|
3399
|
+
queries: z18.array(z18.string()),
|
|
3400
|
+
results: z18.array(
|
|
3401
|
+
z18.object({
|
|
3402
|
+
attributes: z18.record(z18.string(), z18.unknown()),
|
|
3403
|
+
fileId: z18.string(),
|
|
3404
|
+
filename: z18.string(),
|
|
3405
|
+
score: z18.number(),
|
|
3406
|
+
text: z18.string()
|
|
3297
3407
|
})
|
|
3298
3408
|
).nullable()
|
|
3299
3409
|
})
|
|
3300
3410
|
)
|
|
3301
3411
|
);
|
|
3302
|
-
var fileSearch =
|
|
3412
|
+
var fileSearch = createProviderToolFactoryWithOutputSchema4({
|
|
3303
3413
|
id: "openai.file_search",
|
|
3304
|
-
inputSchema:
|
|
3414
|
+
inputSchema: z18.object({}),
|
|
3305
3415
|
outputSchema: fileSearchOutputSchema
|
|
3306
3416
|
});
|
|
3307
3417
|
|
|
3308
3418
|
// src/tool/image-generation.ts
|
|
3309
3419
|
import {
|
|
3310
|
-
createProviderToolFactoryWithOutputSchema as
|
|
3311
|
-
lazySchema as
|
|
3312
|
-
zodSchema as
|
|
3420
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
|
|
3421
|
+
lazySchema as lazySchema17,
|
|
3422
|
+
zodSchema as zodSchema17
|
|
3313
3423
|
} from "@ai-sdk/provider-utils";
|
|
3314
|
-
import { z as
|
|
3315
|
-
var imageGenerationArgsSchema =
|
|
3316
|
-
() =>
|
|
3317
|
-
|
|
3318
|
-
background:
|
|
3319
|
-
inputFidelity:
|
|
3320
|
-
inputImageMask:
|
|
3321
|
-
fileId:
|
|
3322
|
-
imageUrl:
|
|
3424
|
+
import { z as z19 } from "zod/v4";
|
|
3425
|
+
var imageGenerationArgsSchema = lazySchema17(
|
|
3426
|
+
() => zodSchema17(
|
|
3427
|
+
z19.object({
|
|
3428
|
+
background: z19.enum(["auto", "opaque", "transparent"]).optional(),
|
|
3429
|
+
inputFidelity: z19.enum(["low", "high"]).optional(),
|
|
3430
|
+
inputImageMask: z19.object({
|
|
3431
|
+
fileId: z19.string().optional(),
|
|
3432
|
+
imageUrl: z19.string().optional()
|
|
3323
3433
|
}).optional(),
|
|
3324
|
-
model:
|
|
3325
|
-
moderation:
|
|
3326
|
-
outputCompression:
|
|
3327
|
-
outputFormat:
|
|
3328
|
-
partialImages:
|
|
3329
|
-
quality:
|
|
3330
|
-
size:
|
|
3434
|
+
model: z19.string().optional(),
|
|
3435
|
+
moderation: z19.enum(["auto"]).optional(),
|
|
3436
|
+
outputCompression: z19.number().int().min(0).max(100).optional(),
|
|
3437
|
+
outputFormat: z19.enum(["png", "jpeg", "webp"]).optional(),
|
|
3438
|
+
partialImages: z19.number().int().min(0).max(3).optional(),
|
|
3439
|
+
quality: z19.enum(["auto", "low", "medium", "high"]).optional(),
|
|
3440
|
+
size: z19.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
3331
3441
|
}).strict()
|
|
3332
3442
|
)
|
|
3333
3443
|
);
|
|
3334
|
-
var imageGenerationInputSchema =
|
|
3335
|
-
var imageGenerationOutputSchema =
|
|
3336
|
-
() =>
|
|
3444
|
+
var imageGenerationInputSchema = lazySchema17(() => zodSchema17(z19.object({})));
|
|
3445
|
+
var imageGenerationOutputSchema = lazySchema17(
|
|
3446
|
+
() => zodSchema17(z19.object({ result: z19.string() }))
|
|
3337
3447
|
);
|
|
3338
|
-
var imageGenerationToolFactory =
|
|
3448
|
+
var imageGenerationToolFactory = createProviderToolFactoryWithOutputSchema5({
|
|
3339
3449
|
id: "openai.image_generation",
|
|
3340
3450
|
inputSchema: imageGenerationInputSchema,
|
|
3341
3451
|
outputSchema: imageGenerationOutputSchema
|
|
@@ -3346,35 +3456,35 @@ var imageGeneration = (args = {}) => {
|
|
|
3346
3456
|
|
|
3347
3457
|
// src/tool/mcp.ts
|
|
3348
3458
|
import {
|
|
3349
|
-
createProviderToolFactoryWithOutputSchema as
|
|
3350
|
-
lazySchema as
|
|
3351
|
-
zodSchema as
|
|
3459
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
|
|
3460
|
+
lazySchema as lazySchema18,
|
|
3461
|
+
zodSchema as zodSchema18
|
|
3352
3462
|
} from "@ai-sdk/provider-utils";
|
|
3353
|
-
import { z as
|
|
3354
|
-
var jsonValueSchema =
|
|
3355
|
-
() =>
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3463
|
+
import { z as z20 } from "zod/v4";
|
|
3464
|
+
var jsonValueSchema = z20.lazy(
|
|
3465
|
+
() => z20.union([
|
|
3466
|
+
z20.string(),
|
|
3467
|
+
z20.number(),
|
|
3468
|
+
z20.boolean(),
|
|
3469
|
+
z20.null(),
|
|
3470
|
+
z20.array(jsonValueSchema),
|
|
3471
|
+
z20.record(z20.string(), jsonValueSchema)
|
|
3362
3472
|
])
|
|
3363
3473
|
);
|
|
3364
|
-
var mcpArgsSchema =
|
|
3365
|
-
() =>
|
|
3366
|
-
|
|
3367
|
-
serverLabel:
|
|
3368
|
-
allowedTools:
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
readOnly:
|
|
3372
|
-
toolNames:
|
|
3474
|
+
var mcpArgsSchema = lazySchema18(
|
|
3475
|
+
() => zodSchema18(
|
|
3476
|
+
z20.object({
|
|
3477
|
+
serverLabel: z20.string(),
|
|
3478
|
+
allowedTools: z20.union([
|
|
3479
|
+
z20.array(z20.string()),
|
|
3480
|
+
z20.object({
|
|
3481
|
+
readOnly: z20.boolean().optional(),
|
|
3482
|
+
toolNames: z20.array(z20.string()).optional()
|
|
3373
3483
|
})
|
|
3374
3484
|
]).optional(),
|
|
3375
|
-
authorization:
|
|
3376
|
-
connectorId:
|
|
3377
|
-
headers:
|
|
3485
|
+
authorization: z20.string().optional(),
|
|
3486
|
+
connectorId: z20.string().optional(),
|
|
3487
|
+
headers: z20.record(z20.string(), z20.string()).optional(),
|
|
3378
3488
|
// TODO: Integrate this MCP tool approval with our SDK's existing tool approval architecture
|
|
3379
3489
|
// requireApproval: z
|
|
3380
3490
|
// .union([
|
|
@@ -3385,122 +3495,67 @@ var mcpArgsSchema = lazySchema17(
|
|
|
3385
3495
|
// }),
|
|
3386
3496
|
// ])
|
|
3387
3497
|
// .optional(),
|
|
3388
|
-
serverDescription:
|
|
3389
|
-
serverUrl:
|
|
3498
|
+
serverDescription: z20.string().optional(),
|
|
3499
|
+
serverUrl: z20.string().optional()
|
|
3390
3500
|
}).refine(
|
|
3391
3501
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
3392
3502
|
"One of serverUrl or connectorId must be provided."
|
|
3393
3503
|
)
|
|
3394
3504
|
)
|
|
3395
3505
|
);
|
|
3396
|
-
var mcpInputSchema =
|
|
3397
|
-
var mcpOutputSchema =
|
|
3398
|
-
() =>
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
type:
|
|
3402
|
-
serverLabel:
|
|
3403
|
-
name:
|
|
3404
|
-
arguments:
|
|
3405
|
-
output:
|
|
3406
|
-
error:
|
|
3506
|
+
var mcpInputSchema = lazySchema18(() => zodSchema18(z20.object({})));
|
|
3507
|
+
var mcpOutputSchema = lazySchema18(
|
|
3508
|
+
() => zodSchema18(
|
|
3509
|
+
z20.discriminatedUnion("type", [
|
|
3510
|
+
z20.object({
|
|
3511
|
+
type: z20.literal("call"),
|
|
3512
|
+
serverLabel: z20.string(),
|
|
3513
|
+
name: z20.string(),
|
|
3514
|
+
arguments: z20.string(),
|
|
3515
|
+
output: z20.string().nullable().optional(),
|
|
3516
|
+
error: z20.union([z20.string(), jsonValueSchema]).optional()
|
|
3407
3517
|
}),
|
|
3408
|
-
|
|
3409
|
-
type:
|
|
3410
|
-
serverLabel:
|
|
3411
|
-
tools:
|
|
3412
|
-
|
|
3413
|
-
name:
|
|
3414
|
-
description:
|
|
3518
|
+
z20.object({
|
|
3519
|
+
type: z20.literal("listTools"),
|
|
3520
|
+
serverLabel: z20.string(),
|
|
3521
|
+
tools: z20.array(
|
|
3522
|
+
z20.object({
|
|
3523
|
+
name: z20.string(),
|
|
3524
|
+
description: z20.string().optional(),
|
|
3415
3525
|
inputSchema: jsonValueSchema,
|
|
3416
|
-
annotations:
|
|
3526
|
+
annotations: z20.record(z20.string(), jsonValueSchema).optional()
|
|
3417
3527
|
})
|
|
3418
3528
|
),
|
|
3419
|
-
error:
|
|
3529
|
+
error: z20.union([z20.string(), jsonValueSchema]).optional()
|
|
3420
3530
|
}),
|
|
3421
|
-
|
|
3422
|
-
type:
|
|
3423
|
-
serverLabel:
|
|
3424
|
-
name:
|
|
3425
|
-
arguments:
|
|
3426
|
-
approvalRequestId:
|
|
3531
|
+
z20.object({
|
|
3532
|
+
type: z20.literal("approvalRequest"),
|
|
3533
|
+
serverLabel: z20.string(),
|
|
3534
|
+
name: z20.string(),
|
|
3535
|
+
arguments: z20.string(),
|
|
3536
|
+
approvalRequestId: z20.string()
|
|
3427
3537
|
})
|
|
3428
3538
|
])
|
|
3429
3539
|
)
|
|
3430
3540
|
);
|
|
3431
|
-
var mcpToolFactory =
|
|
3541
|
+
var mcpToolFactory = createProviderToolFactoryWithOutputSchema6({
|
|
3432
3542
|
id: "openai.mcp",
|
|
3433
3543
|
inputSchema: mcpInputSchema,
|
|
3434
3544
|
outputSchema: mcpOutputSchema
|
|
3435
3545
|
});
|
|
3436
3546
|
|
|
3437
3547
|
// src/tool/web-search.ts
|
|
3438
|
-
import {
|
|
3439
|
-
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
|
|
3440
|
-
lazySchema as lazySchema18,
|
|
3441
|
-
zodSchema as zodSchema18
|
|
3442
|
-
} from "@ai-sdk/provider-utils";
|
|
3443
|
-
import { z as z20 } from "zod/v4";
|
|
3444
|
-
var webSearchArgsSchema = lazySchema18(
|
|
3445
|
-
() => zodSchema18(
|
|
3446
|
-
z20.object({
|
|
3447
|
-
externalWebAccess: z20.boolean().optional(),
|
|
3448
|
-
filters: z20.object({ allowedDomains: z20.array(z20.string()).optional() }).optional(),
|
|
3449
|
-
searchContextSize: z20.enum(["low", "medium", "high"]).optional(),
|
|
3450
|
-
userLocation: z20.object({
|
|
3451
|
-
type: z20.literal("approximate"),
|
|
3452
|
-
country: z20.string().optional(),
|
|
3453
|
-
city: z20.string().optional(),
|
|
3454
|
-
region: z20.string().optional(),
|
|
3455
|
-
timezone: z20.string().optional()
|
|
3456
|
-
}).optional()
|
|
3457
|
-
})
|
|
3458
|
-
)
|
|
3459
|
-
);
|
|
3460
|
-
var webSearchInputSchema = lazySchema18(() => zodSchema18(z20.object({})));
|
|
3461
|
-
var webSearchOutputSchema = lazySchema18(
|
|
3462
|
-
() => zodSchema18(
|
|
3463
|
-
z20.object({
|
|
3464
|
-
action: z20.discriminatedUnion("type", [
|
|
3465
|
-
z20.object({
|
|
3466
|
-
type: z20.literal("search"),
|
|
3467
|
-
query: z20.string().optional()
|
|
3468
|
-
}),
|
|
3469
|
-
z20.object({
|
|
3470
|
-
type: z20.literal("openPage"),
|
|
3471
|
-
url: z20.string()
|
|
3472
|
-
}),
|
|
3473
|
-
z20.object({
|
|
3474
|
-
type: z20.literal("find"),
|
|
3475
|
-
url: z20.string(),
|
|
3476
|
-
pattern: z20.string()
|
|
3477
|
-
})
|
|
3478
|
-
]),
|
|
3479
|
-
sources: z20.array(
|
|
3480
|
-
z20.discriminatedUnion("type", [
|
|
3481
|
-
z20.object({ type: z20.literal("url"), url: z20.string() }),
|
|
3482
|
-
z20.object({ type: z20.literal("api"), name: z20.string() })
|
|
3483
|
-
])
|
|
3484
|
-
).optional()
|
|
3485
|
-
})
|
|
3486
|
-
)
|
|
3487
|
-
);
|
|
3488
|
-
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema6({
|
|
3489
|
-
id: "openai.web_search",
|
|
3490
|
-
inputSchema: webSearchInputSchema,
|
|
3491
|
-
outputSchema: webSearchOutputSchema
|
|
3492
|
-
});
|
|
3493
|
-
|
|
3494
|
-
// src/tool/web-search-preview.ts
|
|
3495
3548
|
import {
|
|
3496
3549
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
|
|
3497
3550
|
lazySchema as lazySchema19,
|
|
3498
3551
|
zodSchema as zodSchema19
|
|
3499
3552
|
} from "@ai-sdk/provider-utils";
|
|
3500
3553
|
import { z as z21 } from "zod/v4";
|
|
3501
|
-
var
|
|
3554
|
+
var webSearchArgsSchema = lazySchema19(
|
|
3502
3555
|
() => zodSchema19(
|
|
3503
3556
|
z21.object({
|
|
3557
|
+
externalWebAccess: z21.boolean().optional(),
|
|
3558
|
+
filters: z21.object({ allowedDomains: z21.array(z21.string()).optional() }).optional(),
|
|
3504
3559
|
searchContextSize: z21.enum(["low", "medium", "high"]).optional(),
|
|
3505
3560
|
userLocation: z21.object({
|
|
3506
3561
|
type: z21.literal("approximate"),
|
|
@@ -3512,10 +3567,8 @@ var webSearchPreviewArgsSchema = lazySchema19(
|
|
|
3512
3567
|
})
|
|
3513
3568
|
)
|
|
3514
3569
|
);
|
|
3515
|
-
var
|
|
3516
|
-
|
|
3517
|
-
);
|
|
3518
|
-
var webSearchPreviewOutputSchema = lazySchema19(
|
|
3570
|
+
var webSearchInputSchema = lazySchema19(() => zodSchema19(z21.object({})));
|
|
3571
|
+
var webSearchOutputSchema = lazySchema19(
|
|
3519
3572
|
() => zodSchema19(
|
|
3520
3573
|
z21.object({
|
|
3521
3574
|
action: z21.discriminatedUnion("type", [
|
|
@@ -3532,11 +3585,68 @@ var webSearchPreviewOutputSchema = lazySchema19(
|
|
|
3532
3585
|
url: z21.string(),
|
|
3533
3586
|
pattern: z21.string()
|
|
3534
3587
|
})
|
|
3588
|
+
]),
|
|
3589
|
+
sources: z21.array(
|
|
3590
|
+
z21.discriminatedUnion("type", [
|
|
3591
|
+
z21.object({ type: z21.literal("url"), url: z21.string() }),
|
|
3592
|
+
z21.object({ type: z21.literal("api"), name: z21.string() })
|
|
3593
|
+
])
|
|
3594
|
+
).optional()
|
|
3595
|
+
})
|
|
3596
|
+
)
|
|
3597
|
+
);
|
|
3598
|
+
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema7({
|
|
3599
|
+
id: "openai.web_search",
|
|
3600
|
+
inputSchema: webSearchInputSchema,
|
|
3601
|
+
outputSchema: webSearchOutputSchema
|
|
3602
|
+
});
|
|
3603
|
+
|
|
3604
|
+
// src/tool/web-search-preview.ts
|
|
3605
|
+
import {
|
|
3606
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
|
|
3607
|
+
lazySchema as lazySchema20,
|
|
3608
|
+
zodSchema as zodSchema20
|
|
3609
|
+
} from "@ai-sdk/provider-utils";
|
|
3610
|
+
import { z as z22 } from "zod/v4";
|
|
3611
|
+
var webSearchPreviewArgsSchema = lazySchema20(
|
|
3612
|
+
() => zodSchema20(
|
|
3613
|
+
z22.object({
|
|
3614
|
+
searchContextSize: z22.enum(["low", "medium", "high"]).optional(),
|
|
3615
|
+
userLocation: z22.object({
|
|
3616
|
+
type: z22.literal("approximate"),
|
|
3617
|
+
country: z22.string().optional(),
|
|
3618
|
+
city: z22.string().optional(),
|
|
3619
|
+
region: z22.string().optional(),
|
|
3620
|
+
timezone: z22.string().optional()
|
|
3621
|
+
}).optional()
|
|
3622
|
+
})
|
|
3623
|
+
)
|
|
3624
|
+
);
|
|
3625
|
+
var webSearchPreviewInputSchema = lazySchema20(
|
|
3626
|
+
() => zodSchema20(z22.object({}))
|
|
3627
|
+
);
|
|
3628
|
+
var webSearchPreviewOutputSchema = lazySchema20(
|
|
3629
|
+
() => zodSchema20(
|
|
3630
|
+
z22.object({
|
|
3631
|
+
action: z22.discriminatedUnion("type", [
|
|
3632
|
+
z22.object({
|
|
3633
|
+
type: z22.literal("search"),
|
|
3634
|
+
query: z22.string().optional()
|
|
3635
|
+
}),
|
|
3636
|
+
z22.object({
|
|
3637
|
+
type: z22.literal("openPage"),
|
|
3638
|
+
url: z22.string()
|
|
3639
|
+
}),
|
|
3640
|
+
z22.object({
|
|
3641
|
+
type: z22.literal("find"),
|
|
3642
|
+
url: z22.string(),
|
|
3643
|
+
pattern: z22.string()
|
|
3644
|
+
})
|
|
3535
3645
|
])
|
|
3536
3646
|
})
|
|
3537
3647
|
)
|
|
3538
3648
|
);
|
|
3539
|
-
var webSearchPreview =
|
|
3649
|
+
var webSearchPreview = createProviderToolFactoryWithOutputSchema8({
|
|
3540
3650
|
id: "openai.web_search_preview",
|
|
3541
3651
|
inputSchema: webSearchPreviewInputSchema,
|
|
3542
3652
|
outputSchema: webSearchPreviewOutputSchema
|
|
@@ -3590,6 +3700,12 @@ async function prepareResponsesTools({
|
|
|
3590
3700
|
});
|
|
3591
3701
|
break;
|
|
3592
3702
|
}
|
|
3703
|
+
case "openai.apply_patch": {
|
|
3704
|
+
openaiTools.push({
|
|
3705
|
+
type: "apply_patch"
|
|
3706
|
+
});
|
|
3707
|
+
break;
|
|
3708
|
+
}
|
|
3593
3709
|
case "openai.web_search_preview": {
|
|
3594
3710
|
const args = await validateTypes2({
|
|
3595
3711
|
value: tool.args,
|
|
@@ -3694,7 +3810,7 @@ async function prepareResponsesTools({
|
|
|
3694
3810
|
case "tool":
|
|
3695
3811
|
return {
|
|
3696
3812
|
tools: openaiTools,
|
|
3697
|
-
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 },
|
|
3813
|
+
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 },
|
|
3698
3814
|
toolWarnings
|
|
3699
3815
|
};
|
|
3700
3816
|
default: {
|
|
@@ -3774,7 +3890,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3774
3890
|
"openai.local_shell": "local_shell",
|
|
3775
3891
|
"openai.web_search": "web_search",
|
|
3776
3892
|
"openai.web_search_preview": "web_search_preview",
|
|
3777
|
-
"openai.mcp": "mcp"
|
|
3893
|
+
"openai.mcp": "mcp",
|
|
3894
|
+
"openai.apply_patch": "apply_patch"
|
|
3778
3895
|
}
|
|
3779
3896
|
});
|
|
3780
3897
|
const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
|
|
@@ -3783,10 +3900,11 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3783
3900
|
systemMessageMode: modelConfig.systemMessageMode,
|
|
3784
3901
|
fileIdPrefixes: this.config.fileIdPrefixes,
|
|
3785
3902
|
store: (_a = openaiOptions == null ? void 0 : openaiOptions.store) != null ? _a : true,
|
|
3786
|
-
hasLocalShellTool: hasOpenAITool("openai.local_shell")
|
|
3903
|
+
hasLocalShellTool: hasOpenAITool("openai.local_shell"),
|
|
3904
|
+
hasApplyPatchTool: hasOpenAITool("openai.apply_patch")
|
|
3787
3905
|
});
|
|
3788
3906
|
warnings.push(...inputWarnings);
|
|
3789
|
-
const strictJsonSchema = (_b = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _b :
|
|
3907
|
+
const strictJsonSchema = (_b = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _b : true;
|
|
3790
3908
|
let include = openaiOptions == null ? void 0 : openaiOptions.include;
|
|
3791
3909
|
function addInclude(key) {
|
|
3792
3910
|
if (include == null) {
|
|
@@ -4284,6 +4402,23 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4284
4402
|
});
|
|
4285
4403
|
break;
|
|
4286
4404
|
}
|
|
4405
|
+
case "apply_patch_call": {
|
|
4406
|
+
content.push({
|
|
4407
|
+
type: "tool-call",
|
|
4408
|
+
toolCallId: part.call_id,
|
|
4409
|
+
toolName: toolNameMapping.toCustomToolName("apply_patch"),
|
|
4410
|
+
input: JSON.stringify({
|
|
4411
|
+
callId: part.call_id,
|
|
4412
|
+
operation: part.operation
|
|
4413
|
+
}),
|
|
4414
|
+
providerMetadata: {
|
|
4415
|
+
[providerKey]: {
|
|
4416
|
+
itemId: part.id
|
|
4417
|
+
}
|
|
4418
|
+
}
|
|
4419
|
+
});
|
|
4420
|
+
break;
|
|
4421
|
+
}
|
|
4287
4422
|
}
|
|
4288
4423
|
}
|
|
4289
4424
|
const providerMetadata = {
|
|
@@ -4471,6 +4606,27 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4471
4606
|
input: "{}",
|
|
4472
4607
|
providerExecuted: true
|
|
4473
4608
|
});
|
|
4609
|
+
} else if (value.item.type === "apply_patch_call") {
|
|
4610
|
+
ongoingToolCalls[value.output_index] = {
|
|
4611
|
+
toolName: toolNameMapping.toCustomToolName("apply_patch"),
|
|
4612
|
+
toolCallId: value.item.call_id
|
|
4613
|
+
};
|
|
4614
|
+
if (value.item.status === "completed") {
|
|
4615
|
+
controller.enqueue({
|
|
4616
|
+
type: "tool-call",
|
|
4617
|
+
toolCallId: value.item.call_id,
|
|
4618
|
+
toolName: toolNameMapping.toCustomToolName("apply_patch"),
|
|
4619
|
+
input: JSON.stringify({
|
|
4620
|
+
callId: value.item.call_id,
|
|
4621
|
+
operation: value.item.operation
|
|
4622
|
+
}),
|
|
4623
|
+
providerMetadata: {
|
|
4624
|
+
[providerKey]: {
|
|
4625
|
+
itemId: value.item.id
|
|
4626
|
+
}
|
|
4627
|
+
}
|
|
4628
|
+
});
|
|
4629
|
+
}
|
|
4474
4630
|
} else if (value.item.type === "message") {
|
|
4475
4631
|
ongoingAnnotations.splice(0, ongoingAnnotations.length);
|
|
4476
4632
|
controller.enqueue({
|
|
@@ -4634,6 +4790,24 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4634
4790
|
...value.item.error != null ? { error: value.item.error } : {}
|
|
4635
4791
|
}
|
|
4636
4792
|
});
|
|
4793
|
+
} else if (value.item.type === "apply_patch_call") {
|
|
4794
|
+
ongoingToolCalls[value.output_index] = void 0;
|
|
4795
|
+
if (value.item.status === "completed") {
|
|
4796
|
+
controller.enqueue({
|
|
4797
|
+
type: "tool-call",
|
|
4798
|
+
toolCallId: value.item.call_id,
|
|
4799
|
+
toolName: toolNameMapping.toCustomToolName("apply_patch"),
|
|
4800
|
+
input: JSON.stringify({
|
|
4801
|
+
callId: value.item.call_id,
|
|
4802
|
+
operation: value.item.operation
|
|
4803
|
+
}),
|
|
4804
|
+
providerMetadata: {
|
|
4805
|
+
[providerKey]: {
|
|
4806
|
+
itemId: value.item.id
|
|
4807
|
+
}
|
|
4808
|
+
}
|
|
4809
|
+
});
|
|
4810
|
+
}
|
|
4637
4811
|
} else if (value.item.type === "mcp_approval_request") {
|
|
4638
4812
|
ongoingToolCalls[value.output_index] = void 0;
|
|
4639
4813
|
controller.enqueue({
|
|
@@ -4983,6 +5157,11 @@ export {
|
|
|
4983
5157
|
OpenAIResponsesLanguageModel,
|
|
4984
5158
|
OpenAISpeechModel,
|
|
4985
5159
|
OpenAITranscriptionModel,
|
|
5160
|
+
applyPatch,
|
|
5161
|
+
applyPatchArgsSchema,
|
|
5162
|
+
applyPatchInputSchema,
|
|
5163
|
+
applyPatchOutputSchema,
|
|
5164
|
+
applyPatchToolFactory,
|
|
4986
5165
|
codeInterpreter,
|
|
4987
5166
|
codeInterpreterArgsSchema,
|
|
4988
5167
|
codeInterpreterInputSchema,
|