@ai-sdk/openai 4.0.14 → 4.0.16
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 +17 -0
- package/dist/index.d.ts +285 -24
- package/dist/index.js +1525 -1169
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +184 -8
- package/dist/internal/index.js +1467 -1121
- package/dist/internal/index.js.map +1 -1
- package/docs/03-openai.mdx +93 -4
- package/package.json +2 -2
- package/src/index.ts +4 -0
- package/src/openai-tools.ts +11 -0
- package/src/responses/convert-to-openai-responses-input.ts +83 -1
- package/src/responses/openai-responses-api.ts +96 -19
- package/src/responses/openai-responses-language-model.ts +179 -33
- package/src/responses/openai-responses-prepare-tools.ts +9 -1
- package/src/tool/computer.ts +147 -0
package/dist/index.js
CHANGED
|
@@ -2525,31 +2525,128 @@ var codeInterpreter = (args = {}) => {
|
|
|
2525
2525
|
return codeInterpreterToolFactory(args);
|
|
2526
2526
|
};
|
|
2527
2527
|
|
|
2528
|
-
// src/tool/
|
|
2528
|
+
// src/tool/computer.ts
|
|
2529
2529
|
import {
|
|
2530
|
-
|
|
2530
|
+
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema2,
|
|
2531
2531
|
lazySchema as lazySchema13,
|
|
2532
2532
|
zodSchema as zodSchema13
|
|
2533
2533
|
} from "@ai-sdk/provider-utils";
|
|
2534
2534
|
import { z as z14 } from "zod/v4";
|
|
2535
|
-
var
|
|
2535
|
+
var safetyCheckSchema = z14.object({
|
|
2536
|
+
id: z14.string(),
|
|
2537
|
+
code: z14.string().optional(),
|
|
2538
|
+
message: z14.string().optional()
|
|
2539
|
+
});
|
|
2540
|
+
var computerActionSchema = z14.discriminatedUnion("type", [
|
|
2541
|
+
z14.object({
|
|
2542
|
+
type: z14.literal("click"),
|
|
2543
|
+
button: z14.enum(["left", "right", "wheel", "back", "forward"]),
|
|
2544
|
+
x: z14.number(),
|
|
2545
|
+
y: z14.number(),
|
|
2546
|
+
keys: z14.array(z14.string()).optional()
|
|
2547
|
+
}),
|
|
2548
|
+
z14.object({
|
|
2549
|
+
type: z14.literal("double_click"),
|
|
2550
|
+
x: z14.number(),
|
|
2551
|
+
y: z14.number(),
|
|
2552
|
+
keys: z14.array(z14.string()).optional()
|
|
2553
|
+
}),
|
|
2554
|
+
z14.object({
|
|
2555
|
+
type: z14.literal("drag"),
|
|
2556
|
+
path: z14.array(z14.object({ x: z14.number(), y: z14.number() })),
|
|
2557
|
+
keys: z14.array(z14.string()).optional()
|
|
2558
|
+
}),
|
|
2559
|
+
z14.object({
|
|
2560
|
+
type: z14.literal("keypress"),
|
|
2561
|
+
keys: z14.array(z14.string())
|
|
2562
|
+
}),
|
|
2563
|
+
z14.object({
|
|
2564
|
+
type: z14.literal("move"),
|
|
2565
|
+
x: z14.number(),
|
|
2566
|
+
y: z14.number(),
|
|
2567
|
+
keys: z14.array(z14.string()).optional()
|
|
2568
|
+
}),
|
|
2569
|
+
z14.object({
|
|
2570
|
+
type: z14.literal("screenshot")
|
|
2571
|
+
}),
|
|
2572
|
+
z14.object({
|
|
2573
|
+
type: z14.literal("scroll"),
|
|
2574
|
+
x: z14.number(),
|
|
2575
|
+
y: z14.number(),
|
|
2576
|
+
scrollX: z14.number(),
|
|
2577
|
+
scrollY: z14.number(),
|
|
2578
|
+
keys: z14.array(z14.string()).optional()
|
|
2579
|
+
}),
|
|
2580
|
+
z14.object({
|
|
2581
|
+
type: z14.literal("type"),
|
|
2582
|
+
text: z14.string()
|
|
2583
|
+
}),
|
|
2584
|
+
z14.object({
|
|
2585
|
+
type: z14.literal("wait")
|
|
2586
|
+
})
|
|
2587
|
+
]);
|
|
2588
|
+
var computerInputSchema = lazySchema13(
|
|
2589
|
+
() => zodSchema13(
|
|
2590
|
+
z14.object({
|
|
2591
|
+
actions: z14.array(computerActionSchema),
|
|
2592
|
+
pendingSafetyChecks: z14.array(safetyCheckSchema),
|
|
2593
|
+
status: z14.enum(["in_progress", "completed", "incomplete"])
|
|
2594
|
+
})
|
|
2595
|
+
)
|
|
2596
|
+
);
|
|
2597
|
+
var computerOutputSchema = lazySchema13(
|
|
2536
2598
|
() => zodSchema13(
|
|
2537
2599
|
z14.object({
|
|
2538
|
-
|
|
2539
|
-
format: z14.union([
|
|
2600
|
+
output: z14.union([
|
|
2540
2601
|
z14.object({
|
|
2541
|
-
type: z14.literal("
|
|
2542
|
-
|
|
2543
|
-
|
|
2602
|
+
type: z14.literal("computer_screenshot"),
|
|
2603
|
+
imageUrl: z14.string(),
|
|
2604
|
+
fileId: z14.string().optional(),
|
|
2605
|
+
detail: z14.enum(["auto", "low", "high", "original"]).optional()
|
|
2544
2606
|
}),
|
|
2545
2607
|
z14.object({
|
|
2546
|
-
type: z14.literal("
|
|
2608
|
+
type: z14.literal("computer_screenshot"),
|
|
2609
|
+
fileId: z14.string(),
|
|
2610
|
+
imageUrl: z14.string().optional(),
|
|
2611
|
+
detail: z14.enum(["auto", "low", "high", "original"]).optional()
|
|
2612
|
+
})
|
|
2613
|
+
]),
|
|
2614
|
+
acknowledgedSafetyChecks: z14.array(safetyCheckSchema).optional()
|
|
2615
|
+
})
|
|
2616
|
+
)
|
|
2617
|
+
);
|
|
2618
|
+
var computerToolFactory = createProviderDefinedToolFactoryWithOutputSchema2({
|
|
2619
|
+
id: "openai.computer",
|
|
2620
|
+
inputSchema: computerInputSchema,
|
|
2621
|
+
outputSchema: computerOutputSchema
|
|
2622
|
+
});
|
|
2623
|
+
var computer = (options = {}) => computerToolFactory(options);
|
|
2624
|
+
|
|
2625
|
+
// src/tool/custom.ts
|
|
2626
|
+
import {
|
|
2627
|
+
createProviderDefinedToolFactory,
|
|
2628
|
+
lazySchema as lazySchema14,
|
|
2629
|
+
zodSchema as zodSchema14
|
|
2630
|
+
} from "@ai-sdk/provider-utils";
|
|
2631
|
+
import { z as z15 } from "zod/v4";
|
|
2632
|
+
var customArgsSchema = lazySchema14(
|
|
2633
|
+
() => zodSchema14(
|
|
2634
|
+
z15.object({
|
|
2635
|
+
description: z15.string().optional(),
|
|
2636
|
+
format: z15.union([
|
|
2637
|
+
z15.object({
|
|
2638
|
+
type: z15.literal("grammar"),
|
|
2639
|
+
syntax: z15.enum(["regex", "lark"]),
|
|
2640
|
+
definition: z15.string()
|
|
2641
|
+
}),
|
|
2642
|
+
z15.object({
|
|
2643
|
+
type: z15.literal("text")
|
|
2547
2644
|
})
|
|
2548
2645
|
]).optional()
|
|
2549
2646
|
})
|
|
2550
2647
|
)
|
|
2551
2648
|
);
|
|
2552
|
-
var customInputSchema =
|
|
2649
|
+
var customInputSchema = lazySchema14(() => zodSchema14(z15.string()));
|
|
2553
2650
|
var customToolFactory = createProviderDefinedToolFactory({
|
|
2554
2651
|
id: "openai.custom",
|
|
2555
2652
|
inputSchema: customInputSchema
|
|
@@ -2559,45 +2656,45 @@ var customTool = (args) => customToolFactory(args);
|
|
|
2559
2656
|
// src/tool/file-search.ts
|
|
2560
2657
|
import {
|
|
2561
2658
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory2,
|
|
2562
|
-
lazySchema as
|
|
2563
|
-
zodSchema as
|
|
2659
|
+
lazySchema as lazySchema15,
|
|
2660
|
+
zodSchema as zodSchema15
|
|
2564
2661
|
} from "@ai-sdk/provider-utils";
|
|
2565
|
-
import { z as
|
|
2566
|
-
var comparisonFilterSchema =
|
|
2567
|
-
key:
|
|
2568
|
-
type:
|
|
2569
|
-
value:
|
|
2662
|
+
import { z as z16 } from "zod/v4";
|
|
2663
|
+
var comparisonFilterSchema = z16.object({
|
|
2664
|
+
key: z16.string(),
|
|
2665
|
+
type: z16.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
2666
|
+
value: z16.union([z16.string(), z16.number(), z16.boolean(), z16.array(z16.string())])
|
|
2570
2667
|
});
|
|
2571
|
-
var compoundFilterSchema =
|
|
2572
|
-
type:
|
|
2573
|
-
filters:
|
|
2574
|
-
|
|
2668
|
+
var compoundFilterSchema = z16.object({
|
|
2669
|
+
type: z16.enum(["and", "or"]),
|
|
2670
|
+
filters: z16.array(
|
|
2671
|
+
z16.union([comparisonFilterSchema, z16.lazy(() => compoundFilterSchema)])
|
|
2575
2672
|
)
|
|
2576
2673
|
});
|
|
2577
|
-
var fileSearchArgsSchema =
|
|
2578
|
-
() =>
|
|
2579
|
-
|
|
2580
|
-
vectorStoreIds:
|
|
2581
|
-
maxNumResults:
|
|
2582
|
-
ranking:
|
|
2583
|
-
ranker:
|
|
2584
|
-
scoreThreshold:
|
|
2674
|
+
var fileSearchArgsSchema = lazySchema15(
|
|
2675
|
+
() => zodSchema15(
|
|
2676
|
+
z16.object({
|
|
2677
|
+
vectorStoreIds: z16.array(z16.string()),
|
|
2678
|
+
maxNumResults: z16.number().optional(),
|
|
2679
|
+
ranking: z16.object({
|
|
2680
|
+
ranker: z16.string().optional(),
|
|
2681
|
+
scoreThreshold: z16.number().optional()
|
|
2585
2682
|
}).optional(),
|
|
2586
|
-
filters:
|
|
2683
|
+
filters: z16.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
2587
2684
|
})
|
|
2588
2685
|
)
|
|
2589
2686
|
);
|
|
2590
|
-
var fileSearchOutputSchema =
|
|
2591
|
-
() =>
|
|
2592
|
-
|
|
2593
|
-
queries:
|
|
2594
|
-
results:
|
|
2595
|
-
|
|
2596
|
-
attributes:
|
|
2597
|
-
fileId:
|
|
2598
|
-
filename:
|
|
2599
|
-
score:
|
|
2600
|
-
text:
|
|
2687
|
+
var fileSearchOutputSchema = lazySchema15(
|
|
2688
|
+
() => zodSchema15(
|
|
2689
|
+
z16.object({
|
|
2690
|
+
queries: z16.array(z16.string()),
|
|
2691
|
+
results: z16.array(
|
|
2692
|
+
z16.object({
|
|
2693
|
+
attributes: z16.record(z16.string(), z16.unknown()),
|
|
2694
|
+
fileId: z16.string(),
|
|
2695
|
+
filename: z16.string(),
|
|
2696
|
+
score: z16.number(),
|
|
2697
|
+
text: z16.string()
|
|
2601
2698
|
})
|
|
2602
2699
|
).nullable()
|
|
2603
2700
|
})
|
|
@@ -2605,39 +2702,39 @@ var fileSearchOutputSchema = lazySchema14(
|
|
|
2605
2702
|
);
|
|
2606
2703
|
var fileSearch = createProviderExecutedToolFactory2({
|
|
2607
2704
|
id: "openai.file_search",
|
|
2608
|
-
inputSchema:
|
|
2705
|
+
inputSchema: z16.object({}),
|
|
2609
2706
|
outputSchema: fileSearchOutputSchema
|
|
2610
2707
|
});
|
|
2611
2708
|
|
|
2612
2709
|
// src/tool/image-generation.ts
|
|
2613
2710
|
import {
|
|
2614
2711
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory3,
|
|
2615
|
-
lazySchema as
|
|
2616
|
-
zodSchema as
|
|
2712
|
+
lazySchema as lazySchema16,
|
|
2713
|
+
zodSchema as zodSchema16
|
|
2617
2714
|
} from "@ai-sdk/provider-utils";
|
|
2618
|
-
import { z as
|
|
2619
|
-
var imageGenerationArgsSchema =
|
|
2620
|
-
() =>
|
|
2621
|
-
|
|
2622
|
-
background:
|
|
2623
|
-
inputFidelity:
|
|
2624
|
-
inputImageMask:
|
|
2625
|
-
fileId:
|
|
2626
|
-
imageUrl:
|
|
2715
|
+
import { z as z17 } from "zod/v4";
|
|
2716
|
+
var imageGenerationArgsSchema = lazySchema16(
|
|
2717
|
+
() => zodSchema16(
|
|
2718
|
+
z17.object({
|
|
2719
|
+
background: z17.enum(["auto", "opaque", "transparent"]).optional(),
|
|
2720
|
+
inputFidelity: z17.enum(["low", "high"]).optional(),
|
|
2721
|
+
inputImageMask: z17.object({
|
|
2722
|
+
fileId: z17.string().optional(),
|
|
2723
|
+
imageUrl: z17.string().optional()
|
|
2627
2724
|
}).optional(),
|
|
2628
|
-
model:
|
|
2629
|
-
moderation:
|
|
2630
|
-
outputCompression:
|
|
2631
|
-
outputFormat:
|
|
2632
|
-
partialImages:
|
|
2633
|
-
quality:
|
|
2634
|
-
size:
|
|
2725
|
+
model: z17.string().optional(),
|
|
2726
|
+
moderation: z17.enum(["auto"]).optional(),
|
|
2727
|
+
outputCompression: z17.number().int().min(0).max(100).optional(),
|
|
2728
|
+
outputFormat: z17.enum(["png", "jpeg", "webp"]).optional(),
|
|
2729
|
+
partialImages: z17.number().int().min(0).max(3).optional(),
|
|
2730
|
+
quality: z17.enum(["auto", "low", "medium", "high"]).optional(),
|
|
2731
|
+
size: z17.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
2635
2732
|
}).strict()
|
|
2636
2733
|
)
|
|
2637
2734
|
);
|
|
2638
|
-
var imageGenerationInputSchema =
|
|
2639
|
-
var imageGenerationOutputSchema =
|
|
2640
|
-
() =>
|
|
2735
|
+
var imageGenerationInputSchema = lazySchema16(() => zodSchema16(z17.object({})));
|
|
2736
|
+
var imageGenerationOutputSchema = lazySchema16(
|
|
2737
|
+
() => zodSchema16(z17.object({ result: z17.string() }))
|
|
2641
2738
|
);
|
|
2642
2739
|
var imageGenerationToolFactory = createProviderExecutedToolFactory3({
|
|
2643
2740
|
id: "openai.image_generation",
|
|
@@ -2650,29 +2747,29 @@ var imageGeneration = (args = {}) => {
|
|
|
2650
2747
|
|
|
2651
2748
|
// src/tool/local-shell.ts
|
|
2652
2749
|
import {
|
|
2653
|
-
createProviderDefinedToolFactoryWithOutputSchema as
|
|
2654
|
-
lazySchema as
|
|
2655
|
-
zodSchema as
|
|
2750
|
+
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema3,
|
|
2751
|
+
lazySchema as lazySchema17,
|
|
2752
|
+
zodSchema as zodSchema17
|
|
2656
2753
|
} from "@ai-sdk/provider-utils";
|
|
2657
|
-
import { z as
|
|
2658
|
-
var localShellInputSchema =
|
|
2659
|
-
() =>
|
|
2660
|
-
|
|
2661
|
-
action:
|
|
2662
|
-
type:
|
|
2663
|
-
command:
|
|
2664
|
-
timeoutMs:
|
|
2665
|
-
user:
|
|
2666
|
-
workingDirectory:
|
|
2667
|
-
env:
|
|
2754
|
+
import { z as z18 } from "zod/v4";
|
|
2755
|
+
var localShellInputSchema = lazySchema17(
|
|
2756
|
+
() => zodSchema17(
|
|
2757
|
+
z18.object({
|
|
2758
|
+
action: z18.object({
|
|
2759
|
+
type: z18.literal("exec"),
|
|
2760
|
+
command: z18.array(z18.string()),
|
|
2761
|
+
timeoutMs: z18.number().optional(),
|
|
2762
|
+
user: z18.string().optional(),
|
|
2763
|
+
workingDirectory: z18.string().optional(),
|
|
2764
|
+
env: z18.record(z18.string(), z18.string()).optional()
|
|
2668
2765
|
})
|
|
2669
2766
|
})
|
|
2670
2767
|
)
|
|
2671
2768
|
);
|
|
2672
|
-
var localShellOutputSchema =
|
|
2673
|
-
() =>
|
|
2769
|
+
var localShellOutputSchema = lazySchema17(
|
|
2770
|
+
() => zodSchema17(z18.object({ output: z18.string() }))
|
|
2674
2771
|
);
|
|
2675
|
-
var localShell =
|
|
2772
|
+
var localShell = createProviderDefinedToolFactoryWithOutputSchema3({
|
|
2676
2773
|
id: "openai.local_shell",
|
|
2677
2774
|
inputSchema: localShellInputSchema,
|
|
2678
2775
|
outputSchema: localShellOutputSchema
|
|
@@ -2680,92 +2777,92 @@ var localShell = createProviderDefinedToolFactoryWithOutputSchema2({
|
|
|
2680
2777
|
|
|
2681
2778
|
// src/tool/shell.ts
|
|
2682
2779
|
import {
|
|
2683
|
-
createProviderDefinedToolFactoryWithOutputSchema as
|
|
2684
|
-
lazySchema as
|
|
2685
|
-
zodSchema as
|
|
2780
|
+
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema4,
|
|
2781
|
+
lazySchema as lazySchema18,
|
|
2782
|
+
zodSchema as zodSchema18
|
|
2686
2783
|
} from "@ai-sdk/provider-utils";
|
|
2687
|
-
import { z as
|
|
2688
|
-
var shellInputSchema =
|
|
2689
|
-
() =>
|
|
2690
|
-
|
|
2691
|
-
action:
|
|
2692
|
-
commands:
|
|
2693
|
-
timeoutMs:
|
|
2694
|
-
maxOutputLength:
|
|
2784
|
+
import { z as z19 } from "zod/v4";
|
|
2785
|
+
var shellInputSchema = lazySchema18(
|
|
2786
|
+
() => zodSchema18(
|
|
2787
|
+
z19.object({
|
|
2788
|
+
action: z19.object({
|
|
2789
|
+
commands: z19.array(z19.string()),
|
|
2790
|
+
timeoutMs: z19.number().optional(),
|
|
2791
|
+
maxOutputLength: z19.number().optional()
|
|
2695
2792
|
})
|
|
2696
2793
|
})
|
|
2697
2794
|
)
|
|
2698
2795
|
);
|
|
2699
|
-
var shellOutputSchema =
|
|
2700
|
-
() =>
|
|
2701
|
-
|
|
2702
|
-
output:
|
|
2703
|
-
|
|
2704
|
-
stdout:
|
|
2705
|
-
stderr:
|
|
2706
|
-
outcome:
|
|
2707
|
-
|
|
2708
|
-
|
|
2796
|
+
var shellOutputSchema = lazySchema18(
|
|
2797
|
+
() => zodSchema18(
|
|
2798
|
+
z19.object({
|
|
2799
|
+
output: z19.array(
|
|
2800
|
+
z19.object({
|
|
2801
|
+
stdout: z19.string(),
|
|
2802
|
+
stderr: z19.string(),
|
|
2803
|
+
outcome: z19.discriminatedUnion("type", [
|
|
2804
|
+
z19.object({ type: z19.literal("timeout") }),
|
|
2805
|
+
z19.object({ type: z19.literal("exit"), exitCode: z19.number() })
|
|
2709
2806
|
])
|
|
2710
2807
|
})
|
|
2711
2808
|
)
|
|
2712
2809
|
})
|
|
2713
2810
|
)
|
|
2714
2811
|
);
|
|
2715
|
-
var shellSkillsSchema =
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
type:
|
|
2719
|
-
providerReference:
|
|
2720
|
-
version:
|
|
2812
|
+
var shellSkillsSchema = z19.array(
|
|
2813
|
+
z19.discriminatedUnion("type", [
|
|
2814
|
+
z19.object({
|
|
2815
|
+
type: z19.literal("skillReference"),
|
|
2816
|
+
providerReference: z19.record(z19.string(), z19.string()),
|
|
2817
|
+
version: z19.string().optional()
|
|
2721
2818
|
}),
|
|
2722
|
-
|
|
2723
|
-
type:
|
|
2724
|
-
name:
|
|
2725
|
-
description:
|
|
2726
|
-
source:
|
|
2727
|
-
type:
|
|
2728
|
-
mediaType:
|
|
2729
|
-
data:
|
|
2819
|
+
z19.object({
|
|
2820
|
+
type: z19.literal("inline"),
|
|
2821
|
+
name: z19.string(),
|
|
2822
|
+
description: z19.string(),
|
|
2823
|
+
source: z19.object({
|
|
2824
|
+
type: z19.literal("base64"),
|
|
2825
|
+
mediaType: z19.literal("application/zip"),
|
|
2826
|
+
data: z19.string()
|
|
2730
2827
|
})
|
|
2731
2828
|
})
|
|
2732
2829
|
])
|
|
2733
2830
|
).optional();
|
|
2734
|
-
var shellArgsSchema =
|
|
2735
|
-
() =>
|
|
2736
|
-
|
|
2737
|
-
environment:
|
|
2738
|
-
|
|
2739
|
-
type:
|
|
2740
|
-
fileIds:
|
|
2741
|
-
memoryLimit:
|
|
2742
|
-
networkPolicy:
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
type:
|
|
2746
|
-
allowedDomains:
|
|
2747
|
-
domainSecrets:
|
|
2748
|
-
|
|
2749
|
-
domain:
|
|
2750
|
-
name:
|
|
2751
|
-
value:
|
|
2831
|
+
var shellArgsSchema = lazySchema18(
|
|
2832
|
+
() => zodSchema18(
|
|
2833
|
+
z19.object({
|
|
2834
|
+
environment: z19.union([
|
|
2835
|
+
z19.object({
|
|
2836
|
+
type: z19.literal("containerAuto"),
|
|
2837
|
+
fileIds: z19.array(z19.string()).optional(),
|
|
2838
|
+
memoryLimit: z19.enum(["1g", "4g", "16g", "64g"]).optional(),
|
|
2839
|
+
networkPolicy: z19.discriminatedUnion("type", [
|
|
2840
|
+
z19.object({ type: z19.literal("disabled") }),
|
|
2841
|
+
z19.object({
|
|
2842
|
+
type: z19.literal("allowlist"),
|
|
2843
|
+
allowedDomains: z19.array(z19.string()),
|
|
2844
|
+
domainSecrets: z19.array(
|
|
2845
|
+
z19.object({
|
|
2846
|
+
domain: z19.string(),
|
|
2847
|
+
name: z19.string(),
|
|
2848
|
+
value: z19.string()
|
|
2752
2849
|
})
|
|
2753
2850
|
).optional()
|
|
2754
2851
|
})
|
|
2755
2852
|
]).optional(),
|
|
2756
2853
|
skills: shellSkillsSchema
|
|
2757
2854
|
}),
|
|
2758
|
-
|
|
2759
|
-
type:
|
|
2760
|
-
containerId:
|
|
2855
|
+
z19.object({
|
|
2856
|
+
type: z19.literal("containerReference"),
|
|
2857
|
+
containerId: z19.string()
|
|
2761
2858
|
}),
|
|
2762
|
-
|
|
2763
|
-
type:
|
|
2764
|
-
skills:
|
|
2765
|
-
|
|
2766
|
-
name:
|
|
2767
|
-
description:
|
|
2768
|
-
path:
|
|
2859
|
+
z19.object({
|
|
2860
|
+
type: z19.literal("local").optional(),
|
|
2861
|
+
skills: z19.array(
|
|
2862
|
+
z19.object({
|
|
2863
|
+
name: z19.string(),
|
|
2864
|
+
description: z19.string(),
|
|
2865
|
+
path: z19.string()
|
|
2769
2866
|
})
|
|
2770
2867
|
).optional()
|
|
2771
2868
|
})
|
|
@@ -2773,7 +2870,7 @@ var shellArgsSchema = lazySchema17(
|
|
|
2773
2870
|
})
|
|
2774
2871
|
)
|
|
2775
2872
|
);
|
|
2776
|
-
var shell =
|
|
2873
|
+
var shell = createProviderDefinedToolFactoryWithOutputSchema4({
|
|
2777
2874
|
id: "openai.shell",
|
|
2778
2875
|
inputSchema: shellInputSchema,
|
|
2779
2876
|
outputSchema: shellOutputSchema
|
|
@@ -2781,36 +2878,36 @@ var shell = createProviderDefinedToolFactoryWithOutputSchema3({
|
|
|
2781
2878
|
|
|
2782
2879
|
// src/tool/tool-search.ts
|
|
2783
2880
|
import {
|
|
2784
|
-
createProviderDefinedToolFactoryWithOutputSchema as
|
|
2785
|
-
lazySchema as
|
|
2786
|
-
zodSchema as
|
|
2881
|
+
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema5,
|
|
2882
|
+
lazySchema as lazySchema19,
|
|
2883
|
+
zodSchema as zodSchema19
|
|
2787
2884
|
} from "@ai-sdk/provider-utils";
|
|
2788
|
-
import { z as
|
|
2789
|
-
var toolSearchArgsSchema =
|
|
2790
|
-
() =>
|
|
2791
|
-
|
|
2792
|
-
execution:
|
|
2793
|
-
description:
|
|
2794
|
-
parameters:
|
|
2885
|
+
import { z as z20 } from "zod/v4";
|
|
2886
|
+
var toolSearchArgsSchema = lazySchema19(
|
|
2887
|
+
() => zodSchema19(
|
|
2888
|
+
z20.object({
|
|
2889
|
+
execution: z20.enum(["server", "client"]).optional(),
|
|
2890
|
+
description: z20.string().optional(),
|
|
2891
|
+
parameters: z20.record(z20.string(), z20.unknown()).optional()
|
|
2795
2892
|
})
|
|
2796
2893
|
)
|
|
2797
2894
|
);
|
|
2798
|
-
var toolSearchInputSchema =
|
|
2799
|
-
() =>
|
|
2800
|
-
|
|
2801
|
-
arguments:
|
|
2802
|
-
call_id:
|
|
2895
|
+
var toolSearchInputSchema = lazySchema19(
|
|
2896
|
+
() => zodSchema19(
|
|
2897
|
+
z20.object({
|
|
2898
|
+
arguments: z20.unknown().optional(),
|
|
2899
|
+
call_id: z20.string().nullish()
|
|
2803
2900
|
})
|
|
2804
2901
|
)
|
|
2805
2902
|
);
|
|
2806
|
-
var toolSearchOutputSchema =
|
|
2807
|
-
() =>
|
|
2808
|
-
|
|
2809
|
-
tools:
|
|
2903
|
+
var toolSearchOutputSchema = lazySchema19(
|
|
2904
|
+
() => zodSchema19(
|
|
2905
|
+
z20.object({
|
|
2906
|
+
tools: z20.array(z20.record(z20.string(), z20.unknown()))
|
|
2810
2907
|
})
|
|
2811
2908
|
)
|
|
2812
2909
|
);
|
|
2813
|
-
var toolSearchToolFactory =
|
|
2910
|
+
var toolSearchToolFactory = createProviderDefinedToolFactoryWithOutputSchema5({
|
|
2814
2911
|
id: "openai.tool_search",
|
|
2815
2912
|
inputSchema: toolSearchInputSchema,
|
|
2816
2913
|
outputSchema: toolSearchOutputSchema
|
|
@@ -2820,50 +2917,50 @@ var toolSearch = (args = {}) => toolSearchToolFactory(args);
|
|
|
2820
2917
|
// src/tool/web-search.ts
|
|
2821
2918
|
import {
|
|
2822
2919
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory4,
|
|
2823
|
-
lazySchema as
|
|
2824
|
-
zodSchema as
|
|
2920
|
+
lazySchema as lazySchema20,
|
|
2921
|
+
zodSchema as zodSchema20
|
|
2825
2922
|
} from "@ai-sdk/provider-utils";
|
|
2826
|
-
import { z as
|
|
2827
|
-
var webSearchArgsSchema =
|
|
2828
|
-
() =>
|
|
2829
|
-
|
|
2830
|
-
externalWebAccess:
|
|
2831
|
-
filters:
|
|
2832
|
-
searchContextSize:
|
|
2833
|
-
userLocation:
|
|
2834
|
-
type:
|
|
2835
|
-
country:
|
|
2836
|
-
city:
|
|
2837
|
-
region:
|
|
2838
|
-
timezone:
|
|
2923
|
+
import { z as z21 } from "zod/v4";
|
|
2924
|
+
var webSearchArgsSchema = lazySchema20(
|
|
2925
|
+
() => zodSchema20(
|
|
2926
|
+
z21.object({
|
|
2927
|
+
externalWebAccess: z21.boolean().optional(),
|
|
2928
|
+
filters: z21.object({ allowedDomains: z21.array(z21.string()).optional() }).optional(),
|
|
2929
|
+
searchContextSize: z21.enum(["low", "medium", "high"]).optional(),
|
|
2930
|
+
userLocation: z21.object({
|
|
2931
|
+
type: z21.literal("approximate"),
|
|
2932
|
+
country: z21.string().optional(),
|
|
2933
|
+
city: z21.string().optional(),
|
|
2934
|
+
region: z21.string().optional(),
|
|
2935
|
+
timezone: z21.string().optional()
|
|
2839
2936
|
}).optional()
|
|
2840
2937
|
})
|
|
2841
2938
|
)
|
|
2842
2939
|
);
|
|
2843
|
-
var webSearchInputSchema =
|
|
2844
|
-
var webSearchOutputSchema =
|
|
2845
|
-
() =>
|
|
2846
|
-
|
|
2847
|
-
action:
|
|
2848
|
-
|
|
2849
|
-
type:
|
|
2850
|
-
query:
|
|
2851
|
-
queries:
|
|
2940
|
+
var webSearchInputSchema = lazySchema20(() => zodSchema20(z21.object({})));
|
|
2941
|
+
var webSearchOutputSchema = lazySchema20(
|
|
2942
|
+
() => zodSchema20(
|
|
2943
|
+
z21.object({
|
|
2944
|
+
action: z21.discriminatedUnion("type", [
|
|
2945
|
+
z21.object({
|
|
2946
|
+
type: z21.literal("search"),
|
|
2947
|
+
query: z21.string().optional(),
|
|
2948
|
+
queries: z21.array(z21.string()).optional()
|
|
2852
2949
|
}),
|
|
2853
|
-
|
|
2854
|
-
type:
|
|
2855
|
-
url:
|
|
2950
|
+
z21.object({
|
|
2951
|
+
type: z21.literal("openPage"),
|
|
2952
|
+
url: z21.string().nullish()
|
|
2856
2953
|
}),
|
|
2857
|
-
|
|
2858
|
-
type:
|
|
2859
|
-
url:
|
|
2860
|
-
pattern:
|
|
2954
|
+
z21.object({
|
|
2955
|
+
type: z21.literal("findInPage"),
|
|
2956
|
+
url: z21.string().nullish(),
|
|
2957
|
+
pattern: z21.string().nullish()
|
|
2861
2958
|
})
|
|
2862
2959
|
]).optional(),
|
|
2863
|
-
sources:
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2960
|
+
sources: z21.array(
|
|
2961
|
+
z21.discriminatedUnion("type", [
|
|
2962
|
+
z21.object({ type: z21.literal("url"), url: z21.string() }),
|
|
2963
|
+
z21.object({ type: z21.literal("api"), name: z21.string() })
|
|
2867
2964
|
])
|
|
2868
2965
|
).optional()
|
|
2869
2966
|
})
|
|
@@ -2879,43 +2976,43 @@ var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
|
2879
2976
|
// src/tool/web-search-preview.ts
|
|
2880
2977
|
import {
|
|
2881
2978
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory5,
|
|
2882
|
-
lazySchema as
|
|
2883
|
-
zodSchema as
|
|
2979
|
+
lazySchema as lazySchema21,
|
|
2980
|
+
zodSchema as zodSchema21
|
|
2884
2981
|
} from "@ai-sdk/provider-utils";
|
|
2885
|
-
import { z as
|
|
2886
|
-
var webSearchPreviewArgsSchema =
|
|
2887
|
-
() =>
|
|
2888
|
-
|
|
2889
|
-
searchContextSize:
|
|
2890
|
-
userLocation:
|
|
2891
|
-
type:
|
|
2892
|
-
country:
|
|
2893
|
-
city:
|
|
2894
|
-
region:
|
|
2895
|
-
timezone:
|
|
2982
|
+
import { z as z22 } from "zod/v4";
|
|
2983
|
+
var webSearchPreviewArgsSchema = lazySchema21(
|
|
2984
|
+
() => zodSchema21(
|
|
2985
|
+
z22.object({
|
|
2986
|
+
searchContextSize: z22.enum(["low", "medium", "high"]).optional(),
|
|
2987
|
+
userLocation: z22.object({
|
|
2988
|
+
type: z22.literal("approximate"),
|
|
2989
|
+
country: z22.string().optional(),
|
|
2990
|
+
city: z22.string().optional(),
|
|
2991
|
+
region: z22.string().optional(),
|
|
2992
|
+
timezone: z22.string().optional()
|
|
2896
2993
|
}).optional()
|
|
2897
2994
|
})
|
|
2898
2995
|
)
|
|
2899
2996
|
);
|
|
2900
|
-
var webSearchPreviewInputSchema =
|
|
2901
|
-
() =>
|
|
2997
|
+
var webSearchPreviewInputSchema = lazySchema21(
|
|
2998
|
+
() => zodSchema21(z22.object({}))
|
|
2902
2999
|
);
|
|
2903
|
-
var webSearchPreviewOutputSchema =
|
|
2904
|
-
() =>
|
|
2905
|
-
|
|
2906
|
-
action:
|
|
2907
|
-
|
|
2908
|
-
type:
|
|
2909
|
-
query:
|
|
3000
|
+
var webSearchPreviewOutputSchema = lazySchema21(
|
|
3001
|
+
() => zodSchema21(
|
|
3002
|
+
z22.object({
|
|
3003
|
+
action: z22.discriminatedUnion("type", [
|
|
3004
|
+
z22.object({
|
|
3005
|
+
type: z22.literal("search"),
|
|
3006
|
+
query: z22.string().optional()
|
|
2910
3007
|
}),
|
|
2911
|
-
|
|
2912
|
-
type:
|
|
2913
|
-
url:
|
|
3008
|
+
z22.object({
|
|
3009
|
+
type: z22.literal("openPage"),
|
|
3010
|
+
url: z22.string().nullish()
|
|
2914
3011
|
}),
|
|
2915
|
-
|
|
2916
|
-
type:
|
|
2917
|
-
url:
|
|
2918
|
-
pattern:
|
|
3012
|
+
z22.object({
|
|
3013
|
+
type: z22.literal("findInPage"),
|
|
3014
|
+
url: z22.string().nullish(),
|
|
3015
|
+
pattern: z22.string().nullish()
|
|
2919
3016
|
})
|
|
2920
3017
|
]).optional()
|
|
2921
3018
|
})
|
|
@@ -2930,60 +3027,60 @@ var webSearchPreview = createProviderExecutedToolFactory5({
|
|
|
2930
3027
|
// src/tool/mcp.ts
|
|
2931
3028
|
import {
|
|
2932
3029
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory6,
|
|
2933
|
-
lazySchema as
|
|
2934
|
-
zodSchema as
|
|
3030
|
+
lazySchema as lazySchema22,
|
|
3031
|
+
zodSchema as zodSchema22
|
|
2935
3032
|
} from "@ai-sdk/provider-utils";
|
|
2936
|
-
import { z as
|
|
2937
|
-
var jsonValueSchema =
|
|
2938
|
-
() =>
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
3033
|
+
import { z as z23 } from "zod/v4";
|
|
3034
|
+
var jsonValueSchema = z23.lazy(
|
|
3035
|
+
() => z23.union([
|
|
3036
|
+
z23.string(),
|
|
3037
|
+
z23.number(),
|
|
3038
|
+
z23.boolean(),
|
|
3039
|
+
z23.null(),
|
|
3040
|
+
z23.array(jsonValueSchema),
|
|
3041
|
+
z23.record(z23.string(), jsonValueSchema)
|
|
2945
3042
|
])
|
|
2946
3043
|
);
|
|
2947
|
-
var mcpArgsSchema =
|
|
2948
|
-
() =>
|
|
2949
|
-
|
|
2950
|
-
serverLabel:
|
|
2951
|
-
allowedTools:
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
readOnly:
|
|
2955
|
-
toolNames:
|
|
3044
|
+
var mcpArgsSchema = lazySchema22(
|
|
3045
|
+
() => zodSchema22(
|
|
3046
|
+
z23.object({
|
|
3047
|
+
serverLabel: z23.string(),
|
|
3048
|
+
allowedTools: z23.union([
|
|
3049
|
+
z23.array(z23.string()),
|
|
3050
|
+
z23.object({
|
|
3051
|
+
readOnly: z23.boolean().optional(),
|
|
3052
|
+
toolNames: z23.array(z23.string()).optional()
|
|
2956
3053
|
})
|
|
2957
3054
|
]).optional(),
|
|
2958
|
-
authorization:
|
|
2959
|
-
connectorId:
|
|
2960
|
-
headers:
|
|
2961
|
-
requireApproval:
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
never:
|
|
2965
|
-
toolNames:
|
|
3055
|
+
authorization: z23.string().optional(),
|
|
3056
|
+
connectorId: z23.string().optional(),
|
|
3057
|
+
headers: z23.record(z23.string(), z23.string()).optional(),
|
|
3058
|
+
requireApproval: z23.union([
|
|
3059
|
+
z23.enum(["always", "never"]),
|
|
3060
|
+
z23.object({
|
|
3061
|
+
never: z23.object({
|
|
3062
|
+
toolNames: z23.array(z23.string()).optional()
|
|
2966
3063
|
}).optional()
|
|
2967
3064
|
})
|
|
2968
3065
|
]).optional(),
|
|
2969
|
-
serverDescription:
|
|
2970
|
-
serverUrl:
|
|
3066
|
+
serverDescription: z23.string().optional(),
|
|
3067
|
+
serverUrl: z23.string().optional()
|
|
2971
3068
|
}).refine(
|
|
2972
3069
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
2973
3070
|
"One of serverUrl or connectorId must be provided."
|
|
2974
3071
|
)
|
|
2975
3072
|
)
|
|
2976
3073
|
);
|
|
2977
|
-
var mcpInputSchema =
|
|
2978
|
-
var mcpOutputSchema =
|
|
2979
|
-
() =>
|
|
2980
|
-
|
|
2981
|
-
type:
|
|
2982
|
-
serverLabel:
|
|
2983
|
-
name:
|
|
2984
|
-
arguments:
|
|
2985
|
-
output:
|
|
2986
|
-
error:
|
|
3074
|
+
var mcpInputSchema = lazySchema22(() => zodSchema22(z23.object({})));
|
|
3075
|
+
var mcpOutputSchema = lazySchema22(
|
|
3076
|
+
() => zodSchema22(
|
|
3077
|
+
z23.object({
|
|
3078
|
+
type: z23.literal("call"),
|
|
3079
|
+
serverLabel: z23.string(),
|
|
3080
|
+
name: z23.string(),
|
|
3081
|
+
arguments: z23.string(),
|
|
3082
|
+
output: z23.string().nullish(),
|
|
3083
|
+
error: z23.union([z23.string(), jsonValueSchema]).optional()
|
|
2987
3084
|
})
|
|
2988
3085
|
)
|
|
2989
3086
|
);
|
|
@@ -3021,6 +3118,15 @@ var openaiTools = {
|
|
|
3021
3118
|
* @param container - The container to use for the code interpreter.
|
|
3022
3119
|
*/
|
|
3023
3120
|
codeInterpreter,
|
|
3121
|
+
/**
|
|
3122
|
+
* The computer tool allows models to operate a browser or desktop through
|
|
3123
|
+
* batched UI actions. Your application executes the actions and returns an
|
|
3124
|
+
* updated screenshot.
|
|
3125
|
+
*
|
|
3126
|
+
* WARNING: Run computer use in an isolated environment, treat on-screen
|
|
3127
|
+
* content as untrusted, and require confirmation for consequential actions.
|
|
3128
|
+
*/
|
|
3129
|
+
computer,
|
|
3024
3130
|
/**
|
|
3025
3131
|
* File search is a tool available in the Responses API. It enables models to
|
|
3026
3132
|
* retrieve information in a knowledge base of previously uploaded files through
|
|
@@ -3572,7 +3678,7 @@ import {
|
|
|
3572
3678
|
resolveProviderReference as resolveProviderReference2,
|
|
3573
3679
|
validateTypes
|
|
3574
3680
|
} from "@ai-sdk/provider-utils";
|
|
3575
|
-
import { z as
|
|
3681
|
+
import { z as z24 } from "zod/v4";
|
|
3576
3682
|
function serializeToolCallArguments2(input) {
|
|
3577
3683
|
return JSON.stringify(input === void 0 ? {} : input);
|
|
3578
3684
|
}
|
|
@@ -3597,9 +3703,10 @@ async function convertToOpenAIResponsesInput({
|
|
|
3597
3703
|
hasLocalShellTool = false,
|
|
3598
3704
|
hasShellTool = false,
|
|
3599
3705
|
hasApplyPatchTool = false,
|
|
3706
|
+
hasComputerTool = false,
|
|
3600
3707
|
customProviderToolNames
|
|
3601
3708
|
}) {
|
|
3602
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
3709
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
3603
3710
|
let input = [];
|
|
3604
3711
|
const warnings = [];
|
|
3605
3712
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -3823,7 +3930,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3823
3930
|
if (hasPreviousResponseId && store && id != null) {
|
|
3824
3931
|
break;
|
|
3825
3932
|
}
|
|
3826
|
-
const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || ((_m = customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) != null ? _m : false);
|
|
3933
|
+
const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || hasComputerTool && resolvedToolName === "computer" || ((_m = customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) != null ? _m : false);
|
|
3827
3934
|
if (store && id != null && isProviderDefinedToolCall) {
|
|
3828
3935
|
input.push({ type: "item_reference", id });
|
|
3829
3936
|
break;
|
|
@@ -3880,6 +3987,53 @@ async function convertToOpenAIResponsesInput({
|
|
|
3880
3987
|
});
|
|
3881
3988
|
break;
|
|
3882
3989
|
}
|
|
3990
|
+
if (hasComputerTool && resolvedToolName === "computer") {
|
|
3991
|
+
const parsedInput = await validateTypes({
|
|
3992
|
+
value: part.input,
|
|
3993
|
+
schema: computerInputSchema
|
|
3994
|
+
});
|
|
3995
|
+
input.push({
|
|
3996
|
+
type: "computer_call",
|
|
3997
|
+
call_id: part.toolCallId,
|
|
3998
|
+
id,
|
|
3999
|
+
status: parsedInput.status,
|
|
4000
|
+
actions: parsedInput.actions.map((action) => {
|
|
4001
|
+
switch (action.type) {
|
|
4002
|
+
case "click":
|
|
4003
|
+
case "double_click":
|
|
4004
|
+
case "move":
|
|
4005
|
+
return {
|
|
4006
|
+
...action,
|
|
4007
|
+
keys: action.keys
|
|
4008
|
+
};
|
|
4009
|
+
case "drag":
|
|
4010
|
+
return {
|
|
4011
|
+
...action,
|
|
4012
|
+
keys: action.keys
|
|
4013
|
+
};
|
|
4014
|
+
case "scroll":
|
|
4015
|
+
return {
|
|
4016
|
+
type: "scroll",
|
|
4017
|
+
x: action.x,
|
|
4018
|
+
y: action.y,
|
|
4019
|
+
scroll_x: action.scrollX,
|
|
4020
|
+
scroll_y: action.scrollY,
|
|
4021
|
+
keys: action.keys
|
|
4022
|
+
};
|
|
4023
|
+
default:
|
|
4024
|
+
return action;
|
|
4025
|
+
}
|
|
4026
|
+
}),
|
|
4027
|
+
pending_safety_checks: parsedInput.pendingSafetyChecks.map(
|
|
4028
|
+
(safetyCheck) => ({
|
|
4029
|
+
id: safetyCheck.id,
|
|
4030
|
+
code: safetyCheck.code,
|
|
4031
|
+
message: safetyCheck.message
|
|
4032
|
+
})
|
|
4033
|
+
)
|
|
4034
|
+
});
|
|
4035
|
+
break;
|
|
4036
|
+
}
|
|
3883
4037
|
if (customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) {
|
|
3884
4038
|
input.push({
|
|
3885
4039
|
type: "custom_tool_call",
|
|
@@ -4150,6 +4304,28 @@ async function convertToOpenAIResponsesInput({
|
|
|
4150
4304
|
});
|
|
4151
4305
|
continue;
|
|
4152
4306
|
}
|
|
4307
|
+
if (hasComputerTool && resolvedToolName === "computer" && output.type === "json") {
|
|
4308
|
+
const parsedOutput = await validateTypes({
|
|
4309
|
+
value: output.value,
|
|
4310
|
+
schema: computerOutputSchema
|
|
4311
|
+
});
|
|
4312
|
+
input.push({
|
|
4313
|
+
type: "computer_call_output",
|
|
4314
|
+
call_id: part.toolCallId,
|
|
4315
|
+
output: {
|
|
4316
|
+
type: "computer_screenshot",
|
|
4317
|
+
image_url: parsedOutput.output.imageUrl,
|
|
4318
|
+
file_id: parsedOutput.output.fileId,
|
|
4319
|
+
detail: parsedOutput.output.detail
|
|
4320
|
+
},
|
|
4321
|
+
acknowledged_safety_checks: (_w = parsedOutput.acknowledgedSafetyChecks) == null ? void 0 : _w.map((safetyCheck) => ({
|
|
4322
|
+
id: safetyCheck.id,
|
|
4323
|
+
code: safetyCheck.code,
|
|
4324
|
+
message: safetyCheck.message
|
|
4325
|
+
}))
|
|
4326
|
+
});
|
|
4327
|
+
continue;
|
|
4328
|
+
}
|
|
4153
4329
|
if (customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) {
|
|
4154
4330
|
let outputValue;
|
|
4155
4331
|
switch (output.type) {
|
|
@@ -4158,7 +4334,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
4158
4334
|
outputValue = output.value;
|
|
4159
4335
|
break;
|
|
4160
4336
|
case "execution-denied":
|
|
4161
|
-
outputValue = (
|
|
4337
|
+
outputValue = (_x = output.reason) != null ? _x : "Tool call execution denied.";
|
|
4162
4338
|
break;
|
|
4163
4339
|
case "json":
|
|
4164
4340
|
case "error-json":
|
|
@@ -4257,7 +4433,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
4257
4433
|
contentValue = output.value;
|
|
4258
4434
|
break;
|
|
4259
4435
|
case "execution-denied":
|
|
4260
|
-
contentValue = (
|
|
4436
|
+
contentValue = (_y = output.reason) != null ? _y : "Tool call execution denied.";
|
|
4261
4437
|
break;
|
|
4262
4438
|
case "json":
|
|
4263
4439
|
case "error-json":
|
|
@@ -4369,9 +4545,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
4369
4545
|
}
|
|
4370
4546
|
return { input, warnings };
|
|
4371
4547
|
}
|
|
4372
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
4373
|
-
itemId:
|
|
4374
|
-
reasoningEncryptedContent:
|
|
4548
|
+
var openaiResponsesReasoningProviderOptionsSchema = z24.object({
|
|
4549
|
+
itemId: z24.string().nullish(),
|
|
4550
|
+
reasoningEncryptedContent: z24.string().nullish()
|
|
4375
4551
|
});
|
|
4376
4552
|
|
|
4377
4553
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -4394,589 +4570,643 @@ function mapOpenAIResponseFinishReason({
|
|
|
4394
4570
|
|
|
4395
4571
|
// src/responses/openai-responses-api.ts
|
|
4396
4572
|
import {
|
|
4397
|
-
lazySchema as
|
|
4398
|
-
zodSchema as
|
|
4573
|
+
lazySchema as lazySchema23,
|
|
4574
|
+
zodSchema as zodSchema23
|
|
4399
4575
|
} from "@ai-sdk/provider-utils";
|
|
4400
|
-
import { z as
|
|
4401
|
-
var jsonValueSchema2 =
|
|
4402
|
-
() =>
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4576
|
+
import { z as z25 } from "zod/v4";
|
|
4577
|
+
var jsonValueSchema2 = z25.lazy(
|
|
4578
|
+
() => z25.union([
|
|
4579
|
+
z25.string(),
|
|
4580
|
+
z25.number(),
|
|
4581
|
+
z25.boolean(),
|
|
4582
|
+
z25.null(),
|
|
4583
|
+
z25.array(jsonValueSchema2),
|
|
4584
|
+
z25.record(z25.string(), jsonValueSchema2.optional())
|
|
4409
4585
|
])
|
|
4410
4586
|
);
|
|
4411
|
-
var
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4587
|
+
var openaiResponsesComputerSafetyCheckSchema = z25.object({
|
|
4588
|
+
id: z25.string(),
|
|
4589
|
+
code: z25.string().nullish(),
|
|
4590
|
+
message: z25.string().nullish()
|
|
4591
|
+
});
|
|
4592
|
+
var openaiResponsesComputerActionSchema = z25.discriminatedUnion("type", [
|
|
4593
|
+
z25.object({
|
|
4594
|
+
type: z25.literal("click"),
|
|
4595
|
+
button: z25.enum(["left", "right", "wheel", "back", "forward"]),
|
|
4596
|
+
x: z25.number(),
|
|
4597
|
+
y: z25.number(),
|
|
4598
|
+
keys: z25.array(z25.string()).nullish()
|
|
4599
|
+
}),
|
|
4600
|
+
z25.object({
|
|
4601
|
+
type: z25.literal("double_click"),
|
|
4602
|
+
x: z25.number(),
|
|
4603
|
+
y: z25.number(),
|
|
4604
|
+
keys: z25.array(z25.string()).nullish()
|
|
4605
|
+
}),
|
|
4606
|
+
z25.object({
|
|
4607
|
+
type: z25.literal("drag"),
|
|
4608
|
+
path: z25.array(z25.object({ x: z25.number(), y: z25.number() })),
|
|
4609
|
+
keys: z25.array(z25.string()).nullish()
|
|
4610
|
+
}),
|
|
4611
|
+
z25.object({
|
|
4612
|
+
type: z25.literal("keypress"),
|
|
4613
|
+
keys: z25.array(z25.string())
|
|
4614
|
+
}),
|
|
4615
|
+
z25.object({
|
|
4616
|
+
type: z25.literal("move"),
|
|
4617
|
+
x: z25.number(),
|
|
4618
|
+
y: z25.number(),
|
|
4619
|
+
keys: z25.array(z25.string()).nullish()
|
|
4620
|
+
}),
|
|
4621
|
+
z25.object({
|
|
4622
|
+
type: z25.literal("screenshot")
|
|
4623
|
+
}),
|
|
4624
|
+
z25.object({
|
|
4625
|
+
type: z25.literal("scroll"),
|
|
4626
|
+
x: z25.number(),
|
|
4627
|
+
y: z25.number(),
|
|
4628
|
+
scroll_x: z25.number(),
|
|
4629
|
+
scroll_y: z25.number(),
|
|
4630
|
+
keys: z25.array(z25.string()).nullish()
|
|
4631
|
+
}),
|
|
4632
|
+
z25.object({
|
|
4633
|
+
type: z25.literal("type"),
|
|
4634
|
+
text: z25.string()
|
|
4635
|
+
}),
|
|
4636
|
+
z25.object({
|
|
4637
|
+
type: z25.literal("wait")
|
|
4419
4638
|
})
|
|
4639
|
+
]);
|
|
4640
|
+
var openaiResponsesComputerCallSchema = z25.object({
|
|
4641
|
+
type: z25.literal("computer_call"),
|
|
4642
|
+
id: z25.string(),
|
|
4643
|
+
call_id: z25.string().nullish(),
|
|
4644
|
+
status: z25.enum(["in_progress", "completed", "incomplete"]),
|
|
4645
|
+
action: openaiResponsesComputerActionSchema.nullish(),
|
|
4646
|
+
actions: z25.array(openaiResponsesComputerActionSchema).nullish(),
|
|
4647
|
+
pending_safety_checks: z25.array(openaiResponsesComputerSafetyCheckSchema).nullish()
|
|
4420
4648
|
});
|
|
4421
|
-
var
|
|
4422
|
-
type:
|
|
4423
|
-
sequence_number:
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4649
|
+
var openaiResponsesNestedErrorChunkSchema = z25.object({
|
|
4650
|
+
type: z25.literal("error"),
|
|
4651
|
+
sequence_number: z25.number(),
|
|
4652
|
+
error: z25.object({
|
|
4653
|
+
type: z25.string(),
|
|
4654
|
+
code: z25.string(),
|
|
4655
|
+
message: z25.string(),
|
|
4656
|
+
param: z25.string().nullish()
|
|
4657
|
+
})
|
|
4427
4658
|
});
|
|
4428
|
-
var
|
|
4429
|
-
()
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4659
|
+
var openaiResponsesErrorChunkSchema = z25.object({
|
|
4660
|
+
type: z25.literal("error"),
|
|
4661
|
+
sequence_number: z25.number(),
|
|
4662
|
+
code: z25.string().nullish(),
|
|
4663
|
+
message: z25.string(),
|
|
4664
|
+
param: z25.string().nullish()
|
|
4665
|
+
});
|
|
4666
|
+
var openaiResponsesChunkSchema = lazySchema23(
|
|
4667
|
+
() => zodSchema23(
|
|
4668
|
+
z25.union([
|
|
4669
|
+
z25.object({
|
|
4670
|
+
type: z25.literal("response.output_text.delta"),
|
|
4671
|
+
item_id: z25.string(),
|
|
4672
|
+
delta: z25.string(),
|
|
4673
|
+
logprobs: z25.array(
|
|
4674
|
+
z25.object({
|
|
4675
|
+
token: z25.string(),
|
|
4676
|
+
logprob: z25.number(),
|
|
4677
|
+
top_logprobs: z25.array(
|
|
4678
|
+
z25.object({
|
|
4679
|
+
token: z25.string(),
|
|
4680
|
+
logprob: z25.number()
|
|
4443
4681
|
})
|
|
4444
4682
|
)
|
|
4445
4683
|
})
|
|
4446
4684
|
).nullish()
|
|
4447
4685
|
}),
|
|
4448
|
-
|
|
4449
|
-
type:
|
|
4450
|
-
response:
|
|
4451
|
-
incomplete_details:
|
|
4452
|
-
usage:
|
|
4453
|
-
input_tokens:
|
|
4454
|
-
input_tokens_details:
|
|
4455
|
-
cached_tokens:
|
|
4456
|
-
cache_write_tokens:
|
|
4457
|
-
orchestration_input_tokens:
|
|
4458
|
-
orchestration_input_cached_tokens:
|
|
4686
|
+
z25.object({
|
|
4687
|
+
type: z25.enum(["response.completed", "response.incomplete"]),
|
|
4688
|
+
response: z25.object({
|
|
4689
|
+
incomplete_details: z25.object({ reason: z25.string() }).nullish(),
|
|
4690
|
+
usage: z25.object({
|
|
4691
|
+
input_tokens: z25.number(),
|
|
4692
|
+
input_tokens_details: z25.object({
|
|
4693
|
+
cached_tokens: z25.number().nullish(),
|
|
4694
|
+
cache_write_tokens: z25.number().nullish(),
|
|
4695
|
+
orchestration_input_tokens: z25.number().nullish(),
|
|
4696
|
+
orchestration_input_cached_tokens: z25.number().nullish()
|
|
4459
4697
|
}).nullish(),
|
|
4460
|
-
output_tokens:
|
|
4461
|
-
output_tokens_details:
|
|
4462
|
-
reasoning_tokens:
|
|
4463
|
-
orchestration_output_tokens:
|
|
4698
|
+
output_tokens: z25.number(),
|
|
4699
|
+
output_tokens_details: z25.object({
|
|
4700
|
+
reasoning_tokens: z25.number().nullish(),
|
|
4701
|
+
orchestration_output_tokens: z25.number().nullish()
|
|
4464
4702
|
}).nullish()
|
|
4465
4703
|
}),
|
|
4466
|
-
reasoning:
|
|
4467
|
-
context:
|
|
4704
|
+
reasoning: z25.object({
|
|
4705
|
+
context: z25.string().nullish()
|
|
4468
4706
|
}).nullish(),
|
|
4469
|
-
service_tier:
|
|
4707
|
+
service_tier: z25.string().nullish()
|
|
4470
4708
|
})
|
|
4471
4709
|
}),
|
|
4472
|
-
|
|
4473
|
-
type:
|
|
4474
|
-
sequence_number:
|
|
4475
|
-
response:
|
|
4476
|
-
error:
|
|
4477
|
-
code:
|
|
4478
|
-
message:
|
|
4710
|
+
z25.object({
|
|
4711
|
+
type: z25.literal("response.failed"),
|
|
4712
|
+
sequence_number: z25.number(),
|
|
4713
|
+
response: z25.object({
|
|
4714
|
+
error: z25.object({
|
|
4715
|
+
code: z25.string().nullish(),
|
|
4716
|
+
message: z25.string()
|
|
4479
4717
|
}).nullish(),
|
|
4480
|
-
incomplete_details:
|
|
4481
|
-
usage:
|
|
4482
|
-
input_tokens:
|
|
4483
|
-
input_tokens_details:
|
|
4484
|
-
cached_tokens:
|
|
4485
|
-
cache_write_tokens:
|
|
4486
|
-
orchestration_input_tokens:
|
|
4487
|
-
orchestration_input_cached_tokens:
|
|
4718
|
+
incomplete_details: z25.object({ reason: z25.string() }).nullish(),
|
|
4719
|
+
usage: z25.object({
|
|
4720
|
+
input_tokens: z25.number(),
|
|
4721
|
+
input_tokens_details: z25.object({
|
|
4722
|
+
cached_tokens: z25.number().nullish(),
|
|
4723
|
+
cache_write_tokens: z25.number().nullish(),
|
|
4724
|
+
orchestration_input_tokens: z25.number().nullish(),
|
|
4725
|
+
orchestration_input_cached_tokens: z25.number().nullish()
|
|
4488
4726
|
}).nullish(),
|
|
4489
|
-
output_tokens:
|
|
4490
|
-
output_tokens_details:
|
|
4491
|
-
reasoning_tokens:
|
|
4492
|
-
orchestration_output_tokens:
|
|
4727
|
+
output_tokens: z25.number(),
|
|
4728
|
+
output_tokens_details: z25.object({
|
|
4729
|
+
reasoning_tokens: z25.number().nullish(),
|
|
4730
|
+
orchestration_output_tokens: z25.number().nullish()
|
|
4493
4731
|
}).nullish()
|
|
4494
4732
|
}).nullish(),
|
|
4495
|
-
reasoning:
|
|
4496
|
-
context:
|
|
4733
|
+
reasoning: z25.object({
|
|
4734
|
+
context: z25.string().nullish()
|
|
4497
4735
|
}).nullish(),
|
|
4498
|
-
service_tier:
|
|
4736
|
+
service_tier: z25.string().nullish()
|
|
4499
4737
|
})
|
|
4500
4738
|
}),
|
|
4501
|
-
|
|
4502
|
-
type:
|
|
4503
|
-
response:
|
|
4504
|
-
id:
|
|
4505
|
-
created_at:
|
|
4506
|
-
model:
|
|
4507
|
-
service_tier:
|
|
4739
|
+
z25.object({
|
|
4740
|
+
type: z25.literal("response.created"),
|
|
4741
|
+
response: z25.object({
|
|
4742
|
+
id: z25.string(),
|
|
4743
|
+
created_at: z25.number(),
|
|
4744
|
+
model: z25.string(),
|
|
4745
|
+
service_tier: z25.string().nullish()
|
|
4508
4746
|
})
|
|
4509
4747
|
}),
|
|
4510
|
-
|
|
4511
|
-
type:
|
|
4512
|
-
output_index:
|
|
4513
|
-
item:
|
|
4514
|
-
|
|
4515
|
-
type:
|
|
4516
|
-
id:
|
|
4517
|
-
phase:
|
|
4518
|
-
}),
|
|
4519
|
-
z24.object({
|
|
4520
|
-
type: z24.literal("reasoning"),
|
|
4521
|
-
id: z24.string(),
|
|
4522
|
-
encrypted_content: z24.string().nullish()
|
|
4748
|
+
z25.object({
|
|
4749
|
+
type: z25.literal("response.output_item.added"),
|
|
4750
|
+
output_index: z25.number(),
|
|
4751
|
+
item: z25.discriminatedUnion("type", [
|
|
4752
|
+
z25.object({
|
|
4753
|
+
type: z25.literal("message"),
|
|
4754
|
+
id: z25.string(),
|
|
4755
|
+
phase: z25.enum(["commentary", "final_answer"]).nullish()
|
|
4523
4756
|
}),
|
|
4524
|
-
|
|
4525
|
-
type:
|
|
4526
|
-
id:
|
|
4527
|
-
|
|
4528
|
-
name: z24.string(),
|
|
4529
|
-
arguments: z24.string(),
|
|
4530
|
-
namespace: z24.string().nullish()
|
|
4757
|
+
z25.object({
|
|
4758
|
+
type: z25.literal("reasoning"),
|
|
4759
|
+
id: z25.string(),
|
|
4760
|
+
encrypted_content: z25.string().nullish()
|
|
4531
4761
|
}),
|
|
4532
|
-
|
|
4533
|
-
type:
|
|
4534
|
-
id:
|
|
4535
|
-
|
|
4762
|
+
z25.object({
|
|
4763
|
+
type: z25.literal("function_call"),
|
|
4764
|
+
id: z25.string(),
|
|
4765
|
+
call_id: z25.string(),
|
|
4766
|
+
name: z25.string(),
|
|
4767
|
+
arguments: z25.string(),
|
|
4768
|
+
namespace: z25.string().nullish()
|
|
4536
4769
|
}),
|
|
4537
|
-
|
|
4538
|
-
type:
|
|
4539
|
-
id:
|
|
4540
|
-
status:
|
|
4770
|
+
z25.object({
|
|
4771
|
+
type: z25.literal("web_search_call"),
|
|
4772
|
+
id: z25.string(),
|
|
4773
|
+
status: z25.string()
|
|
4541
4774
|
}),
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4775
|
+
openaiResponsesComputerCallSchema,
|
|
4776
|
+
z25.object({
|
|
4777
|
+
type: z25.literal("file_search_call"),
|
|
4778
|
+
id: z25.string()
|
|
4545
4779
|
}),
|
|
4546
|
-
|
|
4547
|
-
type:
|
|
4548
|
-
id:
|
|
4780
|
+
z25.object({
|
|
4781
|
+
type: z25.literal("image_generation_call"),
|
|
4782
|
+
id: z25.string()
|
|
4549
4783
|
}),
|
|
4550
|
-
|
|
4551
|
-
type:
|
|
4552
|
-
id:
|
|
4553
|
-
container_id:
|
|
4554
|
-
code:
|
|
4555
|
-
outputs:
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4784
|
+
z25.object({
|
|
4785
|
+
type: z25.literal("code_interpreter_call"),
|
|
4786
|
+
id: z25.string(),
|
|
4787
|
+
container_id: z25.string(),
|
|
4788
|
+
code: z25.string().nullable(),
|
|
4789
|
+
outputs: z25.array(
|
|
4790
|
+
z25.discriminatedUnion("type", [
|
|
4791
|
+
z25.object({ type: z25.literal("logs"), logs: z25.string() }),
|
|
4792
|
+
z25.object({ type: z25.literal("image"), url: z25.string() })
|
|
4559
4793
|
])
|
|
4560
4794
|
).nullable(),
|
|
4561
|
-
status:
|
|
4795
|
+
status: z25.string()
|
|
4562
4796
|
}),
|
|
4563
|
-
|
|
4564
|
-
type:
|
|
4565
|
-
id:
|
|
4566
|
-
status:
|
|
4567
|
-
approval_request_id:
|
|
4797
|
+
z25.object({
|
|
4798
|
+
type: z25.literal("mcp_call"),
|
|
4799
|
+
id: z25.string(),
|
|
4800
|
+
status: z25.string(),
|
|
4801
|
+
approval_request_id: z25.string().nullish()
|
|
4568
4802
|
}),
|
|
4569
|
-
|
|
4570
|
-
type:
|
|
4571
|
-
id:
|
|
4803
|
+
z25.object({
|
|
4804
|
+
type: z25.literal("mcp_list_tools"),
|
|
4805
|
+
id: z25.string()
|
|
4572
4806
|
}),
|
|
4573
|
-
|
|
4574
|
-
type:
|
|
4575
|
-
id:
|
|
4807
|
+
z25.object({
|
|
4808
|
+
type: z25.literal("mcp_approval_request"),
|
|
4809
|
+
id: z25.string()
|
|
4576
4810
|
}),
|
|
4577
|
-
|
|
4578
|
-
type:
|
|
4579
|
-
id:
|
|
4580
|
-
call_id:
|
|
4581
|
-
status:
|
|
4582
|
-
operation:
|
|
4583
|
-
|
|
4584
|
-
type:
|
|
4585
|
-
path:
|
|
4586
|
-
diff:
|
|
4811
|
+
z25.object({
|
|
4812
|
+
type: z25.literal("apply_patch_call"),
|
|
4813
|
+
id: z25.string(),
|
|
4814
|
+
call_id: z25.string(),
|
|
4815
|
+
status: z25.enum(["in_progress", "completed"]),
|
|
4816
|
+
operation: z25.discriminatedUnion("type", [
|
|
4817
|
+
z25.object({
|
|
4818
|
+
type: z25.literal("create_file"),
|
|
4819
|
+
path: z25.string(),
|
|
4820
|
+
diff: z25.string()
|
|
4587
4821
|
}),
|
|
4588
|
-
|
|
4589
|
-
type:
|
|
4590
|
-
path:
|
|
4822
|
+
z25.object({
|
|
4823
|
+
type: z25.literal("delete_file"),
|
|
4824
|
+
path: z25.string()
|
|
4591
4825
|
}),
|
|
4592
|
-
|
|
4593
|
-
type:
|
|
4594
|
-
path:
|
|
4595
|
-
diff:
|
|
4826
|
+
z25.object({
|
|
4827
|
+
type: z25.literal("update_file"),
|
|
4828
|
+
path: z25.string(),
|
|
4829
|
+
diff: z25.string()
|
|
4596
4830
|
})
|
|
4597
4831
|
])
|
|
4598
4832
|
}),
|
|
4599
|
-
|
|
4600
|
-
type:
|
|
4601
|
-
id:
|
|
4602
|
-
call_id:
|
|
4603
|
-
name:
|
|
4604
|
-
input:
|
|
4833
|
+
z25.object({
|
|
4834
|
+
type: z25.literal("custom_tool_call"),
|
|
4835
|
+
id: z25.string(),
|
|
4836
|
+
call_id: z25.string(),
|
|
4837
|
+
name: z25.string(),
|
|
4838
|
+
input: z25.string()
|
|
4605
4839
|
}),
|
|
4606
|
-
|
|
4607
|
-
type:
|
|
4608
|
-
id:
|
|
4609
|
-
call_id:
|
|
4610
|
-
status:
|
|
4611
|
-
action:
|
|
4612
|
-
commands:
|
|
4840
|
+
z25.object({
|
|
4841
|
+
type: z25.literal("shell_call"),
|
|
4842
|
+
id: z25.string(),
|
|
4843
|
+
call_id: z25.string(),
|
|
4844
|
+
status: z25.enum(["in_progress", "completed", "incomplete"]),
|
|
4845
|
+
action: z25.object({
|
|
4846
|
+
commands: z25.array(z25.string())
|
|
4613
4847
|
})
|
|
4614
4848
|
}),
|
|
4615
|
-
|
|
4616
|
-
type:
|
|
4617
|
-
id:
|
|
4618
|
-
encrypted_content:
|
|
4849
|
+
z25.object({
|
|
4850
|
+
type: z25.literal("compaction"),
|
|
4851
|
+
id: z25.string(),
|
|
4852
|
+
encrypted_content: z25.string().nullish()
|
|
4619
4853
|
}),
|
|
4620
|
-
|
|
4621
|
-
type:
|
|
4622
|
-
id:
|
|
4623
|
-
call_id:
|
|
4624
|
-
status:
|
|
4625
|
-
output:
|
|
4626
|
-
|
|
4627
|
-
stdout:
|
|
4628
|
-
stderr:
|
|
4629
|
-
outcome:
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
type:
|
|
4633
|
-
exit_code:
|
|
4854
|
+
z25.object({
|
|
4855
|
+
type: z25.literal("shell_call_output"),
|
|
4856
|
+
id: z25.string(),
|
|
4857
|
+
call_id: z25.string(),
|
|
4858
|
+
status: z25.enum(["in_progress", "completed", "incomplete"]),
|
|
4859
|
+
output: z25.array(
|
|
4860
|
+
z25.object({
|
|
4861
|
+
stdout: z25.string(),
|
|
4862
|
+
stderr: z25.string(),
|
|
4863
|
+
outcome: z25.discriminatedUnion("type", [
|
|
4864
|
+
z25.object({ type: z25.literal("timeout") }),
|
|
4865
|
+
z25.object({
|
|
4866
|
+
type: z25.literal("exit"),
|
|
4867
|
+
exit_code: z25.number()
|
|
4634
4868
|
})
|
|
4635
4869
|
])
|
|
4636
4870
|
})
|
|
4637
4871
|
)
|
|
4638
4872
|
}),
|
|
4639
|
-
|
|
4640
|
-
type:
|
|
4641
|
-
id:
|
|
4642
|
-
execution:
|
|
4643
|
-
call_id:
|
|
4644
|
-
status:
|
|
4645
|
-
arguments:
|
|
4873
|
+
z25.object({
|
|
4874
|
+
type: z25.literal("tool_search_call"),
|
|
4875
|
+
id: z25.string(),
|
|
4876
|
+
execution: z25.enum(["server", "client"]),
|
|
4877
|
+
call_id: z25.string().nullable(),
|
|
4878
|
+
status: z25.enum(["in_progress", "completed", "incomplete"]),
|
|
4879
|
+
arguments: z25.unknown()
|
|
4646
4880
|
}),
|
|
4647
|
-
|
|
4648
|
-
type:
|
|
4649
|
-
id:
|
|
4650
|
-
execution:
|
|
4651
|
-
call_id:
|
|
4652
|
-
status:
|
|
4653
|
-
tools:
|
|
4881
|
+
z25.object({
|
|
4882
|
+
type: z25.literal("tool_search_output"),
|
|
4883
|
+
id: z25.string(),
|
|
4884
|
+
execution: z25.enum(["server", "client"]),
|
|
4885
|
+
call_id: z25.string().nullable(),
|
|
4886
|
+
status: z25.enum(["in_progress", "completed", "incomplete"]),
|
|
4887
|
+
tools: z25.array(z25.record(z25.string(), jsonValueSchema2.optional()))
|
|
4654
4888
|
})
|
|
4655
4889
|
])
|
|
4656
4890
|
}),
|
|
4657
|
-
|
|
4658
|
-
type:
|
|
4659
|
-
output_index:
|
|
4660
|
-
item:
|
|
4661
|
-
|
|
4662
|
-
type:
|
|
4663
|
-
id:
|
|
4664
|
-
phase:
|
|
4891
|
+
z25.object({
|
|
4892
|
+
type: z25.literal("response.output_item.done"),
|
|
4893
|
+
output_index: z25.number(),
|
|
4894
|
+
item: z25.discriminatedUnion("type", [
|
|
4895
|
+
z25.object({
|
|
4896
|
+
type: z25.literal("message"),
|
|
4897
|
+
id: z25.string(),
|
|
4898
|
+
phase: z25.enum(["commentary", "final_answer"]).nullish()
|
|
4665
4899
|
}),
|
|
4666
|
-
|
|
4667
|
-
type:
|
|
4668
|
-
id:
|
|
4669
|
-
encrypted_content:
|
|
4900
|
+
z25.object({
|
|
4901
|
+
type: z25.literal("reasoning"),
|
|
4902
|
+
id: z25.string(),
|
|
4903
|
+
encrypted_content: z25.string().nullish()
|
|
4670
4904
|
}),
|
|
4671
|
-
|
|
4672
|
-
type:
|
|
4673
|
-
id:
|
|
4674
|
-
call_id:
|
|
4675
|
-
name:
|
|
4676
|
-
arguments:
|
|
4677
|
-
status:
|
|
4678
|
-
namespace:
|
|
4905
|
+
z25.object({
|
|
4906
|
+
type: z25.literal("function_call"),
|
|
4907
|
+
id: z25.string(),
|
|
4908
|
+
call_id: z25.string(),
|
|
4909
|
+
name: z25.string(),
|
|
4910
|
+
arguments: z25.string(),
|
|
4911
|
+
status: z25.literal("completed"),
|
|
4912
|
+
namespace: z25.string().nullish()
|
|
4679
4913
|
}),
|
|
4680
|
-
|
|
4681
|
-
type:
|
|
4682
|
-
id:
|
|
4683
|
-
call_id:
|
|
4684
|
-
name:
|
|
4685
|
-
input:
|
|
4686
|
-
status:
|
|
4914
|
+
z25.object({
|
|
4915
|
+
type: z25.literal("custom_tool_call"),
|
|
4916
|
+
id: z25.string(),
|
|
4917
|
+
call_id: z25.string(),
|
|
4918
|
+
name: z25.string(),
|
|
4919
|
+
input: z25.string(),
|
|
4920
|
+
status: z25.literal("completed")
|
|
4687
4921
|
}),
|
|
4688
|
-
|
|
4689
|
-
type:
|
|
4690
|
-
id:
|
|
4691
|
-
code:
|
|
4692
|
-
container_id:
|
|
4693
|
-
outputs:
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4922
|
+
z25.object({
|
|
4923
|
+
type: z25.literal("code_interpreter_call"),
|
|
4924
|
+
id: z25.string(),
|
|
4925
|
+
code: z25.string().nullable(),
|
|
4926
|
+
container_id: z25.string(),
|
|
4927
|
+
outputs: z25.array(
|
|
4928
|
+
z25.discriminatedUnion("type", [
|
|
4929
|
+
z25.object({ type: z25.literal("logs"), logs: z25.string() }),
|
|
4930
|
+
z25.object({ type: z25.literal("image"), url: z25.string() })
|
|
4697
4931
|
])
|
|
4698
4932
|
).nullable()
|
|
4699
4933
|
}),
|
|
4700
|
-
|
|
4701
|
-
type:
|
|
4702
|
-
id:
|
|
4703
|
-
result:
|
|
4934
|
+
z25.object({
|
|
4935
|
+
type: z25.literal("image_generation_call"),
|
|
4936
|
+
id: z25.string(),
|
|
4937
|
+
result: z25.string()
|
|
4704
4938
|
}),
|
|
4705
|
-
|
|
4706
|
-
type:
|
|
4707
|
-
id:
|
|
4708
|
-
status:
|
|
4709
|
-
action:
|
|
4710
|
-
|
|
4711
|
-
type:
|
|
4712
|
-
query:
|
|
4713
|
-
queries:
|
|
4714
|
-
sources:
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4939
|
+
z25.object({
|
|
4940
|
+
type: z25.literal("web_search_call"),
|
|
4941
|
+
id: z25.string(),
|
|
4942
|
+
status: z25.string(),
|
|
4943
|
+
action: z25.discriminatedUnion("type", [
|
|
4944
|
+
z25.object({
|
|
4945
|
+
type: z25.literal("search"),
|
|
4946
|
+
query: z25.string().nullish(),
|
|
4947
|
+
queries: z25.array(z25.string()).nullish(),
|
|
4948
|
+
sources: z25.array(
|
|
4949
|
+
z25.discriminatedUnion("type", [
|
|
4950
|
+
z25.object({ type: z25.literal("url"), url: z25.string() }),
|
|
4951
|
+
z25.object({ type: z25.literal("api"), name: z25.string() })
|
|
4718
4952
|
])
|
|
4719
4953
|
).nullish()
|
|
4720
4954
|
}),
|
|
4721
|
-
|
|
4722
|
-
type:
|
|
4723
|
-
url:
|
|
4955
|
+
z25.object({
|
|
4956
|
+
type: z25.literal("open_page"),
|
|
4957
|
+
url: z25.string().nullish()
|
|
4724
4958
|
}),
|
|
4725
|
-
|
|
4726
|
-
type:
|
|
4727
|
-
url:
|
|
4728
|
-
pattern:
|
|
4959
|
+
z25.object({
|
|
4960
|
+
type: z25.literal("find_in_page"),
|
|
4961
|
+
url: z25.string().nullish(),
|
|
4962
|
+
pattern: z25.string().nullish()
|
|
4729
4963
|
})
|
|
4730
4964
|
]).nullish()
|
|
4731
4965
|
}),
|
|
4732
|
-
|
|
4733
|
-
type:
|
|
4734
|
-
id:
|
|
4735
|
-
queries:
|
|
4736
|
-
results:
|
|
4737
|
-
|
|
4738
|
-
attributes:
|
|
4739
|
-
|
|
4740
|
-
|
|
4966
|
+
z25.object({
|
|
4967
|
+
type: z25.literal("file_search_call"),
|
|
4968
|
+
id: z25.string(),
|
|
4969
|
+
queries: z25.array(z25.string()),
|
|
4970
|
+
results: z25.array(
|
|
4971
|
+
z25.object({
|
|
4972
|
+
attributes: z25.record(
|
|
4973
|
+
z25.string(),
|
|
4974
|
+
z25.union([z25.string(), z25.number(), z25.boolean()])
|
|
4741
4975
|
),
|
|
4742
|
-
file_id:
|
|
4743
|
-
filename:
|
|
4744
|
-
score:
|
|
4745
|
-
text:
|
|
4976
|
+
file_id: z25.string(),
|
|
4977
|
+
filename: z25.string(),
|
|
4978
|
+
score: z25.number(),
|
|
4979
|
+
text: z25.string()
|
|
4746
4980
|
})
|
|
4747
4981
|
).nullish()
|
|
4748
4982
|
}),
|
|
4749
|
-
|
|
4750
|
-
type:
|
|
4751
|
-
id:
|
|
4752
|
-
call_id:
|
|
4753
|
-
action:
|
|
4754
|
-
type:
|
|
4755
|
-
command:
|
|
4756
|
-
timeout_ms:
|
|
4757
|
-
user:
|
|
4758
|
-
working_directory:
|
|
4759
|
-
env:
|
|
4983
|
+
z25.object({
|
|
4984
|
+
type: z25.literal("local_shell_call"),
|
|
4985
|
+
id: z25.string(),
|
|
4986
|
+
call_id: z25.string(),
|
|
4987
|
+
action: z25.object({
|
|
4988
|
+
type: z25.literal("exec"),
|
|
4989
|
+
command: z25.array(z25.string()),
|
|
4990
|
+
timeout_ms: z25.number().optional(),
|
|
4991
|
+
user: z25.string().optional(),
|
|
4992
|
+
working_directory: z25.string().optional(),
|
|
4993
|
+
env: z25.record(z25.string(), z25.string()).optional()
|
|
4760
4994
|
})
|
|
4761
4995
|
}),
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
z24.object({
|
|
4778
|
-
type: z24.string().optional(),
|
|
4779
|
-
code: z24.union([z24.number(), z24.string()]).optional(),
|
|
4780
|
-
message: z24.string().optional()
|
|
4996
|
+
openaiResponsesComputerCallSchema,
|
|
4997
|
+
z25.object({
|
|
4998
|
+
type: z25.literal("mcp_call"),
|
|
4999
|
+
id: z25.string(),
|
|
5000
|
+
status: z25.string(),
|
|
5001
|
+
arguments: z25.string(),
|
|
5002
|
+
name: z25.string(),
|
|
5003
|
+
server_label: z25.string(),
|
|
5004
|
+
output: z25.string().nullish(),
|
|
5005
|
+
error: z25.union([
|
|
5006
|
+
z25.string(),
|
|
5007
|
+
z25.object({
|
|
5008
|
+
type: z25.string().optional(),
|
|
5009
|
+
code: z25.union([z25.number(), z25.string()]).optional(),
|
|
5010
|
+
message: z25.string().optional()
|
|
4781
5011
|
}).loose()
|
|
4782
5012
|
]).nullish(),
|
|
4783
|
-
approval_request_id:
|
|
5013
|
+
approval_request_id: z25.string().nullish()
|
|
4784
5014
|
}),
|
|
4785
|
-
|
|
4786
|
-
type:
|
|
4787
|
-
id:
|
|
4788
|
-
server_label:
|
|
4789
|
-
tools:
|
|
4790
|
-
|
|
4791
|
-
name:
|
|
4792
|
-
description:
|
|
4793
|
-
input_schema:
|
|
4794
|
-
annotations:
|
|
5015
|
+
z25.object({
|
|
5016
|
+
type: z25.literal("mcp_list_tools"),
|
|
5017
|
+
id: z25.string(),
|
|
5018
|
+
server_label: z25.string(),
|
|
5019
|
+
tools: z25.array(
|
|
5020
|
+
z25.object({
|
|
5021
|
+
name: z25.string(),
|
|
5022
|
+
description: z25.string().optional(),
|
|
5023
|
+
input_schema: z25.any(),
|
|
5024
|
+
annotations: z25.record(z25.string(), z25.unknown()).optional()
|
|
4795
5025
|
})
|
|
4796
5026
|
),
|
|
4797
|
-
error:
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
type:
|
|
4801
|
-
code:
|
|
4802
|
-
message:
|
|
5027
|
+
error: z25.union([
|
|
5028
|
+
z25.string(),
|
|
5029
|
+
z25.object({
|
|
5030
|
+
type: z25.string().optional(),
|
|
5031
|
+
code: z25.union([z25.number(), z25.string()]).optional(),
|
|
5032
|
+
message: z25.string().optional()
|
|
4803
5033
|
}).loose()
|
|
4804
5034
|
]).optional()
|
|
4805
5035
|
}),
|
|
4806
|
-
|
|
4807
|
-
type:
|
|
4808
|
-
id:
|
|
4809
|
-
server_label:
|
|
4810
|
-
name:
|
|
4811
|
-
arguments:
|
|
4812
|
-
approval_request_id:
|
|
5036
|
+
z25.object({
|
|
5037
|
+
type: z25.literal("mcp_approval_request"),
|
|
5038
|
+
id: z25.string(),
|
|
5039
|
+
server_label: z25.string(),
|
|
5040
|
+
name: z25.string(),
|
|
5041
|
+
arguments: z25.string(),
|
|
5042
|
+
approval_request_id: z25.string().optional()
|
|
4813
5043
|
}),
|
|
4814
|
-
|
|
4815
|
-
type:
|
|
4816
|
-
id:
|
|
4817
|
-
call_id:
|
|
4818
|
-
status:
|
|
4819
|
-
operation:
|
|
4820
|
-
|
|
4821
|
-
type:
|
|
4822
|
-
path:
|
|
4823
|
-
diff:
|
|
5044
|
+
z25.object({
|
|
5045
|
+
type: z25.literal("apply_patch_call"),
|
|
5046
|
+
id: z25.string(),
|
|
5047
|
+
call_id: z25.string(),
|
|
5048
|
+
status: z25.enum(["in_progress", "completed"]),
|
|
5049
|
+
operation: z25.discriminatedUnion("type", [
|
|
5050
|
+
z25.object({
|
|
5051
|
+
type: z25.literal("create_file"),
|
|
5052
|
+
path: z25.string(),
|
|
5053
|
+
diff: z25.string()
|
|
4824
5054
|
}),
|
|
4825
|
-
|
|
4826
|
-
type:
|
|
4827
|
-
path:
|
|
5055
|
+
z25.object({
|
|
5056
|
+
type: z25.literal("delete_file"),
|
|
5057
|
+
path: z25.string()
|
|
4828
5058
|
}),
|
|
4829
|
-
|
|
4830
|
-
type:
|
|
4831
|
-
path:
|
|
4832
|
-
diff:
|
|
5059
|
+
z25.object({
|
|
5060
|
+
type: z25.literal("update_file"),
|
|
5061
|
+
path: z25.string(),
|
|
5062
|
+
diff: z25.string()
|
|
4833
5063
|
})
|
|
4834
5064
|
])
|
|
4835
5065
|
}),
|
|
4836
|
-
|
|
4837
|
-
type:
|
|
4838
|
-
id:
|
|
4839
|
-
call_id:
|
|
4840
|
-
status:
|
|
4841
|
-
action:
|
|
4842
|
-
commands:
|
|
5066
|
+
z25.object({
|
|
5067
|
+
type: z25.literal("shell_call"),
|
|
5068
|
+
id: z25.string(),
|
|
5069
|
+
call_id: z25.string(),
|
|
5070
|
+
status: z25.enum(["in_progress", "completed", "incomplete"]),
|
|
5071
|
+
action: z25.object({
|
|
5072
|
+
commands: z25.array(z25.string())
|
|
4843
5073
|
})
|
|
4844
5074
|
}),
|
|
4845
|
-
|
|
4846
|
-
type:
|
|
4847
|
-
id:
|
|
4848
|
-
encrypted_content:
|
|
5075
|
+
z25.object({
|
|
5076
|
+
type: z25.literal("compaction"),
|
|
5077
|
+
id: z25.string(),
|
|
5078
|
+
encrypted_content: z25.string()
|
|
4849
5079
|
}),
|
|
4850
|
-
|
|
4851
|
-
type:
|
|
4852
|
-
id:
|
|
4853
|
-
call_id:
|
|
4854
|
-
status:
|
|
4855
|
-
output:
|
|
4856
|
-
|
|
4857
|
-
stdout:
|
|
4858
|
-
stderr:
|
|
4859
|
-
outcome:
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
type:
|
|
4863
|
-
exit_code:
|
|
5080
|
+
z25.object({
|
|
5081
|
+
type: z25.literal("shell_call_output"),
|
|
5082
|
+
id: z25.string(),
|
|
5083
|
+
call_id: z25.string(),
|
|
5084
|
+
status: z25.enum(["in_progress", "completed", "incomplete"]),
|
|
5085
|
+
output: z25.array(
|
|
5086
|
+
z25.object({
|
|
5087
|
+
stdout: z25.string(),
|
|
5088
|
+
stderr: z25.string(),
|
|
5089
|
+
outcome: z25.discriminatedUnion("type", [
|
|
5090
|
+
z25.object({ type: z25.literal("timeout") }),
|
|
5091
|
+
z25.object({
|
|
5092
|
+
type: z25.literal("exit"),
|
|
5093
|
+
exit_code: z25.number()
|
|
4864
5094
|
})
|
|
4865
5095
|
])
|
|
4866
5096
|
})
|
|
4867
5097
|
)
|
|
4868
5098
|
}),
|
|
4869
|
-
|
|
4870
|
-
type:
|
|
4871
|
-
id:
|
|
4872
|
-
execution:
|
|
4873
|
-
call_id:
|
|
4874
|
-
status:
|
|
4875
|
-
arguments:
|
|
5099
|
+
z25.object({
|
|
5100
|
+
type: z25.literal("tool_search_call"),
|
|
5101
|
+
id: z25.string(),
|
|
5102
|
+
execution: z25.enum(["server", "client"]),
|
|
5103
|
+
call_id: z25.string().nullable(),
|
|
5104
|
+
status: z25.enum(["in_progress", "completed", "incomplete"]),
|
|
5105
|
+
arguments: z25.unknown()
|
|
4876
5106
|
}),
|
|
4877
|
-
|
|
4878
|
-
type:
|
|
4879
|
-
id:
|
|
4880
|
-
execution:
|
|
4881
|
-
call_id:
|
|
4882
|
-
status:
|
|
4883
|
-
tools:
|
|
5107
|
+
z25.object({
|
|
5108
|
+
type: z25.literal("tool_search_output"),
|
|
5109
|
+
id: z25.string(),
|
|
5110
|
+
execution: z25.enum(["server", "client"]),
|
|
5111
|
+
call_id: z25.string().nullable(),
|
|
5112
|
+
status: z25.enum(["in_progress", "completed", "incomplete"]),
|
|
5113
|
+
tools: z25.array(z25.record(z25.string(), jsonValueSchema2.optional()))
|
|
4884
5114
|
})
|
|
4885
5115
|
])
|
|
4886
5116
|
}),
|
|
4887
|
-
|
|
4888
|
-
type:
|
|
4889
|
-
item_id:
|
|
4890
|
-
output_index:
|
|
4891
|
-
delta:
|
|
5117
|
+
z25.object({
|
|
5118
|
+
type: z25.literal("response.function_call_arguments.delta"),
|
|
5119
|
+
item_id: z25.string(),
|
|
5120
|
+
output_index: z25.number(),
|
|
5121
|
+
delta: z25.string()
|
|
4892
5122
|
}),
|
|
4893
|
-
|
|
4894
|
-
type:
|
|
4895
|
-
item_id:
|
|
4896
|
-
output_index:
|
|
4897
|
-
delta:
|
|
5123
|
+
z25.object({
|
|
5124
|
+
type: z25.literal("response.custom_tool_call_input.delta"),
|
|
5125
|
+
item_id: z25.string(),
|
|
5126
|
+
output_index: z25.number(),
|
|
5127
|
+
delta: z25.string()
|
|
4898
5128
|
}),
|
|
4899
|
-
|
|
4900
|
-
type:
|
|
4901
|
-
item_id:
|
|
4902
|
-
output_index:
|
|
4903
|
-
partial_image_b64:
|
|
5129
|
+
z25.object({
|
|
5130
|
+
type: z25.literal("response.image_generation_call.partial_image"),
|
|
5131
|
+
item_id: z25.string(),
|
|
5132
|
+
output_index: z25.number(),
|
|
5133
|
+
partial_image_b64: z25.string()
|
|
4904
5134
|
}),
|
|
4905
|
-
|
|
4906
|
-
type:
|
|
4907
|
-
item_id:
|
|
4908
|
-
output_index:
|
|
4909
|
-
delta:
|
|
5135
|
+
z25.object({
|
|
5136
|
+
type: z25.literal("response.code_interpreter_call_code.delta"),
|
|
5137
|
+
item_id: z25.string(),
|
|
5138
|
+
output_index: z25.number(),
|
|
5139
|
+
delta: z25.string()
|
|
4910
5140
|
}),
|
|
4911
|
-
|
|
4912
|
-
type:
|
|
4913
|
-
item_id:
|
|
4914
|
-
output_index:
|
|
4915
|
-
code:
|
|
5141
|
+
z25.object({
|
|
5142
|
+
type: z25.literal("response.code_interpreter_call_code.done"),
|
|
5143
|
+
item_id: z25.string(),
|
|
5144
|
+
output_index: z25.number(),
|
|
5145
|
+
code: z25.string()
|
|
4916
5146
|
}),
|
|
4917
|
-
|
|
4918
|
-
type:
|
|
4919
|
-
annotation:
|
|
4920
|
-
|
|
4921
|
-
type:
|
|
4922
|
-
start_index:
|
|
4923
|
-
end_index:
|
|
4924
|
-
url:
|
|
4925
|
-
title:
|
|
5147
|
+
z25.object({
|
|
5148
|
+
type: z25.literal("response.output_text.annotation.added"),
|
|
5149
|
+
annotation: z25.discriminatedUnion("type", [
|
|
5150
|
+
z25.object({
|
|
5151
|
+
type: z25.literal("url_citation"),
|
|
5152
|
+
start_index: z25.number(),
|
|
5153
|
+
end_index: z25.number(),
|
|
5154
|
+
url: z25.string(),
|
|
5155
|
+
title: z25.string()
|
|
4926
5156
|
}),
|
|
4927
|
-
|
|
4928
|
-
type:
|
|
4929
|
-
file_id:
|
|
4930
|
-
filename:
|
|
4931
|
-
index:
|
|
5157
|
+
z25.object({
|
|
5158
|
+
type: z25.literal("file_citation"),
|
|
5159
|
+
file_id: z25.string(),
|
|
5160
|
+
filename: z25.string(),
|
|
5161
|
+
index: z25.number()
|
|
4932
5162
|
}),
|
|
4933
|
-
|
|
4934
|
-
type:
|
|
4935
|
-
container_id:
|
|
4936
|
-
file_id:
|
|
4937
|
-
filename:
|
|
4938
|
-
start_index:
|
|
4939
|
-
end_index:
|
|
5163
|
+
z25.object({
|
|
5164
|
+
type: z25.literal("container_file_citation"),
|
|
5165
|
+
container_id: z25.string(),
|
|
5166
|
+
file_id: z25.string(),
|
|
5167
|
+
filename: z25.string(),
|
|
5168
|
+
start_index: z25.number(),
|
|
5169
|
+
end_index: z25.number()
|
|
4940
5170
|
}),
|
|
4941
|
-
|
|
4942
|
-
type:
|
|
4943
|
-
file_id:
|
|
4944
|
-
index:
|
|
5171
|
+
z25.object({
|
|
5172
|
+
type: z25.literal("file_path"),
|
|
5173
|
+
file_id: z25.string(),
|
|
5174
|
+
index: z25.number()
|
|
4945
5175
|
})
|
|
4946
5176
|
])
|
|
4947
5177
|
}),
|
|
4948
|
-
|
|
4949
|
-
type:
|
|
4950
|
-
item_id:
|
|
4951
|
-
summary_index:
|
|
5178
|
+
z25.object({
|
|
5179
|
+
type: z25.literal("response.reasoning_summary_part.added"),
|
|
5180
|
+
item_id: z25.string(),
|
|
5181
|
+
summary_index: z25.number()
|
|
4952
5182
|
}),
|
|
4953
|
-
|
|
4954
|
-
type:
|
|
4955
|
-
item_id:
|
|
4956
|
-
summary_index:
|
|
4957
|
-
delta:
|
|
5183
|
+
z25.object({
|
|
5184
|
+
type: z25.literal("response.reasoning_summary_text.delta"),
|
|
5185
|
+
item_id: z25.string(),
|
|
5186
|
+
summary_index: z25.number(),
|
|
5187
|
+
delta: z25.string()
|
|
4958
5188
|
}),
|
|
4959
|
-
|
|
4960
|
-
type:
|
|
4961
|
-
item_id:
|
|
4962
|
-
summary_index:
|
|
5189
|
+
z25.object({
|
|
5190
|
+
type: z25.literal("response.reasoning_summary_part.done"),
|
|
5191
|
+
item_id: z25.string(),
|
|
5192
|
+
summary_index: z25.number()
|
|
4963
5193
|
}),
|
|
4964
|
-
|
|
4965
|
-
type:
|
|
4966
|
-
item_id:
|
|
4967
|
-
output_index:
|
|
4968
|
-
delta:
|
|
4969
|
-
obfuscation:
|
|
5194
|
+
z25.object({
|
|
5195
|
+
type: z25.literal("response.apply_patch_call_operation_diff.delta"),
|
|
5196
|
+
item_id: z25.string(),
|
|
5197
|
+
output_index: z25.number(),
|
|
5198
|
+
delta: z25.string(),
|
|
5199
|
+
obfuscation: z25.string().nullish()
|
|
4970
5200
|
}),
|
|
4971
|
-
|
|
4972
|
-
type:
|
|
4973
|
-
item_id:
|
|
4974
|
-
output_index:
|
|
4975
|
-
diff:
|
|
5201
|
+
z25.object({
|
|
5202
|
+
type: z25.literal("response.apply_patch_call_operation_diff.done"),
|
|
5203
|
+
item_id: z25.string(),
|
|
5204
|
+
output_index: z25.number(),
|
|
5205
|
+
diff: z25.string()
|
|
4976
5206
|
}),
|
|
4977
5207
|
openaiResponsesNestedErrorChunkSchema,
|
|
4978
5208
|
openaiResponsesErrorChunkSchema,
|
|
4979
|
-
|
|
5209
|
+
z25.object({ type: z25.string() }).loose().transform((value) => ({
|
|
4980
5210
|
type: "unknown_chunk",
|
|
4981
5211
|
message: value.type
|
|
4982
5212
|
}))
|
|
@@ -4984,319 +5214,315 @@ var openaiResponsesChunkSchema = lazySchema22(
|
|
|
4984
5214
|
])
|
|
4985
5215
|
)
|
|
4986
5216
|
);
|
|
4987
|
-
var openaiResponsesResponseSchema =
|
|
4988
|
-
() =>
|
|
4989
|
-
|
|
4990
|
-
id:
|
|
4991
|
-
created_at:
|
|
4992
|
-
error:
|
|
4993
|
-
message:
|
|
4994
|
-
type:
|
|
4995
|
-
param:
|
|
4996
|
-
code:
|
|
5217
|
+
var openaiResponsesResponseSchema = lazySchema23(
|
|
5218
|
+
() => zodSchema23(
|
|
5219
|
+
z25.object({
|
|
5220
|
+
id: z25.string().optional(),
|
|
5221
|
+
created_at: z25.number().optional(),
|
|
5222
|
+
error: z25.object({
|
|
5223
|
+
message: z25.string(),
|
|
5224
|
+
type: z25.string(),
|
|
5225
|
+
param: z25.string().nullish(),
|
|
5226
|
+
code: z25.string()
|
|
4997
5227
|
}).nullish(),
|
|
4998
|
-
model:
|
|
4999
|
-
output:
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
type:
|
|
5003
|
-
role:
|
|
5004
|
-
id:
|
|
5005
|
-
phase:
|
|
5006
|
-
content:
|
|
5007
|
-
|
|
5008
|
-
type:
|
|
5009
|
-
text:
|
|
5010
|
-
logprobs:
|
|
5011
|
-
|
|
5012
|
-
token:
|
|
5013
|
-
logprob:
|
|
5014
|
-
top_logprobs:
|
|
5015
|
-
|
|
5016
|
-
token:
|
|
5017
|
-
logprob:
|
|
5228
|
+
model: z25.string().optional(),
|
|
5229
|
+
output: z25.array(
|
|
5230
|
+
z25.discriminatedUnion("type", [
|
|
5231
|
+
z25.object({
|
|
5232
|
+
type: z25.literal("message"),
|
|
5233
|
+
role: z25.literal("assistant"),
|
|
5234
|
+
id: z25.string(),
|
|
5235
|
+
phase: z25.enum(["commentary", "final_answer"]).nullish(),
|
|
5236
|
+
content: z25.array(
|
|
5237
|
+
z25.object({
|
|
5238
|
+
type: z25.literal("output_text"),
|
|
5239
|
+
text: z25.string(),
|
|
5240
|
+
logprobs: z25.array(
|
|
5241
|
+
z25.object({
|
|
5242
|
+
token: z25.string(),
|
|
5243
|
+
logprob: z25.number(),
|
|
5244
|
+
top_logprobs: z25.array(
|
|
5245
|
+
z25.object({
|
|
5246
|
+
token: z25.string(),
|
|
5247
|
+
logprob: z25.number()
|
|
5018
5248
|
})
|
|
5019
5249
|
)
|
|
5020
5250
|
})
|
|
5021
5251
|
).nullish(),
|
|
5022
|
-
annotations:
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
type:
|
|
5026
|
-
start_index:
|
|
5027
|
-
end_index:
|
|
5028
|
-
url:
|
|
5029
|
-
title:
|
|
5252
|
+
annotations: z25.array(
|
|
5253
|
+
z25.discriminatedUnion("type", [
|
|
5254
|
+
z25.object({
|
|
5255
|
+
type: z25.literal("url_citation"),
|
|
5256
|
+
start_index: z25.number(),
|
|
5257
|
+
end_index: z25.number(),
|
|
5258
|
+
url: z25.string(),
|
|
5259
|
+
title: z25.string()
|
|
5030
5260
|
}),
|
|
5031
|
-
|
|
5032
|
-
type:
|
|
5033
|
-
file_id:
|
|
5034
|
-
filename:
|
|
5035
|
-
index:
|
|
5261
|
+
z25.object({
|
|
5262
|
+
type: z25.literal("file_citation"),
|
|
5263
|
+
file_id: z25.string(),
|
|
5264
|
+
filename: z25.string(),
|
|
5265
|
+
index: z25.number()
|
|
5036
5266
|
}),
|
|
5037
|
-
|
|
5038
|
-
type:
|
|
5039
|
-
container_id:
|
|
5040
|
-
file_id:
|
|
5041
|
-
filename:
|
|
5042
|
-
start_index:
|
|
5043
|
-
end_index:
|
|
5267
|
+
z25.object({
|
|
5268
|
+
type: z25.literal("container_file_citation"),
|
|
5269
|
+
container_id: z25.string(),
|
|
5270
|
+
file_id: z25.string(),
|
|
5271
|
+
filename: z25.string(),
|
|
5272
|
+
start_index: z25.number(),
|
|
5273
|
+
end_index: z25.number()
|
|
5044
5274
|
}),
|
|
5045
|
-
|
|
5046
|
-
type:
|
|
5047
|
-
file_id:
|
|
5048
|
-
index:
|
|
5275
|
+
z25.object({
|
|
5276
|
+
type: z25.literal("file_path"),
|
|
5277
|
+
file_id: z25.string(),
|
|
5278
|
+
index: z25.number()
|
|
5049
5279
|
})
|
|
5050
5280
|
])
|
|
5051
5281
|
)
|
|
5052
5282
|
})
|
|
5053
5283
|
)
|
|
5054
5284
|
}),
|
|
5055
|
-
|
|
5056
|
-
type:
|
|
5057
|
-
id:
|
|
5058
|
-
status:
|
|
5059
|
-
action:
|
|
5060
|
-
|
|
5061
|
-
type:
|
|
5062
|
-
query:
|
|
5063
|
-
queries:
|
|
5064
|
-
sources:
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
type:
|
|
5069
|
-
name:
|
|
5285
|
+
z25.object({
|
|
5286
|
+
type: z25.literal("web_search_call"),
|
|
5287
|
+
id: z25.string(),
|
|
5288
|
+
status: z25.string(),
|
|
5289
|
+
action: z25.discriminatedUnion("type", [
|
|
5290
|
+
z25.object({
|
|
5291
|
+
type: z25.literal("search"),
|
|
5292
|
+
query: z25.string().nullish(),
|
|
5293
|
+
queries: z25.array(z25.string()).nullish(),
|
|
5294
|
+
sources: z25.array(
|
|
5295
|
+
z25.discriminatedUnion("type", [
|
|
5296
|
+
z25.object({ type: z25.literal("url"), url: z25.string() }),
|
|
5297
|
+
z25.object({
|
|
5298
|
+
type: z25.literal("api"),
|
|
5299
|
+
name: z25.string()
|
|
5070
5300
|
})
|
|
5071
5301
|
])
|
|
5072
5302
|
).nullish()
|
|
5073
5303
|
}),
|
|
5074
|
-
|
|
5075
|
-
type:
|
|
5076
|
-
url:
|
|
5304
|
+
z25.object({
|
|
5305
|
+
type: z25.literal("open_page"),
|
|
5306
|
+
url: z25.string().nullish()
|
|
5077
5307
|
}),
|
|
5078
|
-
|
|
5079
|
-
type:
|
|
5080
|
-
url:
|
|
5081
|
-
pattern:
|
|
5308
|
+
z25.object({
|
|
5309
|
+
type: z25.literal("find_in_page"),
|
|
5310
|
+
url: z25.string().nullish(),
|
|
5311
|
+
pattern: z25.string().nullish()
|
|
5082
5312
|
})
|
|
5083
5313
|
]).nullish()
|
|
5084
5314
|
}),
|
|
5085
|
-
|
|
5086
|
-
type:
|
|
5087
|
-
id:
|
|
5088
|
-
queries:
|
|
5089
|
-
results:
|
|
5090
|
-
|
|
5091
|
-
attributes:
|
|
5092
|
-
|
|
5093
|
-
|
|
5315
|
+
z25.object({
|
|
5316
|
+
type: z25.literal("file_search_call"),
|
|
5317
|
+
id: z25.string(),
|
|
5318
|
+
queries: z25.array(z25.string()),
|
|
5319
|
+
results: z25.array(
|
|
5320
|
+
z25.object({
|
|
5321
|
+
attributes: z25.record(
|
|
5322
|
+
z25.string(),
|
|
5323
|
+
z25.union([z25.string(), z25.number(), z25.boolean()])
|
|
5094
5324
|
),
|
|
5095
|
-
file_id:
|
|
5096
|
-
filename:
|
|
5097
|
-
score:
|
|
5098
|
-
text:
|
|
5325
|
+
file_id: z25.string(),
|
|
5326
|
+
filename: z25.string(),
|
|
5327
|
+
score: z25.number(),
|
|
5328
|
+
text: z25.string()
|
|
5099
5329
|
})
|
|
5100
5330
|
).nullish()
|
|
5101
5331
|
}),
|
|
5102
|
-
|
|
5103
|
-
type:
|
|
5104
|
-
id:
|
|
5105
|
-
code:
|
|
5106
|
-
container_id:
|
|
5107
|
-
outputs:
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5332
|
+
z25.object({
|
|
5333
|
+
type: z25.literal("code_interpreter_call"),
|
|
5334
|
+
id: z25.string(),
|
|
5335
|
+
code: z25.string().nullable(),
|
|
5336
|
+
container_id: z25.string(),
|
|
5337
|
+
outputs: z25.array(
|
|
5338
|
+
z25.discriminatedUnion("type", [
|
|
5339
|
+
z25.object({ type: z25.literal("logs"), logs: z25.string() }),
|
|
5340
|
+
z25.object({ type: z25.literal("image"), url: z25.string() })
|
|
5111
5341
|
])
|
|
5112
5342
|
).nullable()
|
|
5113
5343
|
}),
|
|
5114
|
-
|
|
5115
|
-
type:
|
|
5116
|
-
id:
|
|
5117
|
-
result:
|
|
5344
|
+
z25.object({
|
|
5345
|
+
type: z25.literal("image_generation_call"),
|
|
5346
|
+
id: z25.string(),
|
|
5347
|
+
result: z25.string()
|
|
5118
5348
|
}),
|
|
5119
|
-
|
|
5120
|
-
type:
|
|
5121
|
-
id:
|
|
5122
|
-
call_id:
|
|
5123
|
-
action:
|
|
5124
|
-
type:
|
|
5125
|
-
command:
|
|
5126
|
-
timeout_ms:
|
|
5127
|
-
user:
|
|
5128
|
-
working_directory:
|
|
5129
|
-
env:
|
|
5349
|
+
z25.object({
|
|
5350
|
+
type: z25.literal("local_shell_call"),
|
|
5351
|
+
id: z25.string(),
|
|
5352
|
+
call_id: z25.string(),
|
|
5353
|
+
action: z25.object({
|
|
5354
|
+
type: z25.literal("exec"),
|
|
5355
|
+
command: z25.array(z25.string()),
|
|
5356
|
+
timeout_ms: z25.number().optional(),
|
|
5357
|
+
user: z25.string().optional(),
|
|
5358
|
+
working_directory: z25.string().optional(),
|
|
5359
|
+
env: z25.record(z25.string(), z25.string()).optional()
|
|
5130
5360
|
})
|
|
5131
5361
|
}),
|
|
5132
|
-
|
|
5133
|
-
type:
|
|
5134
|
-
call_id:
|
|
5135
|
-
name:
|
|
5136
|
-
arguments:
|
|
5137
|
-
id:
|
|
5138
|
-
namespace:
|
|
5362
|
+
z25.object({
|
|
5363
|
+
type: z25.literal("function_call"),
|
|
5364
|
+
call_id: z25.string(),
|
|
5365
|
+
name: z25.string(),
|
|
5366
|
+
arguments: z25.string(),
|
|
5367
|
+
id: z25.string(),
|
|
5368
|
+
namespace: z25.string().nullish()
|
|
5139
5369
|
}),
|
|
5140
|
-
|
|
5141
|
-
type:
|
|
5142
|
-
call_id:
|
|
5143
|
-
name:
|
|
5144
|
-
input:
|
|
5145
|
-
id:
|
|
5370
|
+
z25.object({
|
|
5371
|
+
type: z25.literal("custom_tool_call"),
|
|
5372
|
+
call_id: z25.string(),
|
|
5373
|
+
name: z25.string(),
|
|
5374
|
+
input: z25.string(),
|
|
5375
|
+
id: z25.string()
|
|
5146
5376
|
}),
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
summary: z24.array(
|
|
5157
|
-
z24.object({
|
|
5158
|
-
type: z24.literal("summary_text"),
|
|
5159
|
-
text: z24.string()
|
|
5377
|
+
openaiResponsesComputerCallSchema,
|
|
5378
|
+
z25.object({
|
|
5379
|
+
type: z25.literal("reasoning"),
|
|
5380
|
+
id: z25.string(),
|
|
5381
|
+
encrypted_content: z25.string().nullish(),
|
|
5382
|
+
summary: z25.array(
|
|
5383
|
+
z25.object({
|
|
5384
|
+
type: z25.literal("summary_text"),
|
|
5385
|
+
text: z25.string()
|
|
5160
5386
|
})
|
|
5161
5387
|
)
|
|
5162
5388
|
}),
|
|
5163
|
-
|
|
5164
|
-
type:
|
|
5165
|
-
id:
|
|
5166
|
-
status:
|
|
5167
|
-
arguments:
|
|
5168
|
-
name:
|
|
5169
|
-
server_label:
|
|
5170
|
-
output:
|
|
5171
|
-
error:
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
type:
|
|
5175
|
-
code:
|
|
5176
|
-
message:
|
|
5389
|
+
z25.object({
|
|
5390
|
+
type: z25.literal("mcp_call"),
|
|
5391
|
+
id: z25.string(),
|
|
5392
|
+
status: z25.string(),
|
|
5393
|
+
arguments: z25.string(),
|
|
5394
|
+
name: z25.string(),
|
|
5395
|
+
server_label: z25.string(),
|
|
5396
|
+
output: z25.string().nullish(),
|
|
5397
|
+
error: z25.union([
|
|
5398
|
+
z25.string(),
|
|
5399
|
+
z25.object({
|
|
5400
|
+
type: z25.string().optional(),
|
|
5401
|
+
code: z25.union([z25.number(), z25.string()]).optional(),
|
|
5402
|
+
message: z25.string().optional()
|
|
5177
5403
|
}).loose()
|
|
5178
5404
|
]).nullish(),
|
|
5179
|
-
approval_request_id:
|
|
5405
|
+
approval_request_id: z25.string().nullish()
|
|
5180
5406
|
}),
|
|
5181
|
-
|
|
5182
|
-
type:
|
|
5183
|
-
id:
|
|
5184
|
-
server_label:
|
|
5185
|
-
tools:
|
|
5186
|
-
|
|
5187
|
-
name:
|
|
5188
|
-
description:
|
|
5189
|
-
input_schema:
|
|
5190
|
-
annotations:
|
|
5407
|
+
z25.object({
|
|
5408
|
+
type: z25.literal("mcp_list_tools"),
|
|
5409
|
+
id: z25.string(),
|
|
5410
|
+
server_label: z25.string(),
|
|
5411
|
+
tools: z25.array(
|
|
5412
|
+
z25.object({
|
|
5413
|
+
name: z25.string(),
|
|
5414
|
+
description: z25.string().optional(),
|
|
5415
|
+
input_schema: z25.any(),
|
|
5416
|
+
annotations: z25.record(z25.string(), z25.unknown()).optional()
|
|
5191
5417
|
})
|
|
5192
5418
|
),
|
|
5193
|
-
error:
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
type:
|
|
5197
|
-
code:
|
|
5198
|
-
message:
|
|
5419
|
+
error: z25.union([
|
|
5420
|
+
z25.string(),
|
|
5421
|
+
z25.object({
|
|
5422
|
+
type: z25.string().optional(),
|
|
5423
|
+
code: z25.union([z25.number(), z25.string()]).optional(),
|
|
5424
|
+
message: z25.string().optional()
|
|
5199
5425
|
}).loose()
|
|
5200
5426
|
]).optional()
|
|
5201
5427
|
}),
|
|
5202
|
-
|
|
5203
|
-
type:
|
|
5204
|
-
id:
|
|
5205
|
-
server_label:
|
|
5206
|
-
name:
|
|
5207
|
-
arguments:
|
|
5208
|
-
approval_request_id:
|
|
5428
|
+
z25.object({
|
|
5429
|
+
type: z25.literal("mcp_approval_request"),
|
|
5430
|
+
id: z25.string(),
|
|
5431
|
+
server_label: z25.string(),
|
|
5432
|
+
name: z25.string(),
|
|
5433
|
+
arguments: z25.string(),
|
|
5434
|
+
approval_request_id: z25.string().optional()
|
|
5209
5435
|
}),
|
|
5210
|
-
|
|
5211
|
-
type:
|
|
5212
|
-
id:
|
|
5213
|
-
call_id:
|
|
5214
|
-
status:
|
|
5215
|
-
operation:
|
|
5216
|
-
|
|
5217
|
-
type:
|
|
5218
|
-
path:
|
|
5219
|
-
diff:
|
|
5436
|
+
z25.object({
|
|
5437
|
+
type: z25.literal("apply_patch_call"),
|
|
5438
|
+
id: z25.string(),
|
|
5439
|
+
call_id: z25.string(),
|
|
5440
|
+
status: z25.enum(["in_progress", "completed"]),
|
|
5441
|
+
operation: z25.discriminatedUnion("type", [
|
|
5442
|
+
z25.object({
|
|
5443
|
+
type: z25.literal("create_file"),
|
|
5444
|
+
path: z25.string(),
|
|
5445
|
+
diff: z25.string()
|
|
5220
5446
|
}),
|
|
5221
|
-
|
|
5222
|
-
type:
|
|
5223
|
-
path:
|
|
5447
|
+
z25.object({
|
|
5448
|
+
type: z25.literal("delete_file"),
|
|
5449
|
+
path: z25.string()
|
|
5224
5450
|
}),
|
|
5225
|
-
|
|
5226
|
-
type:
|
|
5227
|
-
path:
|
|
5228
|
-
diff:
|
|
5451
|
+
z25.object({
|
|
5452
|
+
type: z25.literal("update_file"),
|
|
5453
|
+
path: z25.string(),
|
|
5454
|
+
diff: z25.string()
|
|
5229
5455
|
})
|
|
5230
5456
|
])
|
|
5231
5457
|
}),
|
|
5232
|
-
|
|
5233
|
-
type:
|
|
5234
|
-
id:
|
|
5235
|
-
call_id:
|
|
5236
|
-
status:
|
|
5237
|
-
action:
|
|
5238
|
-
commands:
|
|
5458
|
+
z25.object({
|
|
5459
|
+
type: z25.literal("shell_call"),
|
|
5460
|
+
id: z25.string(),
|
|
5461
|
+
call_id: z25.string(),
|
|
5462
|
+
status: z25.enum(["in_progress", "completed", "incomplete"]),
|
|
5463
|
+
action: z25.object({
|
|
5464
|
+
commands: z25.array(z25.string())
|
|
5239
5465
|
})
|
|
5240
5466
|
}),
|
|
5241
|
-
|
|
5242
|
-
type:
|
|
5243
|
-
id:
|
|
5244
|
-
encrypted_content:
|
|
5467
|
+
z25.object({
|
|
5468
|
+
type: z25.literal("compaction"),
|
|
5469
|
+
id: z25.string(),
|
|
5470
|
+
encrypted_content: z25.string()
|
|
5245
5471
|
}),
|
|
5246
|
-
|
|
5247
|
-
type:
|
|
5248
|
-
id:
|
|
5249
|
-
call_id:
|
|
5250
|
-
status:
|
|
5251
|
-
output:
|
|
5252
|
-
|
|
5253
|
-
stdout:
|
|
5254
|
-
stderr:
|
|
5255
|
-
outcome:
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
type:
|
|
5259
|
-
exit_code:
|
|
5472
|
+
z25.object({
|
|
5473
|
+
type: z25.literal("shell_call_output"),
|
|
5474
|
+
id: z25.string(),
|
|
5475
|
+
call_id: z25.string(),
|
|
5476
|
+
status: z25.enum(["in_progress", "completed", "incomplete"]),
|
|
5477
|
+
output: z25.array(
|
|
5478
|
+
z25.object({
|
|
5479
|
+
stdout: z25.string(),
|
|
5480
|
+
stderr: z25.string(),
|
|
5481
|
+
outcome: z25.discriminatedUnion("type", [
|
|
5482
|
+
z25.object({ type: z25.literal("timeout") }),
|
|
5483
|
+
z25.object({
|
|
5484
|
+
type: z25.literal("exit"),
|
|
5485
|
+
exit_code: z25.number()
|
|
5260
5486
|
})
|
|
5261
5487
|
])
|
|
5262
5488
|
})
|
|
5263
5489
|
)
|
|
5264
5490
|
}),
|
|
5265
|
-
|
|
5266
|
-
type:
|
|
5267
|
-
id:
|
|
5268
|
-
execution:
|
|
5269
|
-
call_id:
|
|
5270
|
-
status:
|
|
5271
|
-
arguments:
|
|
5491
|
+
z25.object({
|
|
5492
|
+
type: z25.literal("tool_search_call"),
|
|
5493
|
+
id: z25.string(),
|
|
5494
|
+
execution: z25.enum(["server", "client"]),
|
|
5495
|
+
call_id: z25.string().nullable(),
|
|
5496
|
+
status: z25.enum(["in_progress", "completed", "incomplete"]),
|
|
5497
|
+
arguments: z25.unknown()
|
|
5272
5498
|
}),
|
|
5273
|
-
|
|
5274
|
-
type:
|
|
5275
|
-
id:
|
|
5276
|
-
execution:
|
|
5277
|
-
call_id:
|
|
5278
|
-
status:
|
|
5279
|
-
tools:
|
|
5499
|
+
z25.object({
|
|
5500
|
+
type: z25.literal("tool_search_output"),
|
|
5501
|
+
id: z25.string(),
|
|
5502
|
+
execution: z25.enum(["server", "client"]),
|
|
5503
|
+
call_id: z25.string().nullable(),
|
|
5504
|
+
status: z25.enum(["in_progress", "completed", "incomplete"]),
|
|
5505
|
+
tools: z25.array(z25.record(z25.string(), jsonValueSchema2.optional()))
|
|
5280
5506
|
})
|
|
5281
5507
|
])
|
|
5282
5508
|
).optional(),
|
|
5283
|
-
service_tier:
|
|
5284
|
-
reasoning:
|
|
5285
|
-
context:
|
|
5509
|
+
service_tier: z25.string().nullish(),
|
|
5510
|
+
reasoning: z25.object({
|
|
5511
|
+
context: z25.string().nullish()
|
|
5286
5512
|
}).nullish(),
|
|
5287
|
-
incomplete_details:
|
|
5288
|
-
usage:
|
|
5289
|
-
input_tokens:
|
|
5290
|
-
input_tokens_details:
|
|
5291
|
-
cached_tokens:
|
|
5292
|
-
cache_write_tokens:
|
|
5293
|
-
orchestration_input_tokens:
|
|
5294
|
-
orchestration_input_cached_tokens:
|
|
5513
|
+
incomplete_details: z25.object({ reason: z25.string() }).nullish(),
|
|
5514
|
+
usage: z25.object({
|
|
5515
|
+
input_tokens: z25.number(),
|
|
5516
|
+
input_tokens_details: z25.object({
|
|
5517
|
+
cached_tokens: z25.number().nullish(),
|
|
5518
|
+
cache_write_tokens: z25.number().nullish(),
|
|
5519
|
+
orchestration_input_tokens: z25.number().nullish(),
|
|
5520
|
+
orchestration_input_cached_tokens: z25.number().nullish()
|
|
5295
5521
|
}).nullish(),
|
|
5296
|
-
output_tokens:
|
|
5297
|
-
output_tokens_details:
|
|
5298
|
-
reasoning_tokens:
|
|
5299
|
-
orchestration_output_tokens:
|
|
5522
|
+
output_tokens: z25.number(),
|
|
5523
|
+
output_tokens_details: z25.object({
|
|
5524
|
+
reasoning_tokens: z25.number().nullish(),
|
|
5525
|
+
orchestration_output_tokens: z25.number().nullish()
|
|
5300
5526
|
}).nullish()
|
|
5301
5527
|
}).optional()
|
|
5302
5528
|
})
|
|
@@ -5305,10 +5531,10 @@ var openaiResponsesResponseSchema = lazySchema22(
|
|
|
5305
5531
|
|
|
5306
5532
|
// src/responses/openai-responses-language-model-options.ts
|
|
5307
5533
|
import {
|
|
5308
|
-
lazySchema as
|
|
5309
|
-
zodSchema as
|
|
5534
|
+
lazySchema as lazySchema24,
|
|
5535
|
+
zodSchema as zodSchema24
|
|
5310
5536
|
} from "@ai-sdk/provider-utils";
|
|
5311
|
-
import { z as
|
|
5537
|
+
import { z as z26 } from "zod/v4";
|
|
5312
5538
|
var TOP_LOGPROBS_MAX = 20;
|
|
5313
5539
|
var openaiResponsesReasoningModelIds = [
|
|
5314
5540
|
"o1",
|
|
@@ -5379,9 +5605,9 @@ var openaiResponsesModelIds = [
|
|
|
5379
5605
|
"gpt-5-chat-latest",
|
|
5380
5606
|
...openaiResponsesReasoningModelIds
|
|
5381
5607
|
];
|
|
5382
|
-
var openaiLanguageModelResponsesOptionsSchema =
|
|
5383
|
-
() =>
|
|
5384
|
-
|
|
5608
|
+
var openaiLanguageModelResponsesOptionsSchema = lazySchema24(
|
|
5609
|
+
() => zodSchema24(
|
|
5610
|
+
z26.object({
|
|
5385
5611
|
/**
|
|
5386
5612
|
* The ID of the OpenAI Conversation to continue.
|
|
5387
5613
|
* You must create a conversation first via the OpenAI API.
|
|
@@ -5389,13 +5615,13 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
|
|
|
5389
5615
|
* Defaults to `undefined`.
|
|
5390
5616
|
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
5391
5617
|
*/
|
|
5392
|
-
conversation:
|
|
5618
|
+
conversation: z26.string().nullish(),
|
|
5393
5619
|
/**
|
|
5394
5620
|
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
5395
5621
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'web_search_call.results', 'message.output_text.logprobs'.
|
|
5396
5622
|
*/
|
|
5397
|
-
include:
|
|
5398
|
-
|
|
5623
|
+
include: z26.array(
|
|
5624
|
+
z26.enum([
|
|
5399
5625
|
"reasoning.encrypted_content",
|
|
5400
5626
|
// handled internally by default, only needed for unknown reasoning models
|
|
5401
5627
|
"file_search_call.results",
|
|
@@ -5408,7 +5634,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
|
|
|
5408
5634
|
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
5409
5635
|
* Defaults to `undefined`.
|
|
5410
5636
|
*/
|
|
5411
|
-
instructions:
|
|
5637
|
+
instructions: z26.string().nullish(),
|
|
5412
5638
|
/**
|
|
5413
5639
|
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
5414
5640
|
* the response size and can slow down response times. However, it can
|
|
@@ -5423,38 +5649,38 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
|
|
|
5423
5649
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
5424
5650
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
5425
5651
|
*/
|
|
5426
|
-
logprobs:
|
|
5652
|
+
logprobs: z26.union([z26.boolean(), z26.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
5427
5653
|
/**
|
|
5428
5654
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
5429
5655
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
5430
5656
|
* Any further attempts to call a tool by the model will be ignored.
|
|
5431
5657
|
*/
|
|
5432
|
-
maxToolCalls:
|
|
5658
|
+
maxToolCalls: z26.number().nullish(),
|
|
5433
5659
|
/**
|
|
5434
5660
|
* Additional metadata to store with the generation.
|
|
5435
5661
|
*/
|
|
5436
|
-
metadata:
|
|
5662
|
+
metadata: z26.any().nullish(),
|
|
5437
5663
|
/**
|
|
5438
5664
|
* Whether to use parallel tool calls. Defaults to `true`.
|
|
5439
5665
|
*/
|
|
5440
|
-
parallelToolCalls:
|
|
5666
|
+
parallelToolCalls: z26.boolean().nullish(),
|
|
5441
5667
|
/**
|
|
5442
5668
|
* The ID of the previous response. You can use it to continue a conversation.
|
|
5443
5669
|
* Defaults to `undefined`.
|
|
5444
5670
|
*/
|
|
5445
|
-
previousResponseId:
|
|
5671
|
+
previousResponseId: z26.string().nullish(),
|
|
5446
5672
|
/**
|
|
5447
5673
|
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
5448
5674
|
*/
|
|
5449
|
-
promptCacheKey:
|
|
5675
|
+
promptCacheKey: z26.string().nullish(),
|
|
5450
5676
|
/**
|
|
5451
5677
|
* Prompt cache behavior for GPT-5.6 and later models.
|
|
5452
5678
|
* `mode` controls whether OpenAI also places an implicit breakpoint.
|
|
5453
5679
|
* `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
|
|
5454
5680
|
*/
|
|
5455
|
-
promptCacheOptions:
|
|
5456
|
-
mode:
|
|
5457
|
-
ttl:
|
|
5681
|
+
promptCacheOptions: z26.object({
|
|
5682
|
+
mode: z26.enum(["implicit", "explicit"]).optional(),
|
|
5683
|
+
ttl: z26.literal("30m").optional()
|
|
5458
5684
|
}).optional(),
|
|
5459
5685
|
/**
|
|
5460
5686
|
* The retention policy for the prompt cache.
|
|
@@ -5466,35 +5692,35 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
|
|
|
5466
5692
|
*
|
|
5467
5693
|
* @default 'in_memory'
|
|
5468
5694
|
*/
|
|
5469
|
-
promptCacheRetention:
|
|
5695
|
+
promptCacheRetention: z26.enum(["in_memory", "24h"]).nullish(),
|
|
5470
5696
|
/**
|
|
5471
5697
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
5472
5698
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
5473
5699
|
* GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
5474
5700
|
* Supported values vary by model.
|
|
5475
5701
|
*/
|
|
5476
|
-
reasoningEffort:
|
|
5702
|
+
reasoningEffort: z26.string().nullish(),
|
|
5477
5703
|
/**
|
|
5478
5704
|
* Controls how much model work GPT-5.6 performs before returning a final answer.
|
|
5479
5705
|
* `standard` is the default. `pro` increases quality, latency, and token usage.
|
|
5480
5706
|
*/
|
|
5481
|
-
reasoningMode:
|
|
5707
|
+
reasoningMode: z26.enum(["standard", "pro"]).optional(),
|
|
5482
5708
|
/**
|
|
5483
5709
|
* Controls which available reasoning items GPT-5.6 can use.
|
|
5484
5710
|
* `auto` uses the model default, `current_turn` excludes reasoning from earlier
|
|
5485
5711
|
* turns, and `all_turns` makes compatible earlier reasoning available.
|
|
5486
5712
|
*/
|
|
5487
|
-
reasoningContext:
|
|
5713
|
+
reasoningContext: z26.enum(["auto", "current_turn", "all_turns"]).optional(),
|
|
5488
5714
|
/**
|
|
5489
5715
|
* Controls reasoning summary output from the model.
|
|
5490
5716
|
* Set to "auto" to automatically receive the richest level available,
|
|
5491
5717
|
* or "detailed" for comprehensive summaries.
|
|
5492
5718
|
*/
|
|
5493
|
-
reasoningSummary:
|
|
5719
|
+
reasoningSummary: z26.string().nullish(),
|
|
5494
5720
|
/**
|
|
5495
5721
|
* The identifier for safety monitoring and tracking.
|
|
5496
5722
|
*/
|
|
5497
|
-
safetyIdentifier:
|
|
5723
|
+
safetyIdentifier: z26.string().nullish(),
|
|
5498
5724
|
/**
|
|
5499
5725
|
* Service tier for the request.
|
|
5500
5726
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
@@ -5502,11 +5728,11 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
|
|
|
5502
5728
|
*
|
|
5503
5729
|
* Defaults to 'auto'.
|
|
5504
5730
|
*/
|
|
5505
|
-
serviceTier:
|
|
5731
|
+
serviceTier: z26.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
5506
5732
|
/**
|
|
5507
5733
|
* Whether to store the generation. Defaults to `true`.
|
|
5508
5734
|
*/
|
|
5509
|
-
store:
|
|
5735
|
+
store: z26.boolean().nullish(),
|
|
5510
5736
|
/**
|
|
5511
5737
|
* Whether to pass through non-image file types as generic input files.
|
|
5512
5738
|
*
|
|
@@ -5514,30 +5740,30 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
|
|
|
5514
5740
|
* Enable this when the target OpenAI Responses model supports additional
|
|
5515
5741
|
* file media types, such as text/csv.
|
|
5516
5742
|
*/
|
|
5517
|
-
passThroughUnsupportedFiles:
|
|
5743
|
+
passThroughUnsupportedFiles: z26.boolean().optional(),
|
|
5518
5744
|
/**
|
|
5519
5745
|
* Whether to use strict JSON schema validation.
|
|
5520
5746
|
* Defaults to `true`.
|
|
5521
5747
|
*/
|
|
5522
|
-
strictJsonSchema:
|
|
5748
|
+
strictJsonSchema: z26.boolean().nullish(),
|
|
5523
5749
|
/**
|
|
5524
5750
|
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
5525
5751
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
5526
5752
|
* Valid values: 'low', 'medium', 'high'.
|
|
5527
5753
|
*/
|
|
5528
|
-
textVerbosity:
|
|
5754
|
+
textVerbosity: z26.enum(["low", "medium", "high"]).nullish(),
|
|
5529
5755
|
/**
|
|
5530
5756
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
5531
5757
|
* 'disabled' turns truncation off.
|
|
5532
5758
|
*/
|
|
5533
|
-
truncation:
|
|
5759
|
+
truncation: z26.enum(["auto", "disabled"]).nullish(),
|
|
5534
5760
|
/**
|
|
5535
5761
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
5536
5762
|
* monitor and detect abuse.
|
|
5537
5763
|
* Defaults to `undefined`.
|
|
5538
5764
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
5539
5765
|
*/
|
|
5540
|
-
user:
|
|
5766
|
+
user: z26.string().nullish(),
|
|
5541
5767
|
/**
|
|
5542
5768
|
* Override the system message mode for this model.
|
|
5543
5769
|
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
@@ -5546,7 +5772,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
|
|
|
5546
5772
|
*
|
|
5547
5773
|
* If not specified, the mode is automatically determined based on the model.
|
|
5548
5774
|
*/
|
|
5549
|
-
systemMessageMode:
|
|
5775
|
+
systemMessageMode: z26.enum(["system", "developer", "remove"]).optional(),
|
|
5550
5776
|
/**
|
|
5551
5777
|
* Force treating this model as a reasoning model.
|
|
5552
5778
|
*
|
|
@@ -5556,14 +5782,14 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
|
|
|
5556
5782
|
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
5557
5783
|
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
5558
5784
|
*/
|
|
5559
|
-
forceReasoning:
|
|
5785
|
+
forceReasoning: z26.boolean().optional(),
|
|
5560
5786
|
/**
|
|
5561
5787
|
* Enable server-side context management (compaction).
|
|
5562
5788
|
*/
|
|
5563
|
-
contextManagement:
|
|
5564
|
-
|
|
5565
|
-
type:
|
|
5566
|
-
compactThreshold:
|
|
5789
|
+
contextManagement: z26.array(
|
|
5790
|
+
z26.object({
|
|
5791
|
+
type: z26.literal("compaction"),
|
|
5792
|
+
compactThreshold: z26.number()
|
|
5567
5793
|
})
|
|
5568
5794
|
).nullish(),
|
|
5569
5795
|
/**
|
|
@@ -5576,9 +5802,9 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
|
|
|
5576
5802
|
*
|
|
5577
5803
|
* @see https://developers.openai.com/api/reference/resources/responses/methods/create#(resource)%20responses%20%3E%20(model)%20tool_choice_allowed%20%3E%20(schema)
|
|
5578
5804
|
*/
|
|
5579
|
-
allowedTools:
|
|
5580
|
-
toolNames:
|
|
5581
|
-
mode:
|
|
5805
|
+
allowedTools: z26.object({
|
|
5806
|
+
toolNames: z26.array(z26.string()).min(1),
|
|
5807
|
+
mode: z26.enum(["auto", "required"]).optional()
|
|
5582
5808
|
}).optional()
|
|
5583
5809
|
})
|
|
5584
5810
|
)
|
|
@@ -5683,6 +5909,12 @@ async function prepareResponsesTools({
|
|
|
5683
5909
|
});
|
|
5684
5910
|
break;
|
|
5685
5911
|
}
|
|
5912
|
+
case "openai.computer": {
|
|
5913
|
+
openaiTools2.push({
|
|
5914
|
+
type: "computer"
|
|
5915
|
+
});
|
|
5916
|
+
break;
|
|
5917
|
+
}
|
|
5686
5918
|
case "openai.web_search_preview": {
|
|
5687
5919
|
const args = await validateTypes2({
|
|
5688
5920
|
value: tool.args,
|
|
@@ -5837,7 +6069,7 @@ async function prepareResponsesTools({
|
|
|
5837
6069
|
const resolvedToolName = (_c = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _c : toolChoice.toolName;
|
|
5838
6070
|
return {
|
|
5839
6071
|
tools: openaiTools2,
|
|
5840
|
-
toolChoice: resolvedToolName === "code_interpreter" || resolvedToolName === "file_search" || resolvedToolName === "image_generation" || resolvedToolName === "web_search_preview" || resolvedToolName === "web_search" || resolvedToolName === "mcp" || resolvedToolName === "apply_patch" ? { type: resolvedToolName } : resolvedCustomProviderToolNames.has(resolvedToolName) ? { type: "custom", name: resolvedToolName } : { type: "function", name: resolvedToolName },
|
|
6072
|
+
toolChoice: resolvedToolName === "code_interpreter" || resolvedToolName === "file_search" || resolvedToolName === "image_generation" || resolvedToolName === "web_search_preview" || resolvedToolName === "web_search" || resolvedToolName === "mcp" || resolvedToolName === "apply_patch" || resolvedToolName === "computer" ? { type: resolvedToolName } : resolvedCustomProviderToolNames.has(resolvedToolName) ? { type: "custom", name: resolvedToolName } : { type: "function", name: resolvedToolName },
|
|
5841
6073
|
toolWarnings
|
|
5842
6074
|
};
|
|
5843
6075
|
}
|
|
@@ -5932,6 +6164,74 @@ function extractApprovalRequestIdToToolCallIdMapping(prompt) {
|
|
|
5932
6164
|
}
|
|
5933
6165
|
return mapping;
|
|
5934
6166
|
}
|
|
6167
|
+
function mapComputerAction(action) {
|
|
6168
|
+
switch (action.type) {
|
|
6169
|
+
case "click":
|
|
6170
|
+
return {
|
|
6171
|
+
type: "click",
|
|
6172
|
+
button: action.button,
|
|
6173
|
+
x: action.x,
|
|
6174
|
+
y: action.y,
|
|
6175
|
+
...action.keys != null && { keys: action.keys }
|
|
6176
|
+
};
|
|
6177
|
+
case "double_click":
|
|
6178
|
+
return {
|
|
6179
|
+
type: "double_click",
|
|
6180
|
+
x: action.x,
|
|
6181
|
+
y: action.y,
|
|
6182
|
+
...action.keys != null && { keys: action.keys }
|
|
6183
|
+
};
|
|
6184
|
+
case "drag":
|
|
6185
|
+
return {
|
|
6186
|
+
type: "drag",
|
|
6187
|
+
path: action.path,
|
|
6188
|
+
...action.keys != null && { keys: action.keys }
|
|
6189
|
+
};
|
|
6190
|
+
case "keypress":
|
|
6191
|
+
return action;
|
|
6192
|
+
case "move":
|
|
6193
|
+
return {
|
|
6194
|
+
type: "move",
|
|
6195
|
+
x: action.x,
|
|
6196
|
+
y: action.y,
|
|
6197
|
+
...action.keys != null && { keys: action.keys }
|
|
6198
|
+
};
|
|
6199
|
+
case "screenshot":
|
|
6200
|
+
return action;
|
|
6201
|
+
case "scroll":
|
|
6202
|
+
return {
|
|
6203
|
+
type: "scroll",
|
|
6204
|
+
x: action.x,
|
|
6205
|
+
y: action.y,
|
|
6206
|
+
scrollX: action.scroll_x,
|
|
6207
|
+
scrollY: action.scroll_y,
|
|
6208
|
+
...action.keys != null && { keys: action.keys }
|
|
6209
|
+
};
|
|
6210
|
+
case "type":
|
|
6211
|
+
return action;
|
|
6212
|
+
case "wait":
|
|
6213
|
+
return action;
|
|
6214
|
+
}
|
|
6215
|
+
}
|
|
6216
|
+
function mapComputerCallInput({
|
|
6217
|
+
action,
|
|
6218
|
+
actions,
|
|
6219
|
+
pending_safety_checks,
|
|
6220
|
+
status
|
|
6221
|
+
}) {
|
|
6222
|
+
var _a;
|
|
6223
|
+
return {
|
|
6224
|
+
actions: (actions != null ? actions : action != null ? [action] : []).map(
|
|
6225
|
+
mapComputerAction
|
|
6226
|
+
),
|
|
6227
|
+
pendingSafetyChecks: (_a = pending_safety_checks == null ? void 0 : pending_safety_checks.map((safetyCheck) => ({
|
|
6228
|
+
id: safetyCheck.id,
|
|
6229
|
+
...safetyCheck.code != null && { code: safetyCheck.code },
|
|
6230
|
+
...safetyCheck.message != null && { message: safetyCheck.message }
|
|
6231
|
+
}))) != null ? _a : [],
|
|
6232
|
+
status
|
|
6233
|
+
};
|
|
6234
|
+
}
|
|
5935
6235
|
var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
5936
6236
|
constructor(modelId, config) {
|
|
5937
6237
|
this.specificationVersion = "v4";
|
|
@@ -6015,6 +6315,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6015
6315
|
tools,
|
|
6016
6316
|
providerToolNames: {
|
|
6017
6317
|
"openai.code_interpreter": "code_interpreter",
|
|
6318
|
+
"openai.computer": "computer",
|
|
6018
6319
|
"openai.file_search": "file_search",
|
|
6019
6320
|
"openai.image_generation": "image_generation",
|
|
6020
6321
|
"openai.local_shell": "local_shell",
|
|
@@ -6051,6 +6352,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6051
6352
|
hasLocalShellTool: hasOpenAITool("openai.local_shell"),
|
|
6052
6353
|
hasShellTool: hasOpenAITool("openai.shell"),
|
|
6053
6354
|
hasApplyPatchTool: hasOpenAITool("openai.apply_patch"),
|
|
6355
|
+
hasComputerTool: hasOpenAITool("openai.computer"),
|
|
6054
6356
|
customProviderToolNames: customProviderToolNames.size > 0 ? customProviderToolNames : void 0
|
|
6055
6357
|
});
|
|
6056
6358
|
warnings.push(...inputWarnings);
|
|
@@ -6231,7 +6533,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6231
6533
|
};
|
|
6232
6534
|
}
|
|
6233
6535
|
async doGenerate(options) {
|
|
6234
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E;
|
|
6536
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
|
|
6235
6537
|
const {
|
|
6236
6538
|
args: body,
|
|
6237
6539
|
warnings,
|
|
@@ -6271,6 +6573,18 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6271
6573
|
isRetryable: false
|
|
6272
6574
|
});
|
|
6273
6575
|
}
|
|
6576
|
+
if (response.output == null) {
|
|
6577
|
+
const detail = (_c = response.incomplete_details) == null ? void 0 : _c.reason;
|
|
6578
|
+
throw new APICallError2({
|
|
6579
|
+
message: detail ? `Responses API returned no output (${detail})` : "Responses API returned no output",
|
|
6580
|
+
url,
|
|
6581
|
+
requestBodyValues: body,
|
|
6582
|
+
statusCode: 500,
|
|
6583
|
+
responseHeaders,
|
|
6584
|
+
responseBody: rawResponse,
|
|
6585
|
+
isRetryable: false
|
|
6586
|
+
});
|
|
6587
|
+
}
|
|
6274
6588
|
const content = [];
|
|
6275
6589
|
const logprobs = [];
|
|
6276
6590
|
let hasFunctionCall = false;
|
|
@@ -6288,7 +6602,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6288
6602
|
providerMetadata: {
|
|
6289
6603
|
[providerOptionsName]: {
|
|
6290
6604
|
itemId: part.id,
|
|
6291
|
-
reasoningEncryptedContent: (
|
|
6605
|
+
reasoningEncryptedContent: (_d = part.encrypted_content) != null ? _d : null
|
|
6292
6606
|
}
|
|
6293
6607
|
}
|
|
6294
6608
|
});
|
|
@@ -6314,7 +6628,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6314
6628
|
break;
|
|
6315
6629
|
}
|
|
6316
6630
|
case "tool_search_call": {
|
|
6317
|
-
const toolCallId = (
|
|
6631
|
+
const toolCallId = (_e = part.call_id) != null ? _e : part.id;
|
|
6318
6632
|
const isHosted = part.execution === "server";
|
|
6319
6633
|
if (isHosted) {
|
|
6320
6634
|
hostedToolSearchCallIds.push(toolCallId);
|
|
@@ -6337,7 +6651,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6337
6651
|
break;
|
|
6338
6652
|
}
|
|
6339
6653
|
case "tool_search_output": {
|
|
6340
|
-
const toolCallId = (
|
|
6654
|
+
const toolCallId = (_g = (_f = part.call_id) != null ? _f : hostedToolSearchCallIds.shift()) != null ? _g : part.id;
|
|
6341
6655
|
content.push({
|
|
6342
6656
|
type: "tool-result",
|
|
6343
6657
|
toolCallId,
|
|
@@ -6408,7 +6722,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6408
6722
|
}
|
|
6409
6723
|
case "message": {
|
|
6410
6724
|
for (const contentPart of part.content) {
|
|
6411
|
-
if (((
|
|
6725
|
+
if (((_i = (_h = options.providerOptions) == null ? void 0 : _h[providerOptionsName]) == null ? void 0 : _i.logprobs) && contentPart.logprobs) {
|
|
6412
6726
|
logprobs.push(contentPart.logprobs);
|
|
6413
6727
|
}
|
|
6414
6728
|
const providerMetadata2 = {
|
|
@@ -6430,7 +6744,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6430
6744
|
content.push({
|
|
6431
6745
|
type: "source",
|
|
6432
6746
|
sourceType: "url",
|
|
6433
|
-
id: (
|
|
6747
|
+
id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : generateId2(),
|
|
6434
6748
|
url: annotation.url,
|
|
6435
6749
|
title: annotation.title
|
|
6436
6750
|
});
|
|
@@ -6438,7 +6752,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6438
6752
|
content.push({
|
|
6439
6753
|
type: "source",
|
|
6440
6754
|
sourceType: "document",
|
|
6441
|
-
id: (
|
|
6755
|
+
id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2(),
|
|
6442
6756
|
mediaType: "text/plain",
|
|
6443
6757
|
title: annotation.filename,
|
|
6444
6758
|
filename: annotation.filename,
|
|
@@ -6454,7 +6768,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6454
6768
|
content.push({
|
|
6455
6769
|
type: "source",
|
|
6456
6770
|
sourceType: "document",
|
|
6457
|
-
id: (
|
|
6771
|
+
id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : generateId2(),
|
|
6458
6772
|
mediaType: "text/plain",
|
|
6459
6773
|
title: annotation.filename,
|
|
6460
6774
|
filename: annotation.filename,
|
|
@@ -6470,7 +6784,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6470
6784
|
content.push({
|
|
6471
6785
|
type: "source",
|
|
6472
6786
|
sourceType: "document",
|
|
6473
|
-
id: (
|
|
6787
|
+
id: (_u = (_t = (_s = this.config).generateId) == null ? void 0 : _t.call(_s)) != null ? _u : generateId2(),
|
|
6474
6788
|
mediaType: "application/octet-stream",
|
|
6475
6789
|
title: annotation.file_id,
|
|
6476
6790
|
filename: annotation.file_id,
|
|
@@ -6540,7 +6854,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6540
6854
|
break;
|
|
6541
6855
|
}
|
|
6542
6856
|
case "mcp_call": {
|
|
6543
|
-
const toolCallId = part.approval_request_id != null ? (
|
|
6857
|
+
const toolCallId = part.approval_request_id != null ? (_v = approvalRequestIdToDummyToolCallIdFromPrompt[part.approval_request_id]) != null ? _v : part.id : part.id;
|
|
6544
6858
|
const toolName = `mcp.${part.name}`;
|
|
6545
6859
|
content.push({
|
|
6546
6860
|
type: "tool-call",
|
|
@@ -6574,8 +6888,8 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6574
6888
|
break;
|
|
6575
6889
|
}
|
|
6576
6890
|
case "mcp_approval_request": {
|
|
6577
|
-
const approvalRequestId = (
|
|
6578
|
-
const dummyToolCallId = (
|
|
6891
|
+
const approvalRequestId = (_w = part.approval_request_id) != null ? _w : part.id;
|
|
6892
|
+
const dummyToolCallId = (_z = (_y = (_x = this.config).generateId) == null ? void 0 : _y.call(_x)) != null ? _z : generateId2();
|
|
6579
6893
|
const toolName = `mcp.${part.name}`;
|
|
6580
6894
|
content.push({
|
|
6581
6895
|
type: "tool-call",
|
|
@@ -6593,20 +6907,36 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6593
6907
|
break;
|
|
6594
6908
|
}
|
|
6595
6909
|
case "computer_call": {
|
|
6910
|
+
if (part.call_id == null) {
|
|
6911
|
+
content.push({
|
|
6912
|
+
type: "tool-call",
|
|
6913
|
+
toolCallId: part.id,
|
|
6914
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
6915
|
+
input: "",
|
|
6916
|
+
providerExecuted: true
|
|
6917
|
+
});
|
|
6918
|
+
content.push({
|
|
6919
|
+
type: "tool-result",
|
|
6920
|
+
toolCallId: part.id,
|
|
6921
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
6922
|
+
result: {
|
|
6923
|
+
type: "computer_use_tool_result",
|
|
6924
|
+
status: part.status
|
|
6925
|
+
}
|
|
6926
|
+
});
|
|
6927
|
+
break;
|
|
6928
|
+
}
|
|
6929
|
+
hasFunctionCall = true;
|
|
6930
|
+
const toolName = toolNameMapping.toCustomToolName("computer");
|
|
6596
6931
|
content.push({
|
|
6597
6932
|
type: "tool-call",
|
|
6598
|
-
toolCallId: part.
|
|
6599
|
-
toolName
|
|
6600
|
-
input:
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
toolCallId: part.id,
|
|
6606
|
-
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
6607
|
-
result: {
|
|
6608
|
-
type: "computer_use_tool_result",
|
|
6609
|
-
status: part.status || "completed"
|
|
6933
|
+
toolCallId: part.call_id,
|
|
6934
|
+
toolName,
|
|
6935
|
+
input: JSON.stringify(mapComputerCallInput(part)),
|
|
6936
|
+
providerMetadata: {
|
|
6937
|
+
[providerOptionsName]: {
|
|
6938
|
+
itemId: part.id
|
|
6939
|
+
}
|
|
6610
6940
|
}
|
|
6611
6941
|
});
|
|
6612
6942
|
break;
|
|
@@ -6625,13 +6955,13 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6625
6955
|
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
6626
6956
|
result: {
|
|
6627
6957
|
queries: part.queries,
|
|
6628
|
-
results: (
|
|
6958
|
+
results: (_B = (_A = part.results) == null ? void 0 : _A.map((result) => ({
|
|
6629
6959
|
attributes: result.attributes,
|
|
6630
6960
|
fileId: result.file_id,
|
|
6631
6961
|
filename: result.filename,
|
|
6632
6962
|
score: result.score,
|
|
6633
6963
|
text: result.text
|
|
6634
|
-
}))) != null ?
|
|
6964
|
+
}))) != null ? _B : null
|
|
6635
6965
|
}
|
|
6636
6966
|
});
|
|
6637
6967
|
break;
|
|
@@ -6695,7 +7025,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6695
7025
|
responseId: response.id,
|
|
6696
7026
|
...logprobs.length > 0 ? { logprobs } : {},
|
|
6697
7027
|
...typeof response.service_tier === "string" ? { serviceTier: response.service_tier } : {},
|
|
6698
|
-
...((
|
|
7028
|
+
...((_C = response.reasoning) == null ? void 0 : _C.context) != null ? { reasoningContext: response.reasoning.context } : {}
|
|
6699
7029
|
}
|
|
6700
7030
|
};
|
|
6701
7031
|
const usage = response.usage;
|
|
@@ -6703,10 +7033,10 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6703
7033
|
content,
|
|
6704
7034
|
finishReason: {
|
|
6705
7035
|
unified: mapOpenAIResponseFinishReason({
|
|
6706
|
-
finishReason: (
|
|
7036
|
+
finishReason: (_D = response.incomplete_details) == null ? void 0 : _D.reason,
|
|
6707
7037
|
hasFunctionCall
|
|
6708
7038
|
}),
|
|
6709
|
-
raw: (
|
|
7039
|
+
raw: (_F = (_E = response.incomplete_details) == null ? void 0 : _E.reason) != null ? _F : void 0
|
|
6710
7040
|
},
|
|
6711
7041
|
usage: convertOpenAIResponsesUsage(usage),
|
|
6712
7042
|
request: { body },
|
|
@@ -6784,7 +7114,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6784
7114
|
controller.enqueue({ type: "stream-start", warnings });
|
|
6785
7115
|
},
|
|
6786
7116
|
transform(chunk, controller) {
|
|
6787
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N;
|
|
7117
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O;
|
|
6788
7118
|
if (options.includeRawChunks) {
|
|
6789
7119
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
6790
7120
|
}
|
|
@@ -6854,15 +7184,15 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6854
7184
|
providerExecuted: true
|
|
6855
7185
|
});
|
|
6856
7186
|
} else if (value.item.type === "computer_call") {
|
|
7187
|
+
const toolCallId = (_a2 = value.item.call_id) != null ? _a2 : value.item.id;
|
|
6857
7188
|
ongoingToolCalls[value.output_index] = {
|
|
6858
|
-
toolName: toolNameMapping.toCustomToolName("
|
|
6859
|
-
toolCallId
|
|
7189
|
+
toolName: toolNameMapping.toCustomToolName("computer"),
|
|
7190
|
+
toolCallId
|
|
6860
7191
|
};
|
|
6861
7192
|
controller.enqueue({
|
|
6862
7193
|
type: "tool-input-start",
|
|
6863
|
-
id:
|
|
6864
|
-
toolName: toolNameMapping.toCustomToolName("
|
|
6865
|
-
providerExecuted: true
|
|
7194
|
+
id: toolCallId,
|
|
7195
|
+
toolName: toolNameMapping.toCustomToolName("computer")
|
|
6866
7196
|
});
|
|
6867
7197
|
} else if (value.item.type === "code_interpreter_call") {
|
|
6868
7198
|
ongoingToolCalls[value.output_index] = {
|
|
@@ -6906,7 +7236,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6906
7236
|
ongoingToolCalls[value.output_index] = {
|
|
6907
7237
|
toolName,
|
|
6908
7238
|
toolCallId,
|
|
6909
|
-
toolSearchExecution: (
|
|
7239
|
+
toolSearchExecution: (_b2 = value.item.execution) != null ? _b2 : "server"
|
|
6910
7240
|
};
|
|
6911
7241
|
if (isHosted) {
|
|
6912
7242
|
controller.enqueue({
|
|
@@ -6963,7 +7293,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6963
7293
|
} else if (value.item.type === "shell_call_output") {
|
|
6964
7294
|
} else if (value.item.type === "message") {
|
|
6965
7295
|
ongoingAnnotations.splice(0, ongoingAnnotations.length);
|
|
6966
|
-
activeMessagePhase = (
|
|
7296
|
+
activeMessagePhase = (_c = value.item.phase) != null ? _c : void 0;
|
|
6967
7297
|
controller.enqueue({
|
|
6968
7298
|
type: "text-start",
|
|
6969
7299
|
id: value.item.id,
|
|
@@ -6987,14 +7317,14 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6987
7317
|
providerMetadata: {
|
|
6988
7318
|
[providerOptionsName]: {
|
|
6989
7319
|
itemId: value.item.id,
|
|
6990
|
-
reasoningEncryptedContent: (
|
|
7320
|
+
reasoningEncryptedContent: (_d = value.item.encrypted_content) != null ? _d : null
|
|
6991
7321
|
}
|
|
6992
7322
|
}
|
|
6993
7323
|
});
|
|
6994
7324
|
}
|
|
6995
7325
|
} else if (isResponseOutputItemDoneChunk(value)) {
|
|
6996
7326
|
if (value.item.type === "message") {
|
|
6997
|
-
const phase = (
|
|
7327
|
+
const phase = (_e = value.item.phase) != null ? _e : activeMessagePhase;
|
|
6998
7328
|
activeMessagePhase = void 0;
|
|
6999
7329
|
controller.enqueue({
|
|
7000
7330
|
type: "text-end",
|
|
@@ -7070,24 +7400,50 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7070
7400
|
});
|
|
7071
7401
|
} else if (value.item.type === "computer_call") {
|
|
7072
7402
|
ongoingToolCalls[value.output_index] = void 0;
|
|
7403
|
+
if (value.item.call_id == null) {
|
|
7404
|
+
controller.enqueue({
|
|
7405
|
+
type: "tool-input-end",
|
|
7406
|
+
id: value.item.id
|
|
7407
|
+
});
|
|
7408
|
+
controller.enqueue({
|
|
7409
|
+
type: "tool-call",
|
|
7410
|
+
toolCallId: value.item.id,
|
|
7411
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
7412
|
+
input: "",
|
|
7413
|
+
providerExecuted: true
|
|
7414
|
+
});
|
|
7415
|
+
controller.enqueue({
|
|
7416
|
+
type: "tool-result",
|
|
7417
|
+
toolCallId: value.item.id,
|
|
7418
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
7419
|
+
result: {
|
|
7420
|
+
type: "computer_use_tool_result",
|
|
7421
|
+
status: value.item.status
|
|
7422
|
+
}
|
|
7423
|
+
});
|
|
7424
|
+
return;
|
|
7425
|
+
}
|
|
7426
|
+
hasFunctionCall = true;
|
|
7427
|
+
const toolName = toolNameMapping.toCustomToolName("computer");
|
|
7428
|
+
const input = JSON.stringify(mapComputerCallInput(value.item));
|
|
7073
7429
|
controller.enqueue({
|
|
7074
|
-
type: "tool-input-
|
|
7075
|
-
id: value.item.
|
|
7430
|
+
type: "tool-input-delta",
|
|
7431
|
+
id: value.item.call_id,
|
|
7432
|
+
delta: input
|
|
7076
7433
|
});
|
|
7077
7434
|
controller.enqueue({
|
|
7078
|
-
type: "tool-
|
|
7079
|
-
|
|
7080
|
-
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
7081
|
-
input: "",
|
|
7082
|
-
providerExecuted: true
|
|
7435
|
+
type: "tool-input-end",
|
|
7436
|
+
id: value.item.call_id
|
|
7083
7437
|
});
|
|
7084
7438
|
controller.enqueue({
|
|
7085
|
-
type: "tool-
|
|
7086
|
-
toolCallId: value.item.
|
|
7087
|
-
toolName
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7439
|
+
type: "tool-call",
|
|
7440
|
+
toolCallId: value.item.call_id,
|
|
7441
|
+
toolName,
|
|
7442
|
+
input,
|
|
7443
|
+
providerMetadata: {
|
|
7444
|
+
[providerOptionsName]: {
|
|
7445
|
+
itemId: value.item.id
|
|
7446
|
+
}
|
|
7091
7447
|
}
|
|
7092
7448
|
});
|
|
7093
7449
|
} else if (value.item.type === "file_search_call") {
|
|
@@ -7098,13 +7454,13 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7098
7454
|
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
7099
7455
|
result: {
|
|
7100
7456
|
queries: value.item.queries,
|
|
7101
|
-
results: (
|
|
7457
|
+
results: (_g = (_f = value.item.results) == null ? void 0 : _f.map((result2) => ({
|
|
7102
7458
|
attributes: result2.attributes,
|
|
7103
7459
|
fileId: result2.file_id,
|
|
7104
7460
|
filename: result2.filename,
|
|
7105
7461
|
score: result2.score,
|
|
7106
7462
|
text: result2.text
|
|
7107
|
-
}))) != null ?
|
|
7463
|
+
}))) != null ? _g : null
|
|
7108
7464
|
}
|
|
7109
7465
|
});
|
|
7110
7466
|
} else if (value.item.type === "code_interpreter_call") {
|
|
@@ -7130,7 +7486,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7130
7486
|
const toolCall = ongoingToolCalls[value.output_index];
|
|
7131
7487
|
const isHosted = value.item.execution === "server";
|
|
7132
7488
|
if (toolCall != null) {
|
|
7133
|
-
const toolCallId = isHosted ? toolCall.toolCallId : (
|
|
7489
|
+
const toolCallId = isHosted ? toolCall.toolCallId : (_h = value.item.call_id) != null ? _h : value.item.id;
|
|
7134
7490
|
if (isHosted) {
|
|
7135
7491
|
hostedToolSearchCallIds.push(toolCallId);
|
|
7136
7492
|
} else {
|
|
@@ -7162,7 +7518,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7162
7518
|
}
|
|
7163
7519
|
ongoingToolCalls[value.output_index] = void 0;
|
|
7164
7520
|
} else if (value.item.type === "tool_search_output") {
|
|
7165
|
-
const toolCallId = (
|
|
7521
|
+
const toolCallId = (_j = (_i = value.item.call_id) != null ? _i : hostedToolSearchCallIds.shift()) != null ? _j : value.item.id;
|
|
7166
7522
|
controller.enqueue({
|
|
7167
7523
|
type: "tool-result",
|
|
7168
7524
|
toolCallId,
|
|
@@ -7178,10 +7534,10 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7178
7534
|
});
|
|
7179
7535
|
} else if (value.item.type === "mcp_call") {
|
|
7180
7536
|
ongoingToolCalls[value.output_index] = void 0;
|
|
7181
|
-
const approvalRequestId = (
|
|
7182
|
-
const aliasedToolCallId = approvalRequestId != null ? (
|
|
7537
|
+
const approvalRequestId = (_k = value.item.approval_request_id) != null ? _k : void 0;
|
|
7538
|
+
const aliasedToolCallId = approvalRequestId != null ? (_m = (_l = approvalRequestIdToDummyToolCallIdFromStream.get(
|
|
7183
7539
|
approvalRequestId
|
|
7184
|
-
)) != null ?
|
|
7540
|
+
)) != null ? _l : approvalRequestIdToDummyToolCallIdFromPrompt[approvalRequestId]) != null ? _m : value.item.id : value.item.id;
|
|
7185
7541
|
const toolName = `mcp.${value.item.name}`;
|
|
7186
7542
|
controller.enqueue({
|
|
7187
7543
|
type: "tool-call",
|
|
@@ -7251,8 +7607,8 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7251
7607
|
ongoingToolCalls[value.output_index] = void 0;
|
|
7252
7608
|
} else if (value.item.type === "mcp_approval_request") {
|
|
7253
7609
|
ongoingToolCalls[value.output_index] = void 0;
|
|
7254
|
-
const dummyToolCallId = (
|
|
7255
|
-
const approvalRequestId = (
|
|
7610
|
+
const dummyToolCallId = (_p = (_o = (_n = self.config).generateId) == null ? void 0 : _o.call(_n)) != null ? _p : generateId2();
|
|
7611
|
+
const approvalRequestId = (_q = value.item.approval_request_id) != null ? _q : value.item.id;
|
|
7256
7612
|
approvalRequestIdToDummyToolCallIdFromStream.set(
|
|
7257
7613
|
approvalRequestId,
|
|
7258
7614
|
dummyToolCallId
|
|
@@ -7341,7 +7697,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7341
7697
|
providerMetadata: {
|
|
7342
7698
|
[providerOptionsName]: {
|
|
7343
7699
|
itemId: value.item.id,
|
|
7344
|
-
reasoningEncryptedContent: (
|
|
7700
|
+
reasoningEncryptedContent: (_r = value.item.encrypted_content) != null ? _r : null
|
|
7345
7701
|
}
|
|
7346
7702
|
}
|
|
7347
7703
|
});
|
|
@@ -7466,7 +7822,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7466
7822
|
id: value.item_id,
|
|
7467
7823
|
delta: value.delta
|
|
7468
7824
|
});
|
|
7469
|
-
if (((
|
|
7825
|
+
if (((_t = (_s = options.providerOptions) == null ? void 0 : _s[providerOptionsName]) == null ? void 0 : _t.logprobs) && value.logprobs) {
|
|
7470
7826
|
logprobs.push(value.logprobs);
|
|
7471
7827
|
}
|
|
7472
7828
|
} else if (value.type === "response.reasoning_summary_part.added") {
|
|
@@ -7495,7 +7851,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7495
7851
|
providerMetadata: {
|
|
7496
7852
|
[providerOptionsName]: {
|
|
7497
7853
|
itemId: value.item_id,
|
|
7498
|
-
reasoningEncryptedContent: (
|
|
7854
|
+
reasoningEncryptedContent: (_v = (_u = activeReasoning[value.item_id]) == null ? void 0 : _u.encryptedContent) != null ? _v : null
|
|
7499
7855
|
}
|
|
7500
7856
|
}
|
|
7501
7857
|
});
|
|
@@ -7529,20 +7885,20 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7529
7885
|
} else if (isResponseFinishedChunk(value)) {
|
|
7530
7886
|
finishReason = {
|
|
7531
7887
|
unified: mapOpenAIResponseFinishReason({
|
|
7532
|
-
finishReason: (
|
|
7888
|
+
finishReason: (_w = value.response.incomplete_details) == null ? void 0 : _w.reason,
|
|
7533
7889
|
hasFunctionCall
|
|
7534
7890
|
}),
|
|
7535
|
-
raw: (
|
|
7891
|
+
raw: (_y = (_x = value.response.incomplete_details) == null ? void 0 : _x.reason) != null ? _y : void 0
|
|
7536
7892
|
};
|
|
7537
7893
|
usage = value.response.usage;
|
|
7538
7894
|
if (typeof value.response.service_tier === "string") {
|
|
7539
7895
|
serviceTier = value.response.service_tier;
|
|
7540
7896
|
}
|
|
7541
|
-
if (((
|
|
7897
|
+
if (((_z = value.response.reasoning) == null ? void 0 : _z.context) != null) {
|
|
7542
7898
|
reasoningContext = value.response.reasoning.context;
|
|
7543
7899
|
}
|
|
7544
7900
|
} else if (isResponseFailedChunk(value)) {
|
|
7545
|
-
const incompleteReason = (
|
|
7901
|
+
const incompleteReason = (_A = value.response.incomplete_details) == null ? void 0 : _A.reason;
|
|
7546
7902
|
finishReason = {
|
|
7547
7903
|
unified: incompleteReason ? mapOpenAIResponseFinishReason({
|
|
7548
7904
|
finishReason: incompleteReason,
|
|
@@ -7550,8 +7906,8 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7550
7906
|
}) : "error",
|
|
7551
7907
|
raw: incompleteReason != null ? incompleteReason : "error"
|
|
7552
7908
|
};
|
|
7553
|
-
usage = (
|
|
7554
|
-
if (((
|
|
7909
|
+
usage = (_B = value.response.usage) != null ? _B : void 0;
|
|
7910
|
+
if (((_C = value.response.reasoning) == null ? void 0 : _C.context) != null) {
|
|
7555
7911
|
reasoningContext = value.response.reasoning.context;
|
|
7556
7912
|
}
|
|
7557
7913
|
if (!encounteredStreamError && value.response.error != null) {
|
|
@@ -7575,7 +7931,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7575
7931
|
controller.enqueue({
|
|
7576
7932
|
type: "source",
|
|
7577
7933
|
sourceType: "url",
|
|
7578
|
-
id: (
|
|
7934
|
+
id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : generateId2(),
|
|
7579
7935
|
url: value.annotation.url,
|
|
7580
7936
|
title: value.annotation.title
|
|
7581
7937
|
});
|
|
@@ -7583,7 +7939,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7583
7939
|
controller.enqueue({
|
|
7584
7940
|
type: "source",
|
|
7585
7941
|
sourceType: "document",
|
|
7586
|
-
id: (
|
|
7942
|
+
id: (_I = (_H = (_G = self.config).generateId) == null ? void 0 : _H.call(_G)) != null ? _I : generateId2(),
|
|
7587
7943
|
mediaType: "text/plain",
|
|
7588
7944
|
title: value.annotation.filename,
|
|
7589
7945
|
filename: value.annotation.filename,
|
|
@@ -7599,7 +7955,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7599
7955
|
controller.enqueue({
|
|
7600
7956
|
type: "source",
|
|
7601
7957
|
sourceType: "document",
|
|
7602
|
-
id: (
|
|
7958
|
+
id: (_L = (_K = (_J = self.config).generateId) == null ? void 0 : _K.call(_J)) != null ? _L : generateId2(),
|
|
7603
7959
|
mediaType: "text/plain",
|
|
7604
7960
|
title: value.annotation.filename,
|
|
7605
7961
|
filename: value.annotation.filename,
|
|
@@ -7615,7 +7971,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7615
7971
|
controller.enqueue({
|
|
7616
7972
|
type: "source",
|
|
7617
7973
|
sourceType: "document",
|
|
7618
|
-
id: (
|
|
7974
|
+
id: (_O = (_N = (_M = self.config).generateId) == null ? void 0 : _N.call(_M)) != null ? _O : generateId2(),
|
|
7619
7975
|
mediaType: "application/octet-stream",
|
|
7620
7976
|
title: value.annotation.file_id,
|
|
7621
7977
|
filename: value.annotation.file_id,
|
|
@@ -7776,15 +8132,15 @@ import {
|
|
|
7776
8132
|
|
|
7777
8133
|
// src/speech/openai-speech-model-options.ts
|
|
7778
8134
|
import {
|
|
7779
|
-
lazySchema as
|
|
7780
|
-
zodSchema as
|
|
8135
|
+
lazySchema as lazySchema25,
|
|
8136
|
+
zodSchema as zodSchema25
|
|
7781
8137
|
} from "@ai-sdk/provider-utils";
|
|
7782
|
-
import { z as
|
|
7783
|
-
var openaiSpeechModelOptionsSchema =
|
|
7784
|
-
() =>
|
|
7785
|
-
|
|
7786
|
-
instructions:
|
|
7787
|
-
speed:
|
|
8138
|
+
import { z as z27 } from "zod/v4";
|
|
8139
|
+
var openaiSpeechModelOptionsSchema = lazySchema25(
|
|
8140
|
+
() => zodSchema25(
|
|
8141
|
+
z27.object({
|
|
8142
|
+
instructions: z27.string().nullish(),
|
|
8143
|
+
speed: z27.number().min(0.25).max(4).default(1).nullish()
|
|
7788
8144
|
})
|
|
7789
8145
|
)
|
|
7790
8146
|
);
|
|
@@ -7921,33 +8277,33 @@ import {
|
|
|
7921
8277
|
} from "@ai-sdk/provider-utils";
|
|
7922
8278
|
|
|
7923
8279
|
// src/transcription/openai-transcription-api.ts
|
|
7924
|
-
import { lazySchema as
|
|
7925
|
-
import { z as
|
|
7926
|
-
var openaiTranscriptionResponseSchema =
|
|
7927
|
-
() =>
|
|
7928
|
-
|
|
7929
|
-
text:
|
|
7930
|
-
language:
|
|
7931
|
-
duration:
|
|
7932
|
-
words:
|
|
7933
|
-
|
|
7934
|
-
word:
|
|
7935
|
-
start:
|
|
7936
|
-
end:
|
|
8280
|
+
import { lazySchema as lazySchema26, zodSchema as zodSchema26 } from "@ai-sdk/provider-utils";
|
|
8281
|
+
import { z as z28 } from "zod/v4";
|
|
8282
|
+
var openaiTranscriptionResponseSchema = lazySchema26(
|
|
8283
|
+
() => zodSchema26(
|
|
8284
|
+
z28.object({
|
|
8285
|
+
text: z28.string(),
|
|
8286
|
+
language: z28.string().nullish(),
|
|
8287
|
+
duration: z28.number().nullish(),
|
|
8288
|
+
words: z28.array(
|
|
8289
|
+
z28.object({
|
|
8290
|
+
word: z28.string(),
|
|
8291
|
+
start: z28.number(),
|
|
8292
|
+
end: z28.number()
|
|
7937
8293
|
})
|
|
7938
8294
|
).nullish(),
|
|
7939
|
-
segments:
|
|
7940
|
-
|
|
7941
|
-
id:
|
|
7942
|
-
seek:
|
|
7943
|
-
start:
|
|
7944
|
-
end:
|
|
7945
|
-
text:
|
|
7946
|
-
tokens:
|
|
7947
|
-
temperature:
|
|
7948
|
-
avg_logprob:
|
|
7949
|
-
compression_ratio:
|
|
7950
|
-
no_speech_prob:
|
|
8295
|
+
segments: z28.array(
|
|
8296
|
+
z28.object({
|
|
8297
|
+
id: z28.number(),
|
|
8298
|
+
seek: z28.number(),
|
|
8299
|
+
start: z28.number(),
|
|
8300
|
+
end: z28.number(),
|
|
8301
|
+
text: z28.string(),
|
|
8302
|
+
tokens: z28.array(z28.number()),
|
|
8303
|
+
temperature: z28.number(),
|
|
8304
|
+
avg_logprob: z28.number(),
|
|
8305
|
+
compression_ratio: z28.number(),
|
|
8306
|
+
no_speech_prob: z28.number()
|
|
7951
8307
|
})
|
|
7952
8308
|
).nullish()
|
|
7953
8309
|
})
|
|
@@ -7956,47 +8312,47 @@ var openaiTranscriptionResponseSchema = lazySchema25(
|
|
|
7956
8312
|
|
|
7957
8313
|
// src/transcription/openai-transcription-model-options.ts
|
|
7958
8314
|
import {
|
|
7959
|
-
lazySchema as
|
|
7960
|
-
zodSchema as
|
|
8315
|
+
lazySchema as lazySchema27,
|
|
8316
|
+
zodSchema as zodSchema27
|
|
7961
8317
|
} from "@ai-sdk/provider-utils";
|
|
7962
|
-
import { z as
|
|
7963
|
-
var openAITranscriptionModelOptions =
|
|
7964
|
-
() =>
|
|
7965
|
-
|
|
8318
|
+
import { z as z29 } from "zod/v4";
|
|
8319
|
+
var openAITranscriptionModelOptions = lazySchema27(
|
|
8320
|
+
() => zodSchema27(
|
|
8321
|
+
z29.object({
|
|
7966
8322
|
/**
|
|
7967
8323
|
* Additional information to include in the transcription response.
|
|
7968
8324
|
*/
|
|
7969
|
-
include:
|
|
8325
|
+
include: z29.array(z29.string()).optional(),
|
|
7970
8326
|
/**
|
|
7971
8327
|
* The language of the input audio in ISO-639-1 format.
|
|
7972
8328
|
*/
|
|
7973
|
-
language:
|
|
8329
|
+
language: z29.string().optional(),
|
|
7974
8330
|
/**
|
|
7975
8331
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
7976
8332
|
*/
|
|
7977
|
-
prompt:
|
|
8333
|
+
prompt: z29.string().optional(),
|
|
7978
8334
|
/**
|
|
7979
8335
|
* The sampling temperature, between 0 and 1.
|
|
7980
8336
|
* @default 0
|
|
7981
8337
|
*/
|
|
7982
|
-
temperature:
|
|
8338
|
+
temperature: z29.number().min(0).max(1).default(0).optional(),
|
|
7983
8339
|
/**
|
|
7984
8340
|
* The timestamp granularities to populate for this transcription.
|
|
7985
8341
|
* @default ['segment']
|
|
7986
8342
|
*/
|
|
7987
|
-
timestampGranularities:
|
|
8343
|
+
timestampGranularities: z29.array(z29.enum(["word", "segment"])).default(["segment"]).optional(),
|
|
7988
8344
|
/**
|
|
7989
8345
|
* Options for streaming transcription models such as `gpt-realtime-whisper`.
|
|
7990
8346
|
*/
|
|
7991
|
-
streaming:
|
|
8347
|
+
streaming: z29.object({
|
|
7992
8348
|
/**
|
|
7993
8349
|
* Latency/accuracy tradeoff for realtime transcription.
|
|
7994
8350
|
*/
|
|
7995
|
-
delay:
|
|
8351
|
+
delay: z29.enum(["minimal", "low", "medium", "high", "xhigh"]).optional(),
|
|
7996
8352
|
/**
|
|
7997
8353
|
* Additional fields to include in realtime transcription events.
|
|
7998
8354
|
*/
|
|
7999
|
-
include:
|
|
8355
|
+
include: z29.array(z29.string()).optional()
|
|
8000
8356
|
}).optional()
|
|
8001
8357
|
})
|
|
8002
8358
|
)
|
|
@@ -8441,28 +8797,28 @@ import {
|
|
|
8441
8797
|
} from "@ai-sdk/provider-utils";
|
|
8442
8798
|
|
|
8443
8799
|
// src/skills/openai-skills-api.ts
|
|
8444
|
-
import { lazySchema as
|
|
8445
|
-
import { z as
|
|
8446
|
-
var openaiSkillResponseSchema =
|
|
8447
|
-
() =>
|
|
8448
|
-
|
|
8449
|
-
id:
|
|
8450
|
-
name:
|
|
8451
|
-
description:
|
|
8452
|
-
default_version:
|
|
8453
|
-
latest_version:
|
|
8454
|
-
created_at:
|
|
8455
|
-
updated_at:
|
|
8800
|
+
import { lazySchema as lazySchema28, zodSchema as zodSchema28 } from "@ai-sdk/provider-utils";
|
|
8801
|
+
import { z as z30 } from "zod/v4";
|
|
8802
|
+
var openaiSkillResponseSchema = lazySchema28(
|
|
8803
|
+
() => zodSchema28(
|
|
8804
|
+
z30.object({
|
|
8805
|
+
id: z30.string(),
|
|
8806
|
+
name: z30.string().nullish(),
|
|
8807
|
+
description: z30.string().nullish(),
|
|
8808
|
+
default_version: z30.string().nullish(),
|
|
8809
|
+
latest_version: z30.string().nullish(),
|
|
8810
|
+
created_at: z30.number(),
|
|
8811
|
+
updated_at: z30.number().nullish()
|
|
8456
8812
|
})
|
|
8457
8813
|
)
|
|
8458
8814
|
);
|
|
8459
|
-
var openaiSkillVersionResponseSchema =
|
|
8460
|
-
() =>
|
|
8461
|
-
|
|
8462
|
-
id:
|
|
8463
|
-
version:
|
|
8464
|
-
name:
|
|
8465
|
-
description:
|
|
8815
|
+
var openaiSkillVersionResponseSchema = lazySchema28(
|
|
8816
|
+
() => zodSchema28(
|
|
8817
|
+
z30.object({
|
|
8818
|
+
id: z30.string(),
|
|
8819
|
+
version: z30.string().nullish(),
|
|
8820
|
+
name: z30.string().nullish(),
|
|
8821
|
+
description: z30.string().nullish()
|
|
8466
8822
|
})
|
|
8467
8823
|
)
|
|
8468
8824
|
);
|
|
@@ -8517,7 +8873,7 @@ var OpenAISkills = class {
|
|
|
8517
8873
|
};
|
|
8518
8874
|
|
|
8519
8875
|
// src/version.ts
|
|
8520
|
-
var VERSION = true ? "4.0.
|
|
8876
|
+
var VERSION = true ? "4.0.16" : "0.0.0-test";
|
|
8521
8877
|
|
|
8522
8878
|
// src/openai-provider.ts
|
|
8523
8879
|
function createOpenAI(options = {}) {
|