@ai-sdk/openai 2.0.141 → 2.0.143
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 +13 -0
- package/dist/index.d.mts +35 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +528 -481
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +528 -481
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +607 -560
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +607 -560
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/internal/index.mjs
CHANGED
|
@@ -2479,14 +2479,27 @@ import {
|
|
|
2479
2479
|
safeValidateTypes,
|
|
2480
2480
|
validateTypes
|
|
2481
2481
|
} from "@ai-sdk/provider-utils";
|
|
2482
|
-
import { z as
|
|
2482
|
+
import { z as z17 } from "zod/v4";
|
|
2483
|
+
|
|
2484
|
+
// src/responses/openai-responses-text-format.ts
|
|
2485
|
+
import { z as z13 } from "zod/v4";
|
|
2486
|
+
var openaiResponsesTextFormatSchema = () => z13.discriminatedUnion("type", [
|
|
2487
|
+
z13.object({ type: z13.literal("text") }),
|
|
2488
|
+
z13.object({
|
|
2489
|
+
type: z13.literal("json_schema"),
|
|
2490
|
+
name: z13.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/),
|
|
2491
|
+
schema: z13.record(z13.string(), z13.json()),
|
|
2492
|
+
description: z13.string().optional(),
|
|
2493
|
+
strict: z13.boolean().optional()
|
|
2494
|
+
})
|
|
2495
|
+
]);
|
|
2483
2496
|
|
|
2484
2497
|
// src/responses/openai-responses-options.ts
|
|
2485
2498
|
import {
|
|
2486
2499
|
lazyValidator as lazyValidator12,
|
|
2487
2500
|
zodSchema as zodSchema13
|
|
2488
2501
|
} from "@ai-sdk/provider-utils";
|
|
2489
|
-
import { z as
|
|
2502
|
+
import { z as z14 } from "zod/v4";
|
|
2490
2503
|
var TOP_LOGPROBS_MAX = 20;
|
|
2491
2504
|
var openaiResponsesReasoningModelIds = [
|
|
2492
2505
|
"o1",
|
|
@@ -2578,17 +2591,17 @@ var openaiResponsesModelIds = [
|
|
|
2578
2591
|
];
|
|
2579
2592
|
var openaiResponsesProviderOptionsSchema = lazyValidator12(
|
|
2580
2593
|
() => zodSchema13(
|
|
2581
|
-
|
|
2582
|
-
conversation:
|
|
2583
|
-
include:
|
|
2584
|
-
|
|
2594
|
+
z14.object({
|
|
2595
|
+
conversation: z14.string().nullish(),
|
|
2596
|
+
include: z14.array(
|
|
2597
|
+
z14.enum([
|
|
2585
2598
|
"reasoning.encrypted_content",
|
|
2586
2599
|
// handled internally by default, only needed for unknown reasoning models
|
|
2587
2600
|
"file_search_call.results",
|
|
2588
2601
|
"message.output_text.logprobs"
|
|
2589
2602
|
])
|
|
2590
2603
|
).nullish(),
|
|
2591
|
-
instructions:
|
|
2604
|
+
instructions: z14.string().nullish(),
|
|
2592
2605
|
/**
|
|
2593
2606
|
* Return the log probabilities of the tokens.
|
|
2594
2607
|
*
|
|
@@ -2601,25 +2614,26 @@ var openaiResponsesProviderOptionsSchema = lazyValidator12(
|
|
|
2601
2614
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
2602
2615
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
2603
2616
|
*/
|
|
2604
|
-
logprobs:
|
|
2617
|
+
logprobs: z14.union([z14.boolean(), z14.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
2605
2618
|
/**
|
|
2606
2619
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
2607
2620
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
2608
2621
|
* Any further attempts to call a tool by the model will be ignored.
|
|
2609
2622
|
*/
|
|
2610
|
-
maxToolCalls:
|
|
2611
|
-
metadata:
|
|
2612
|
-
parallelToolCalls:
|
|
2613
|
-
previousResponseId:
|
|
2614
|
-
promptCacheKey:
|
|
2623
|
+
maxToolCalls: z14.number().nullish(),
|
|
2624
|
+
metadata: z14.any().nullish(),
|
|
2625
|
+
parallelToolCalls: z14.boolean().nullish(),
|
|
2626
|
+
previousResponseId: z14.string().nullish(),
|
|
2627
|
+
promptCacheKey: z14.string().nullish(),
|
|
2615
2628
|
/**
|
|
2616
2629
|
* Prompt cache behavior for GPT-5.6 and later models.
|
|
2617
2630
|
* `mode` controls whether OpenAI also places an implicit breakpoint.
|
|
2618
2631
|
* `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
|
|
2619
2632
|
*/
|
|
2620
|
-
promptCacheOptions:
|
|
2621
|
-
|
|
2622
|
-
|
|
2633
|
+
promptCacheOptions: z14.object({
|
|
2634
|
+
comparisonResponseId: z14.string().optional(),
|
|
2635
|
+
mode: z14.enum(["implicit", "explicit"]).optional(),
|
|
2636
|
+
ttl: z14.literal("30m").optional()
|
|
2623
2637
|
}).optional(),
|
|
2624
2638
|
/**
|
|
2625
2639
|
* The retention policy for the prompt cache.
|
|
@@ -2631,14 +2645,14 @@ var openaiResponsesProviderOptionsSchema = lazyValidator12(
|
|
|
2631
2645
|
*
|
|
2632
2646
|
* @default 'in_memory'
|
|
2633
2647
|
*/
|
|
2634
|
-
promptCacheRetention:
|
|
2648
|
+
promptCacheRetention: z14.enum(["in_memory", "24h"]).nullish(),
|
|
2635
2649
|
/**
|
|
2636
2650
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
2637
2651
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
2638
2652
|
* GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
2639
2653
|
* Supported values vary by model.
|
|
2640
2654
|
*/
|
|
2641
|
-
reasoningEffort:
|
|
2655
|
+
reasoningEffort: z14.string().nullish(),
|
|
2642
2656
|
/**
|
|
2643
2657
|
* Updates the reasoning effort for GPT-6 and later models starting with this response
|
|
2644
2658
|
* without changing the request-level reasoning effort. This preserves the
|
|
@@ -2647,32 +2661,36 @@ var openaiResponsesProviderOptionsSchema = lazyValidator12(
|
|
|
2647
2661
|
* Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be
|
|
2648
2662
|
* combined with automatic truncation.
|
|
2649
2663
|
*/
|
|
2650
|
-
reasoningEffortUpdate:
|
|
2664
|
+
reasoningEffortUpdate: z14.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
2651
2665
|
/**
|
|
2652
2666
|
* Controls how much model work GPT-5.6 performs before returning a final answer.
|
|
2653
2667
|
* `standard` is the default. `pro` increases quality, latency, and token usage.
|
|
2654
2668
|
*/
|
|
2655
|
-
reasoningMode:
|
|
2669
|
+
reasoningMode: z14.enum(["standard", "pro"]).optional(),
|
|
2656
2670
|
/**
|
|
2657
2671
|
* Controls which available reasoning items GPT-5.6 can use.
|
|
2658
2672
|
* `auto` uses the model default, `current_turn` excludes reasoning from earlier
|
|
2659
2673
|
* turns, and `all_turns` makes compatible earlier reasoning available.
|
|
2660
2674
|
*/
|
|
2661
|
-
reasoningContext:
|
|
2662
|
-
reasoningSummary:
|
|
2663
|
-
safetyIdentifier:
|
|
2664
|
-
serviceTier:
|
|
2665
|
-
store:
|
|
2666
|
-
strictJsonSchema:
|
|
2667
|
-
textVerbosity:
|
|
2668
|
-
|
|
2669
|
-
|
|
2675
|
+
reasoningContext: z14.enum(["auto", "current_turn", "all_turns"]).optional(),
|
|
2676
|
+
reasoningSummary: z14.string().nullish(),
|
|
2677
|
+
safetyIdentifier: z14.string().nullish(),
|
|
2678
|
+
serviceTier: z14.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
2679
|
+
store: z14.boolean().nullish(),
|
|
2680
|
+
strictJsonSchema: z14.boolean().nullish(),
|
|
2681
|
+
textVerbosity: z14.enum(["low", "medium", "high"]).nullish(),
|
|
2682
|
+
/** Keep the initial wire format stable while Output validates the current schema. */
|
|
2683
|
+
textFormat: openaiResponsesTextFormatSchema().optional(),
|
|
2684
|
+
truncation: z14.enum(["auto", "disabled"]).nullish(),
|
|
2685
|
+
user: z14.string().nullish()
|
|
2670
2686
|
})
|
|
2671
2687
|
)
|
|
2672
2688
|
);
|
|
2673
2689
|
var openaiResponsesSystemMessageOptionsSchema = lazyValidator12(
|
|
2674
2690
|
() => zodSchema13(
|
|
2675
|
-
|
|
2691
|
+
z14.object({
|
|
2692
|
+
/** Replace the format at this position; requires empty system content. */
|
|
2693
|
+
textFormatUpdate: openaiResponsesTextFormatSchema().optional(),
|
|
2676
2694
|
/**
|
|
2677
2695
|
* Emit a configuration update at this position in Responses history.
|
|
2678
2696
|
* Requires empty system message content and the same supported
|
|
@@ -2681,7 +2699,7 @@ var openaiResponsesSystemMessageOptionsSchema = lazyValidator12(
|
|
|
2681
2699
|
*
|
|
2682
2700
|
* @see https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation
|
|
2683
2701
|
*/
|
|
2684
|
-
reasoningEffortUpdate:
|
|
2702
|
+
reasoningEffortUpdate: z14.enum(["low", "medium", "high", "xhigh", "max"]).optional()
|
|
2685
2703
|
})
|
|
2686
2704
|
)
|
|
2687
2705
|
);
|
|
@@ -2692,23 +2710,23 @@ import {
|
|
|
2692
2710
|
lazySchema as lazySchema2,
|
|
2693
2711
|
zodSchema as zodSchema14
|
|
2694
2712
|
} from "@ai-sdk/provider-utils";
|
|
2695
|
-
import { z as
|
|
2713
|
+
import { z as z15 } from "zod/v4";
|
|
2696
2714
|
var localShellInputSchema = lazySchema2(
|
|
2697
2715
|
() => zodSchema14(
|
|
2698
|
-
|
|
2699
|
-
action:
|
|
2700
|
-
type:
|
|
2701
|
-
command:
|
|
2702
|
-
timeoutMs:
|
|
2703
|
-
user:
|
|
2704
|
-
workingDirectory:
|
|
2705
|
-
env:
|
|
2716
|
+
z15.object({
|
|
2717
|
+
action: z15.object({
|
|
2718
|
+
type: z15.literal("exec"),
|
|
2719
|
+
command: z15.array(z15.string()),
|
|
2720
|
+
timeoutMs: z15.number().optional(),
|
|
2721
|
+
user: z15.string().optional(),
|
|
2722
|
+
workingDirectory: z15.string().optional(),
|
|
2723
|
+
env: z15.record(z15.string(), z15.string()).optional()
|
|
2706
2724
|
})
|
|
2707
2725
|
})
|
|
2708
2726
|
)
|
|
2709
2727
|
);
|
|
2710
2728
|
var localShellOutputSchema = lazySchema2(
|
|
2711
|
-
() => zodSchema14(
|
|
2729
|
+
() => zodSchema14(z15.object({ output: z15.string() }))
|
|
2712
2730
|
);
|
|
2713
2731
|
var localShell = createProviderDefinedToolFactoryWithOutputSchema({
|
|
2714
2732
|
id: "openai.local_shell",
|
|
@@ -2723,49 +2741,49 @@ import {
|
|
|
2723
2741
|
lazySchema as lazySchema3,
|
|
2724
2742
|
zodSchema as zodSchema15
|
|
2725
2743
|
} from "@ai-sdk/provider-utils";
|
|
2726
|
-
import { z as
|
|
2744
|
+
import { z as z16 } from "zod/v4";
|
|
2727
2745
|
var webSearchArgsSchema = lazySchema3(
|
|
2728
2746
|
() => zodSchema15(
|
|
2729
|
-
|
|
2730
|
-
externalWebAccess:
|
|
2731
|
-
filters:
|
|
2732
|
-
allowedDomains:
|
|
2733
|
-
blockedDomains:
|
|
2747
|
+
z16.object({
|
|
2748
|
+
externalWebAccess: z16.boolean().optional(),
|
|
2749
|
+
filters: z16.object({
|
|
2750
|
+
allowedDomains: z16.array(z16.string()).optional(),
|
|
2751
|
+
blockedDomains: z16.array(z16.string()).optional()
|
|
2734
2752
|
}).optional(),
|
|
2735
|
-
searchContextSize:
|
|
2736
|
-
userLocation:
|
|
2737
|
-
type:
|
|
2738
|
-
country:
|
|
2739
|
-
city:
|
|
2740
|
-
region:
|
|
2741
|
-
timezone:
|
|
2753
|
+
searchContextSize: z16.enum(["low", "medium", "high"]).optional(),
|
|
2754
|
+
userLocation: z16.object({
|
|
2755
|
+
type: z16.literal("approximate"),
|
|
2756
|
+
country: z16.string().optional(),
|
|
2757
|
+
city: z16.string().optional(),
|
|
2758
|
+
region: z16.string().optional(),
|
|
2759
|
+
timezone: z16.string().optional()
|
|
2742
2760
|
}).optional()
|
|
2743
2761
|
})
|
|
2744
2762
|
)
|
|
2745
2763
|
);
|
|
2746
|
-
var webSearchInputSchema = lazySchema3(() => zodSchema15(
|
|
2764
|
+
var webSearchInputSchema = lazySchema3(() => zodSchema15(z16.object({})));
|
|
2747
2765
|
var webSearchOutputSchema = lazySchema3(
|
|
2748
2766
|
() => zodSchema15(
|
|
2749
|
-
|
|
2750
|
-
action:
|
|
2751
|
-
|
|
2752
|
-
type:
|
|
2753
|
-
query:
|
|
2767
|
+
z16.object({
|
|
2768
|
+
action: z16.discriminatedUnion("type", [
|
|
2769
|
+
z16.object({
|
|
2770
|
+
type: z16.literal("search"),
|
|
2771
|
+
query: z16.string().optional()
|
|
2754
2772
|
}),
|
|
2755
|
-
|
|
2756
|
-
type:
|
|
2757
|
-
url:
|
|
2773
|
+
z16.object({
|
|
2774
|
+
type: z16.literal("openPage"),
|
|
2775
|
+
url: z16.string().nullish()
|
|
2758
2776
|
}),
|
|
2759
|
-
|
|
2760
|
-
type:
|
|
2761
|
-
url:
|
|
2762
|
-
pattern:
|
|
2777
|
+
z16.object({
|
|
2778
|
+
type: z16.literal("findInPage"),
|
|
2779
|
+
url: z16.string().nullish(),
|
|
2780
|
+
pattern: z16.string().nullish()
|
|
2763
2781
|
})
|
|
2764
2782
|
]).optional(),
|
|
2765
|
-
sources:
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2783
|
+
sources: z16.array(
|
|
2784
|
+
z16.discriminatedUnion("type", [
|
|
2785
|
+
z16.object({ type: z16.literal("url"), url: z16.string() }),
|
|
2786
|
+
z16.object({ type: z16.literal("api"), name: z16.string() })
|
|
2769
2787
|
])
|
|
2770
2788
|
).optional()
|
|
2771
2789
|
})
|
|
@@ -2869,17 +2887,24 @@ async function convertToOpenAIResponsesInput({
|
|
|
2869
2887
|
});
|
|
2870
2888
|
}
|
|
2871
2889
|
const effort = options == null ? void 0 : options.reasoningEffortUpdate;
|
|
2872
|
-
|
|
2873
|
-
|
|
2890
|
+
const textFormat = options == null ? void 0 : options.textFormatUpdate;
|
|
2891
|
+
if (effort != null || textFormat != null) {
|
|
2892
|
+
const feature = effort != null ? "reasoningEffortUpdate" : "textFormatUpdate";
|
|
2893
|
+
const unsupportedReason = content !== "" ? `Message-level ${feature} requires empty system message content.` : configurationUpdateUnsupportedReason;
|
|
2874
2894
|
if (unsupportedReason != null) {
|
|
2875
2895
|
throw new UnsupportedFunctionalityError4({
|
|
2876
|
-
functionality:
|
|
2896
|
+
functionality: `Message-level ${feature}`,
|
|
2877
2897
|
message: unsupportedReason
|
|
2878
2898
|
});
|
|
2879
2899
|
}
|
|
2880
2900
|
input.push({
|
|
2881
2901
|
type: "configuration_update",
|
|
2882
|
-
reasoning: { effort }
|
|
2902
|
+
...effort != null && { reasoning: { effort } },
|
|
2903
|
+
...textFormat != null && {
|
|
2904
|
+
text: {
|
|
2905
|
+
format: textFormat
|
|
2906
|
+
}
|
|
2907
|
+
}
|
|
2883
2908
|
});
|
|
2884
2909
|
break;
|
|
2885
2910
|
}
|
|
@@ -3249,9 +3274,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
3249
3274
|
}
|
|
3250
3275
|
var openaiResponsesReasoningProviderOptionsSchema = lazySchema4(
|
|
3251
3276
|
() => zodSchema16(
|
|
3252
|
-
|
|
3253
|
-
itemId:
|
|
3254
|
-
reasoningEncryptedContent:
|
|
3277
|
+
z17.object({
|
|
3278
|
+
itemId: z17.string().nullish(),
|
|
3279
|
+
reasoningEncryptedContent: z17.string().nullish()
|
|
3255
3280
|
})
|
|
3256
3281
|
)
|
|
3257
3282
|
);
|
|
@@ -3292,301 +3317,308 @@ import {
|
|
|
3292
3317
|
lazyValidator as lazyValidator13,
|
|
3293
3318
|
zodSchema as zodSchema17
|
|
3294
3319
|
} from "@ai-sdk/provider-utils";
|
|
3295
|
-
import { z as
|
|
3320
|
+
import { z as z18 } from "zod/v4";
|
|
3321
|
+
var openaiResponsesPromptCacheDiagnosticsSchema = () => z18.object({
|
|
3322
|
+
type: z18.string(),
|
|
3323
|
+
reason: z18.string().nullish(),
|
|
3324
|
+
cache_missed_tokens: z18.number().nullish(),
|
|
3325
|
+
comparison_reusable_tokens: z18.number().nullish()
|
|
3326
|
+
});
|
|
3296
3327
|
var openaiResponsesChunkSchema = lazyValidator13(
|
|
3297
3328
|
() => zodSchema17(
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
type:
|
|
3301
|
-
item_id:
|
|
3302
|
-
delta:
|
|
3303
|
-
logprobs:
|
|
3304
|
-
|
|
3305
|
-
token:
|
|
3306
|
-
logprob:
|
|
3307
|
-
top_logprobs:
|
|
3308
|
-
|
|
3309
|
-
token:
|
|
3310
|
-
logprob:
|
|
3329
|
+
z18.union([
|
|
3330
|
+
z18.object({
|
|
3331
|
+
type: z18.literal("response.output_text.delta"),
|
|
3332
|
+
item_id: z18.string(),
|
|
3333
|
+
delta: z18.string(),
|
|
3334
|
+
logprobs: z18.array(
|
|
3335
|
+
z18.object({
|
|
3336
|
+
token: z18.string(),
|
|
3337
|
+
logprob: z18.number(),
|
|
3338
|
+
top_logprobs: z18.array(
|
|
3339
|
+
z18.object({
|
|
3340
|
+
token: z18.string(),
|
|
3341
|
+
logprob: z18.number()
|
|
3311
3342
|
})
|
|
3312
3343
|
)
|
|
3313
3344
|
})
|
|
3314
3345
|
).nullish()
|
|
3315
3346
|
}),
|
|
3316
|
-
|
|
3317
|
-
type:
|
|
3318
|
-
item_id:
|
|
3319
|
-
output_index:
|
|
3320
|
-
content_index:
|
|
3321
|
-
delta:
|
|
3347
|
+
z18.object({
|
|
3348
|
+
type: z18.literal("response.refusal.delta"),
|
|
3349
|
+
item_id: z18.string(),
|
|
3350
|
+
output_index: z18.number().nullish(),
|
|
3351
|
+
content_index: z18.number().nullish(),
|
|
3352
|
+
delta: z18.string()
|
|
3322
3353
|
}),
|
|
3323
|
-
|
|
3324
|
-
type:
|
|
3325
|
-
item_id:
|
|
3326
|
-
output_index:
|
|
3327
|
-
content_index:
|
|
3328
|
-
refusal:
|
|
3354
|
+
z18.object({
|
|
3355
|
+
type: z18.literal("response.refusal.done"),
|
|
3356
|
+
item_id: z18.string(),
|
|
3357
|
+
output_index: z18.number().nullish(),
|
|
3358
|
+
content_index: z18.number().nullish(),
|
|
3359
|
+
refusal: z18.string()
|
|
3329
3360
|
}),
|
|
3330
|
-
|
|
3331
|
-
type:
|
|
3332
|
-
response:
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3361
|
+
z18.object({
|
|
3362
|
+
type: z18.enum(["response.completed", "response.incomplete"]),
|
|
3363
|
+
response: z18.object({
|
|
3364
|
+
prompt_cache_diagnostics: openaiResponsesPromptCacheDiagnosticsSchema().nullish(),
|
|
3365
|
+
incomplete_details: z18.object({ reason: z18.string() }).nullish(),
|
|
3366
|
+
usage: z18.object({
|
|
3367
|
+
input_tokens: z18.number(),
|
|
3368
|
+
input_tokens_details: z18.object({
|
|
3369
|
+
cached_tokens: z18.number().nullish(),
|
|
3370
|
+
cache_write_tokens: z18.number().nullish(),
|
|
3371
|
+
orchestration_input_tokens: z18.number().nullish(),
|
|
3372
|
+
orchestration_input_cached_tokens: z18.number().nullish()
|
|
3341
3373
|
}).nullish(),
|
|
3342
|
-
output_tokens:
|
|
3343
|
-
output_tokens_details:
|
|
3344
|
-
reasoning_tokens:
|
|
3345
|
-
orchestration_output_tokens:
|
|
3374
|
+
output_tokens: z18.number(),
|
|
3375
|
+
output_tokens_details: z18.object({
|
|
3376
|
+
reasoning_tokens: z18.number().nullish(),
|
|
3377
|
+
orchestration_output_tokens: z18.number().nullish()
|
|
3346
3378
|
}).nullish()
|
|
3347
3379
|
}),
|
|
3348
|
-
reasoning:
|
|
3349
|
-
context:
|
|
3380
|
+
reasoning: z18.object({
|
|
3381
|
+
context: z18.string().nullish()
|
|
3350
3382
|
}).nullish(),
|
|
3351
|
-
service_tier:
|
|
3383
|
+
service_tier: z18.string().nullish()
|
|
3352
3384
|
})
|
|
3353
3385
|
}),
|
|
3354
|
-
|
|
3355
|
-
type:
|
|
3356
|
-
response:
|
|
3357
|
-
id:
|
|
3358
|
-
created_at:
|
|
3359
|
-
model:
|
|
3360
|
-
service_tier:
|
|
3386
|
+
z18.object({
|
|
3387
|
+
type: z18.literal("response.created"),
|
|
3388
|
+
response: z18.object({
|
|
3389
|
+
id: z18.string(),
|
|
3390
|
+
created_at: z18.number(),
|
|
3391
|
+
model: z18.string(),
|
|
3392
|
+
service_tier: z18.string().nullish()
|
|
3361
3393
|
})
|
|
3362
3394
|
}),
|
|
3363
|
-
|
|
3364
|
-
type:
|
|
3365
|
-
output_index:
|
|
3366
|
-
item:
|
|
3367
|
-
|
|
3368
|
-
type:
|
|
3369
|
-
id:
|
|
3370
|
-
phase:
|
|
3395
|
+
z18.object({
|
|
3396
|
+
type: z18.literal("response.output_item.added"),
|
|
3397
|
+
output_index: z18.number(),
|
|
3398
|
+
item: z18.discriminatedUnion("type", [
|
|
3399
|
+
z18.object({
|
|
3400
|
+
type: z18.literal("message"),
|
|
3401
|
+
id: z18.string(),
|
|
3402
|
+
phase: z18.enum(["commentary", "final_answer"]).nullish()
|
|
3371
3403
|
}),
|
|
3372
|
-
|
|
3373
|
-
type:
|
|
3374
|
-
id:
|
|
3375
|
-
encrypted_content:
|
|
3404
|
+
z18.object({
|
|
3405
|
+
type: z18.literal("reasoning"),
|
|
3406
|
+
id: z18.string(),
|
|
3407
|
+
encrypted_content: z18.string().nullish()
|
|
3376
3408
|
}),
|
|
3377
|
-
|
|
3378
|
-
type:
|
|
3379
|
-
id:
|
|
3380
|
-
call_id:
|
|
3381
|
-
name:
|
|
3382
|
-
arguments:
|
|
3383
|
-
async:
|
|
3409
|
+
z18.object({
|
|
3410
|
+
type: z18.literal("function_call"),
|
|
3411
|
+
id: z18.string(),
|
|
3412
|
+
call_id: z18.string(),
|
|
3413
|
+
name: z18.string(),
|
|
3414
|
+
arguments: z18.string(),
|
|
3415
|
+
async: z18.boolean().nullish()
|
|
3384
3416
|
}),
|
|
3385
|
-
|
|
3386
|
-
type:
|
|
3387
|
-
id:
|
|
3388
|
-
status:
|
|
3417
|
+
z18.object({
|
|
3418
|
+
type: z18.literal("web_search_call"),
|
|
3419
|
+
id: z18.string(),
|
|
3420
|
+
status: z18.string()
|
|
3389
3421
|
}),
|
|
3390
|
-
|
|
3391
|
-
type:
|
|
3392
|
-
id:
|
|
3393
|
-
status:
|
|
3422
|
+
z18.object({
|
|
3423
|
+
type: z18.literal("computer_call"),
|
|
3424
|
+
id: z18.string(),
|
|
3425
|
+
status: z18.string()
|
|
3394
3426
|
}),
|
|
3395
|
-
|
|
3396
|
-
type:
|
|
3397
|
-
id:
|
|
3427
|
+
z18.object({
|
|
3428
|
+
type: z18.literal("file_search_call"),
|
|
3429
|
+
id: z18.string()
|
|
3398
3430
|
}),
|
|
3399
|
-
|
|
3400
|
-
type:
|
|
3401
|
-
id:
|
|
3431
|
+
z18.object({
|
|
3432
|
+
type: z18.literal("image_generation_call"),
|
|
3433
|
+
id: z18.string()
|
|
3402
3434
|
}),
|
|
3403
|
-
|
|
3404
|
-
type:
|
|
3405
|
-
id:
|
|
3406
|
-
container_id:
|
|
3407
|
-
code:
|
|
3408
|
-
outputs:
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3435
|
+
z18.object({
|
|
3436
|
+
type: z18.literal("code_interpreter_call"),
|
|
3437
|
+
id: z18.string(),
|
|
3438
|
+
container_id: z18.string(),
|
|
3439
|
+
code: z18.string().nullable(),
|
|
3440
|
+
outputs: z18.array(
|
|
3441
|
+
z18.discriminatedUnion("type", [
|
|
3442
|
+
z18.object({ type: z18.literal("logs"), logs: z18.string() }),
|
|
3443
|
+
z18.object({ type: z18.literal("image"), url: z18.string() })
|
|
3412
3444
|
])
|
|
3413
3445
|
).nullable(),
|
|
3414
|
-
status:
|
|
3446
|
+
status: z18.string()
|
|
3415
3447
|
})
|
|
3416
3448
|
])
|
|
3417
3449
|
}),
|
|
3418
|
-
|
|
3419
|
-
type:
|
|
3420
|
-
output_index:
|
|
3421
|
-
item:
|
|
3422
|
-
|
|
3423
|
-
type:
|
|
3424
|
-
id:
|
|
3425
|
-
phase:
|
|
3450
|
+
z18.object({
|
|
3451
|
+
type: z18.literal("response.output_item.done"),
|
|
3452
|
+
output_index: z18.number(),
|
|
3453
|
+
item: z18.discriminatedUnion("type", [
|
|
3454
|
+
z18.object({
|
|
3455
|
+
type: z18.literal("message"),
|
|
3456
|
+
id: z18.string(),
|
|
3457
|
+
phase: z18.enum(["commentary", "final_answer"]).nullish()
|
|
3426
3458
|
}),
|
|
3427
|
-
|
|
3428
|
-
type:
|
|
3429
|
-
id:
|
|
3430
|
-
encrypted_content:
|
|
3459
|
+
z18.object({
|
|
3460
|
+
type: z18.literal("reasoning"),
|
|
3461
|
+
id: z18.string(),
|
|
3462
|
+
encrypted_content: z18.string().nullish()
|
|
3431
3463
|
}),
|
|
3432
|
-
|
|
3433
|
-
type:
|
|
3434
|
-
id:
|
|
3435
|
-
call_id:
|
|
3436
|
-
name:
|
|
3437
|
-
arguments:
|
|
3438
|
-
async:
|
|
3439
|
-
status:
|
|
3464
|
+
z18.object({
|
|
3465
|
+
type: z18.literal("function_call"),
|
|
3466
|
+
id: z18.string(),
|
|
3467
|
+
call_id: z18.string(),
|
|
3468
|
+
name: z18.string(),
|
|
3469
|
+
arguments: z18.string(),
|
|
3470
|
+
async: z18.boolean().nullish(),
|
|
3471
|
+
status: z18.enum(["in_progress", "completed", "incomplete"])
|
|
3440
3472
|
}),
|
|
3441
|
-
|
|
3442
|
-
type:
|
|
3443
|
-
id:
|
|
3444
|
-
code:
|
|
3445
|
-
container_id:
|
|
3446
|
-
outputs:
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3473
|
+
z18.object({
|
|
3474
|
+
type: z18.literal("code_interpreter_call"),
|
|
3475
|
+
id: z18.string(),
|
|
3476
|
+
code: z18.string().nullable(),
|
|
3477
|
+
container_id: z18.string(),
|
|
3478
|
+
outputs: z18.array(
|
|
3479
|
+
z18.discriminatedUnion("type", [
|
|
3480
|
+
z18.object({ type: z18.literal("logs"), logs: z18.string() }),
|
|
3481
|
+
z18.object({ type: z18.literal("image"), url: z18.string() })
|
|
3450
3482
|
])
|
|
3451
3483
|
).nullable()
|
|
3452
3484
|
}),
|
|
3453
|
-
|
|
3454
|
-
type:
|
|
3455
|
-
id:
|
|
3456
|
-
result:
|
|
3485
|
+
z18.object({
|
|
3486
|
+
type: z18.literal("image_generation_call"),
|
|
3487
|
+
id: z18.string(),
|
|
3488
|
+
result: z18.string()
|
|
3457
3489
|
}),
|
|
3458
|
-
|
|
3459
|
-
type:
|
|
3460
|
-
id:
|
|
3461
|
-
status:
|
|
3462
|
-
action:
|
|
3463
|
-
|
|
3464
|
-
type:
|
|
3465
|
-
query:
|
|
3466
|
-
sources:
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3490
|
+
z18.object({
|
|
3491
|
+
type: z18.literal("web_search_call"),
|
|
3492
|
+
id: z18.string(),
|
|
3493
|
+
status: z18.string(),
|
|
3494
|
+
action: z18.discriminatedUnion("type", [
|
|
3495
|
+
z18.object({
|
|
3496
|
+
type: z18.literal("search"),
|
|
3497
|
+
query: z18.string().nullish(),
|
|
3498
|
+
sources: z18.array(
|
|
3499
|
+
z18.discriminatedUnion("type", [
|
|
3500
|
+
z18.object({ type: z18.literal("url"), url: z18.string() }),
|
|
3501
|
+
z18.object({ type: z18.literal("api"), name: z18.string() })
|
|
3470
3502
|
])
|
|
3471
3503
|
).nullish()
|
|
3472
3504
|
}),
|
|
3473
|
-
|
|
3474
|
-
type:
|
|
3475
|
-
url:
|
|
3505
|
+
z18.object({
|
|
3506
|
+
type: z18.literal("open_page"),
|
|
3507
|
+
url: z18.string().nullish()
|
|
3476
3508
|
}),
|
|
3477
|
-
|
|
3478
|
-
type:
|
|
3479
|
-
url:
|
|
3480
|
-
pattern:
|
|
3509
|
+
z18.object({
|
|
3510
|
+
type: z18.literal("find_in_page"),
|
|
3511
|
+
url: z18.string().nullish(),
|
|
3512
|
+
pattern: z18.string().nullish()
|
|
3481
3513
|
})
|
|
3482
3514
|
]).nullish()
|
|
3483
3515
|
}),
|
|
3484
|
-
|
|
3485
|
-
type:
|
|
3486
|
-
id:
|
|
3487
|
-
queries:
|
|
3488
|
-
results:
|
|
3489
|
-
|
|
3490
|
-
attributes:
|
|
3491
|
-
file_id:
|
|
3492
|
-
filename:
|
|
3493
|
-
score:
|
|
3494
|
-
text:
|
|
3516
|
+
z18.object({
|
|
3517
|
+
type: z18.literal("file_search_call"),
|
|
3518
|
+
id: z18.string(),
|
|
3519
|
+
queries: z18.array(z18.string()),
|
|
3520
|
+
results: z18.array(
|
|
3521
|
+
z18.object({
|
|
3522
|
+
attributes: z18.record(z18.string(), z18.unknown()),
|
|
3523
|
+
file_id: z18.string(),
|
|
3524
|
+
filename: z18.string(),
|
|
3525
|
+
score: z18.number(),
|
|
3526
|
+
text: z18.string()
|
|
3495
3527
|
})
|
|
3496
3528
|
).nullish()
|
|
3497
3529
|
}),
|
|
3498
|
-
|
|
3499
|
-
type:
|
|
3500
|
-
id:
|
|
3501
|
-
call_id:
|
|
3502
|
-
action:
|
|
3503
|
-
type:
|
|
3504
|
-
command:
|
|
3505
|
-
timeout_ms:
|
|
3506
|
-
user:
|
|
3507
|
-
working_directory:
|
|
3508
|
-
env:
|
|
3530
|
+
z18.object({
|
|
3531
|
+
type: z18.literal("local_shell_call"),
|
|
3532
|
+
id: z18.string(),
|
|
3533
|
+
call_id: z18.string(),
|
|
3534
|
+
action: z18.object({
|
|
3535
|
+
type: z18.literal("exec"),
|
|
3536
|
+
command: z18.array(z18.string()),
|
|
3537
|
+
timeout_ms: z18.number().optional(),
|
|
3538
|
+
user: z18.string().optional(),
|
|
3539
|
+
working_directory: z18.string().optional(),
|
|
3540
|
+
env: z18.record(z18.string(), z18.string()).optional()
|
|
3509
3541
|
})
|
|
3510
3542
|
}),
|
|
3511
|
-
|
|
3512
|
-
type:
|
|
3513
|
-
id:
|
|
3514
|
-
status:
|
|
3543
|
+
z18.object({
|
|
3544
|
+
type: z18.literal("computer_call"),
|
|
3545
|
+
id: z18.string(),
|
|
3546
|
+
status: z18.literal("completed")
|
|
3515
3547
|
})
|
|
3516
3548
|
])
|
|
3517
3549
|
}),
|
|
3518
|
-
|
|
3519
|
-
type:
|
|
3520
|
-
item_id:
|
|
3521
|
-
output_index:
|
|
3522
|
-
delta:
|
|
3550
|
+
z18.object({
|
|
3551
|
+
type: z18.literal("response.function_call_arguments.delta"),
|
|
3552
|
+
item_id: z18.string(),
|
|
3553
|
+
output_index: z18.number(),
|
|
3554
|
+
delta: z18.string()
|
|
3523
3555
|
}),
|
|
3524
|
-
|
|
3525
|
-
type:
|
|
3526
|
-
item_id:
|
|
3527
|
-
output_index:
|
|
3528
|
-
partial_image_b64:
|
|
3556
|
+
z18.object({
|
|
3557
|
+
type: z18.literal("response.image_generation_call.partial_image"),
|
|
3558
|
+
item_id: z18.string(),
|
|
3559
|
+
output_index: z18.number(),
|
|
3560
|
+
partial_image_b64: z18.string()
|
|
3529
3561
|
}),
|
|
3530
|
-
|
|
3531
|
-
type:
|
|
3532
|
-
item_id:
|
|
3533
|
-
output_index:
|
|
3534
|
-
delta:
|
|
3562
|
+
z18.object({
|
|
3563
|
+
type: z18.literal("response.code_interpreter_call_code.delta"),
|
|
3564
|
+
item_id: z18.string(),
|
|
3565
|
+
output_index: z18.number(),
|
|
3566
|
+
delta: z18.string()
|
|
3535
3567
|
}),
|
|
3536
|
-
|
|
3537
|
-
type:
|
|
3538
|
-
item_id:
|
|
3539
|
-
output_index:
|
|
3540
|
-
code:
|
|
3568
|
+
z18.object({
|
|
3569
|
+
type: z18.literal("response.code_interpreter_call_code.done"),
|
|
3570
|
+
item_id: z18.string(),
|
|
3571
|
+
output_index: z18.number(),
|
|
3572
|
+
code: z18.string()
|
|
3541
3573
|
}),
|
|
3542
|
-
|
|
3543
|
-
type:
|
|
3544
|
-
annotation:
|
|
3545
|
-
|
|
3546
|
-
type:
|
|
3547
|
-
start_index:
|
|
3548
|
-
end_index:
|
|
3549
|
-
url:
|
|
3550
|
-
title:
|
|
3574
|
+
z18.object({
|
|
3575
|
+
type: z18.literal("response.output_text.annotation.added"),
|
|
3576
|
+
annotation: z18.discriminatedUnion("type", [
|
|
3577
|
+
z18.object({
|
|
3578
|
+
type: z18.literal("url_citation"),
|
|
3579
|
+
start_index: z18.number(),
|
|
3580
|
+
end_index: z18.number(),
|
|
3581
|
+
url: z18.string(),
|
|
3582
|
+
title: z18.string()
|
|
3551
3583
|
}),
|
|
3552
|
-
|
|
3553
|
-
type:
|
|
3554
|
-
file_id:
|
|
3555
|
-
filename:
|
|
3556
|
-
index:
|
|
3557
|
-
start_index:
|
|
3558
|
-
end_index:
|
|
3559
|
-
quote:
|
|
3584
|
+
z18.object({
|
|
3585
|
+
type: z18.literal("file_citation"),
|
|
3586
|
+
file_id: z18.string(),
|
|
3587
|
+
filename: z18.string().nullish(),
|
|
3588
|
+
index: z18.number().nullish(),
|
|
3589
|
+
start_index: z18.number().nullish(),
|
|
3590
|
+
end_index: z18.number().nullish(),
|
|
3591
|
+
quote: z18.string().nullish()
|
|
3560
3592
|
})
|
|
3561
3593
|
])
|
|
3562
3594
|
}),
|
|
3563
|
-
|
|
3564
|
-
type:
|
|
3565
|
-
item_id:
|
|
3566
|
-
summary_index:
|
|
3595
|
+
z18.object({
|
|
3596
|
+
type: z18.literal("response.reasoning_summary_part.added"),
|
|
3597
|
+
item_id: z18.string(),
|
|
3598
|
+
summary_index: z18.number()
|
|
3567
3599
|
}),
|
|
3568
|
-
|
|
3569
|
-
type:
|
|
3570
|
-
item_id:
|
|
3571
|
-
summary_index:
|
|
3572
|
-
delta:
|
|
3600
|
+
z18.object({
|
|
3601
|
+
type: z18.literal("response.reasoning_summary_text.delta"),
|
|
3602
|
+
item_id: z18.string(),
|
|
3603
|
+
summary_index: z18.number(),
|
|
3604
|
+
delta: z18.string()
|
|
3573
3605
|
}),
|
|
3574
|
-
|
|
3575
|
-
type:
|
|
3576
|
-
item_id:
|
|
3577
|
-
summary_index:
|
|
3606
|
+
z18.object({
|
|
3607
|
+
type: z18.literal("response.reasoning_summary_part.done"),
|
|
3608
|
+
item_id: z18.string(),
|
|
3609
|
+
summary_index: z18.number()
|
|
3578
3610
|
}),
|
|
3579
|
-
|
|
3580
|
-
type:
|
|
3581
|
-
sequence_number:
|
|
3582
|
-
error:
|
|
3583
|
-
type:
|
|
3584
|
-
code:
|
|
3585
|
-
message:
|
|
3586
|
-
param:
|
|
3611
|
+
z18.object({
|
|
3612
|
+
type: z18.literal("error"),
|
|
3613
|
+
sequence_number: z18.number(),
|
|
3614
|
+
error: z18.object({
|
|
3615
|
+
type: z18.string(),
|
|
3616
|
+
code: z18.string(),
|
|
3617
|
+
message: z18.string(),
|
|
3618
|
+
param: z18.string().nullish()
|
|
3587
3619
|
})
|
|
3588
3620
|
}),
|
|
3589
|
-
|
|
3621
|
+
z18.object({ type: z18.string() }).loose().transform((value) => ({
|
|
3590
3622
|
type: "unknown_chunk",
|
|
3591
3623
|
message: value.type
|
|
3592
3624
|
}))
|
|
@@ -3596,202 +3628,203 @@ var openaiResponsesChunkSchema = lazyValidator13(
|
|
|
3596
3628
|
);
|
|
3597
3629
|
var openaiResponsesResponseSchema = lazyValidator13(
|
|
3598
3630
|
() => zodSchema17(
|
|
3599
|
-
|
|
3600
|
-
id:
|
|
3601
|
-
created_at:
|
|
3602
|
-
error:
|
|
3603
|
-
message:
|
|
3604
|
-
type:
|
|
3605
|
-
param:
|
|
3606
|
-
code:
|
|
3631
|
+
z18.object({
|
|
3632
|
+
id: z18.string().optional(),
|
|
3633
|
+
created_at: z18.number().optional(),
|
|
3634
|
+
error: z18.object({
|
|
3635
|
+
message: z18.string(),
|
|
3636
|
+
type: z18.string(),
|
|
3637
|
+
param: z18.string().nullish(),
|
|
3638
|
+
code: z18.string()
|
|
3607
3639
|
}).nullish(),
|
|
3608
|
-
model:
|
|
3609
|
-
output:
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
type:
|
|
3613
|
-
role:
|
|
3614
|
-
id:
|
|
3615
|
-
phase:
|
|
3640
|
+
model: z18.string().optional(),
|
|
3641
|
+
output: z18.array(
|
|
3642
|
+
z18.discriminatedUnion("type", [
|
|
3643
|
+
z18.object({
|
|
3644
|
+
type: z18.literal("message"),
|
|
3645
|
+
role: z18.literal("assistant"),
|
|
3646
|
+
id: z18.string(),
|
|
3647
|
+
phase: z18.enum(["commentary", "final_answer"]).nullish(),
|
|
3616
3648
|
// the API returns either text or a refusal as content parts:
|
|
3617
|
-
content:
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
type:
|
|
3621
|
-
text:
|
|
3622
|
-
logprobs:
|
|
3623
|
-
|
|
3624
|
-
token:
|
|
3625
|
-
logprob:
|
|
3626
|
-
top_logprobs:
|
|
3627
|
-
|
|
3628
|
-
token:
|
|
3629
|
-
logprob:
|
|
3649
|
+
content: z18.array(
|
|
3650
|
+
z18.discriminatedUnion("type", [
|
|
3651
|
+
z18.object({
|
|
3652
|
+
type: z18.literal("output_text"),
|
|
3653
|
+
text: z18.string(),
|
|
3654
|
+
logprobs: z18.array(
|
|
3655
|
+
z18.object({
|
|
3656
|
+
token: z18.string(),
|
|
3657
|
+
logprob: z18.number(),
|
|
3658
|
+
top_logprobs: z18.array(
|
|
3659
|
+
z18.object({
|
|
3660
|
+
token: z18.string(),
|
|
3661
|
+
logprob: z18.number()
|
|
3630
3662
|
})
|
|
3631
3663
|
)
|
|
3632
3664
|
})
|
|
3633
3665
|
).nullish(),
|
|
3634
|
-
annotations:
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
type:
|
|
3638
|
-
start_index:
|
|
3639
|
-
end_index:
|
|
3640
|
-
url:
|
|
3641
|
-
title:
|
|
3666
|
+
annotations: z18.array(
|
|
3667
|
+
z18.discriminatedUnion("type", [
|
|
3668
|
+
z18.object({
|
|
3669
|
+
type: z18.literal("url_citation"),
|
|
3670
|
+
start_index: z18.number(),
|
|
3671
|
+
end_index: z18.number(),
|
|
3672
|
+
url: z18.string(),
|
|
3673
|
+
title: z18.string()
|
|
3642
3674
|
}),
|
|
3643
|
-
|
|
3644
|
-
type:
|
|
3645
|
-
file_id:
|
|
3646
|
-
filename:
|
|
3647
|
-
index:
|
|
3648
|
-
start_index:
|
|
3649
|
-
end_index:
|
|
3650
|
-
quote:
|
|
3675
|
+
z18.object({
|
|
3676
|
+
type: z18.literal("file_citation"),
|
|
3677
|
+
file_id: z18.string(),
|
|
3678
|
+
filename: z18.string().nullish(),
|
|
3679
|
+
index: z18.number().nullish(),
|
|
3680
|
+
start_index: z18.number().nullish(),
|
|
3681
|
+
end_index: z18.number().nullish(),
|
|
3682
|
+
quote: z18.string().nullish()
|
|
3651
3683
|
}),
|
|
3652
|
-
|
|
3653
|
-
type:
|
|
3654
|
-
container_id:
|
|
3655
|
-
file_id:
|
|
3656
|
-
filename:
|
|
3657
|
-
start_index:
|
|
3658
|
-
end_index:
|
|
3659
|
-
index:
|
|
3684
|
+
z18.object({
|
|
3685
|
+
type: z18.literal("container_file_citation"),
|
|
3686
|
+
container_id: z18.string(),
|
|
3687
|
+
file_id: z18.string(),
|
|
3688
|
+
filename: z18.string().nullish(),
|
|
3689
|
+
start_index: z18.number().nullish(),
|
|
3690
|
+
end_index: z18.number().nullish(),
|
|
3691
|
+
index: z18.number().nullish()
|
|
3660
3692
|
}),
|
|
3661
|
-
|
|
3662
|
-
type:
|
|
3663
|
-
file_id:
|
|
3664
|
-
index:
|
|
3693
|
+
z18.object({
|
|
3694
|
+
type: z18.literal("file_path"),
|
|
3695
|
+
file_id: z18.string(),
|
|
3696
|
+
index: z18.number().nullish()
|
|
3665
3697
|
})
|
|
3666
3698
|
])
|
|
3667
3699
|
)
|
|
3668
3700
|
}),
|
|
3669
|
-
|
|
3670
|
-
type:
|
|
3671
|
-
refusal:
|
|
3701
|
+
z18.object({
|
|
3702
|
+
type: z18.literal("refusal"),
|
|
3703
|
+
refusal: z18.string()
|
|
3672
3704
|
})
|
|
3673
3705
|
])
|
|
3674
3706
|
)
|
|
3675
3707
|
}),
|
|
3676
|
-
|
|
3677
|
-
type:
|
|
3678
|
-
id:
|
|
3679
|
-
status:
|
|
3680
|
-
action:
|
|
3681
|
-
|
|
3682
|
-
type:
|
|
3683
|
-
query:
|
|
3684
|
-
sources:
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
type:
|
|
3689
|
-
name:
|
|
3708
|
+
z18.object({
|
|
3709
|
+
type: z18.literal("web_search_call"),
|
|
3710
|
+
id: z18.string(),
|
|
3711
|
+
status: z18.string(),
|
|
3712
|
+
action: z18.discriminatedUnion("type", [
|
|
3713
|
+
z18.object({
|
|
3714
|
+
type: z18.literal("search"),
|
|
3715
|
+
query: z18.string().nullish(),
|
|
3716
|
+
sources: z18.array(
|
|
3717
|
+
z18.discriminatedUnion("type", [
|
|
3718
|
+
z18.object({ type: z18.literal("url"), url: z18.string() }),
|
|
3719
|
+
z18.object({
|
|
3720
|
+
type: z18.literal("api"),
|
|
3721
|
+
name: z18.string()
|
|
3690
3722
|
})
|
|
3691
3723
|
])
|
|
3692
3724
|
).nullish()
|
|
3693
3725
|
}),
|
|
3694
|
-
|
|
3695
|
-
type:
|
|
3696
|
-
url:
|
|
3726
|
+
z18.object({
|
|
3727
|
+
type: z18.literal("open_page"),
|
|
3728
|
+
url: z18.string().nullish()
|
|
3697
3729
|
}),
|
|
3698
|
-
|
|
3699
|
-
type:
|
|
3700
|
-
url:
|
|
3701
|
-
pattern:
|
|
3730
|
+
z18.object({
|
|
3731
|
+
type: z18.literal("find_in_page"),
|
|
3732
|
+
url: z18.string().nullish(),
|
|
3733
|
+
pattern: z18.string().nullish()
|
|
3702
3734
|
})
|
|
3703
3735
|
]).nullish()
|
|
3704
3736
|
}),
|
|
3705
|
-
|
|
3706
|
-
type:
|
|
3707
|
-
id:
|
|
3708
|
-
queries:
|
|
3709
|
-
results:
|
|
3710
|
-
|
|
3711
|
-
attributes:
|
|
3712
|
-
|
|
3713
|
-
|
|
3737
|
+
z18.object({
|
|
3738
|
+
type: z18.literal("file_search_call"),
|
|
3739
|
+
id: z18.string(),
|
|
3740
|
+
queries: z18.array(z18.string()),
|
|
3741
|
+
results: z18.array(
|
|
3742
|
+
z18.object({
|
|
3743
|
+
attributes: z18.record(
|
|
3744
|
+
z18.string(),
|
|
3745
|
+
z18.union([z18.string(), z18.number(), z18.boolean()])
|
|
3714
3746
|
),
|
|
3715
|
-
file_id:
|
|
3716
|
-
filename:
|
|
3717
|
-
score:
|
|
3718
|
-
text:
|
|
3747
|
+
file_id: z18.string(),
|
|
3748
|
+
filename: z18.string(),
|
|
3749
|
+
score: z18.number(),
|
|
3750
|
+
text: z18.string()
|
|
3719
3751
|
})
|
|
3720
3752
|
).nullish()
|
|
3721
3753
|
}),
|
|
3722
|
-
|
|
3723
|
-
type:
|
|
3724
|
-
id:
|
|
3725
|
-
code:
|
|
3726
|
-
container_id:
|
|
3727
|
-
outputs:
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3754
|
+
z18.object({
|
|
3755
|
+
type: z18.literal("code_interpreter_call"),
|
|
3756
|
+
id: z18.string(),
|
|
3757
|
+
code: z18.string().nullable(),
|
|
3758
|
+
container_id: z18.string(),
|
|
3759
|
+
outputs: z18.array(
|
|
3760
|
+
z18.discriminatedUnion("type", [
|
|
3761
|
+
z18.object({ type: z18.literal("logs"), logs: z18.string() }),
|
|
3762
|
+
z18.object({ type: z18.literal("image"), url: z18.string() })
|
|
3731
3763
|
])
|
|
3732
3764
|
).nullable()
|
|
3733
3765
|
}),
|
|
3734
|
-
|
|
3735
|
-
type:
|
|
3736
|
-
id:
|
|
3737
|
-
result:
|
|
3766
|
+
z18.object({
|
|
3767
|
+
type: z18.literal("image_generation_call"),
|
|
3768
|
+
id: z18.string(),
|
|
3769
|
+
result: z18.string()
|
|
3738
3770
|
}),
|
|
3739
|
-
|
|
3740
|
-
type:
|
|
3741
|
-
id:
|
|
3742
|
-
call_id:
|
|
3743
|
-
action:
|
|
3744
|
-
type:
|
|
3745
|
-
command:
|
|
3746
|
-
timeout_ms:
|
|
3747
|
-
user:
|
|
3748
|
-
working_directory:
|
|
3749
|
-
env:
|
|
3771
|
+
z18.object({
|
|
3772
|
+
type: z18.literal("local_shell_call"),
|
|
3773
|
+
id: z18.string(),
|
|
3774
|
+
call_id: z18.string(),
|
|
3775
|
+
action: z18.object({
|
|
3776
|
+
type: z18.literal("exec"),
|
|
3777
|
+
command: z18.array(z18.string()),
|
|
3778
|
+
timeout_ms: z18.number().optional(),
|
|
3779
|
+
user: z18.string().optional(),
|
|
3780
|
+
working_directory: z18.string().optional(),
|
|
3781
|
+
env: z18.record(z18.string(), z18.string()).optional()
|
|
3750
3782
|
})
|
|
3751
3783
|
}),
|
|
3752
|
-
|
|
3753
|
-
type:
|
|
3754
|
-
call_id:
|
|
3755
|
-
name:
|
|
3756
|
-
arguments:
|
|
3757
|
-
id:
|
|
3758
|
-
async:
|
|
3784
|
+
z18.object({
|
|
3785
|
+
type: z18.literal("function_call"),
|
|
3786
|
+
call_id: z18.string(),
|
|
3787
|
+
name: z18.string(),
|
|
3788
|
+
arguments: z18.string(),
|
|
3789
|
+
id: z18.string(),
|
|
3790
|
+
async: z18.boolean().nullish()
|
|
3759
3791
|
}),
|
|
3760
|
-
|
|
3761
|
-
type:
|
|
3762
|
-
id:
|
|
3763
|
-
status:
|
|
3792
|
+
z18.object({
|
|
3793
|
+
type: z18.literal("computer_call"),
|
|
3794
|
+
id: z18.string(),
|
|
3795
|
+
status: z18.string().optional()
|
|
3764
3796
|
}),
|
|
3765
|
-
|
|
3766
|
-
type:
|
|
3767
|
-
id:
|
|
3768
|
-
encrypted_content:
|
|
3769
|
-
summary:
|
|
3770
|
-
|
|
3771
|
-
type:
|
|
3772
|
-
text:
|
|
3797
|
+
z18.object({
|
|
3798
|
+
type: z18.literal("reasoning"),
|
|
3799
|
+
id: z18.string(),
|
|
3800
|
+
encrypted_content: z18.string().nullish(),
|
|
3801
|
+
summary: z18.array(
|
|
3802
|
+
z18.object({
|
|
3803
|
+
type: z18.literal("summary_text"),
|
|
3804
|
+
text: z18.string()
|
|
3773
3805
|
})
|
|
3774
3806
|
)
|
|
3775
3807
|
})
|
|
3776
3808
|
])
|
|
3777
3809
|
).optional(),
|
|
3778
|
-
service_tier:
|
|
3779
|
-
|
|
3780
|
-
|
|
3810
|
+
service_tier: z18.string().nullish(),
|
|
3811
|
+
prompt_cache_diagnostics: openaiResponsesPromptCacheDiagnosticsSchema().nullish(),
|
|
3812
|
+
reasoning: z18.object({
|
|
3813
|
+
context: z18.string().nullish()
|
|
3781
3814
|
}).nullish(),
|
|
3782
|
-
incomplete_details:
|
|
3783
|
-
usage:
|
|
3784
|
-
input_tokens:
|
|
3785
|
-
input_tokens_details:
|
|
3786
|
-
cached_tokens:
|
|
3787
|
-
cache_write_tokens:
|
|
3788
|
-
orchestration_input_tokens:
|
|
3789
|
-
orchestration_input_cached_tokens:
|
|
3815
|
+
incomplete_details: z18.object({ reason: z18.string() }).nullish(),
|
|
3816
|
+
usage: z18.object({
|
|
3817
|
+
input_tokens: z18.number(),
|
|
3818
|
+
input_tokens_details: z18.object({
|
|
3819
|
+
cached_tokens: z18.number().nullish(),
|
|
3820
|
+
cache_write_tokens: z18.number().nullish(),
|
|
3821
|
+
orchestration_input_tokens: z18.number().nullish(),
|
|
3822
|
+
orchestration_input_cached_tokens: z18.number().nullish()
|
|
3790
3823
|
}).nullish(),
|
|
3791
|
-
output_tokens:
|
|
3792
|
-
output_tokens_details:
|
|
3793
|
-
reasoning_tokens:
|
|
3794
|
-
orchestration_output_tokens:
|
|
3824
|
+
output_tokens: z18.number(),
|
|
3825
|
+
output_tokens_details: z18.object({
|
|
3826
|
+
reasoning_tokens: z18.number().nullish(),
|
|
3827
|
+
orchestration_output_tokens: z18.number().nullish()
|
|
3795
3828
|
}).nullish()
|
|
3796
3829
|
}).optional()
|
|
3797
3830
|
})
|
|
@@ -3809,22 +3842,22 @@ import {
|
|
|
3809
3842
|
lazySchema as lazySchema5,
|
|
3810
3843
|
zodSchema as zodSchema18
|
|
3811
3844
|
} from "@ai-sdk/provider-utils";
|
|
3812
|
-
import { z as
|
|
3845
|
+
import { z as z19 } from "zod/v4";
|
|
3813
3846
|
var codeInterpreterInputSchema = lazySchema5(
|
|
3814
3847
|
() => zodSchema18(
|
|
3815
|
-
|
|
3816
|
-
code:
|
|
3817
|
-
containerId:
|
|
3848
|
+
z19.object({
|
|
3849
|
+
code: z19.string().nullish(),
|
|
3850
|
+
containerId: z19.string()
|
|
3818
3851
|
})
|
|
3819
3852
|
)
|
|
3820
3853
|
);
|
|
3821
3854
|
var codeInterpreterOutputSchema = lazySchema5(
|
|
3822
3855
|
() => zodSchema18(
|
|
3823
|
-
|
|
3824
|
-
outputs:
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3856
|
+
z19.object({
|
|
3857
|
+
outputs: z19.array(
|
|
3858
|
+
z19.discriminatedUnion("type", [
|
|
3859
|
+
z19.object({ type: z19.literal("logs"), logs: z19.string() }),
|
|
3860
|
+
z19.object({ type: z19.literal("image"), url: z19.string() })
|
|
3828
3861
|
])
|
|
3829
3862
|
).nullish()
|
|
3830
3863
|
})
|
|
@@ -3832,11 +3865,11 @@ var codeInterpreterOutputSchema = lazySchema5(
|
|
|
3832
3865
|
);
|
|
3833
3866
|
var codeInterpreterArgsSchema = lazySchema5(
|
|
3834
3867
|
() => zodSchema18(
|
|
3835
|
-
|
|
3836
|
-
container:
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
fileIds:
|
|
3868
|
+
z19.object({
|
|
3869
|
+
container: z19.union([
|
|
3870
|
+
z19.string(),
|
|
3871
|
+
z19.object({
|
|
3872
|
+
fileIds: z19.array(z19.string()).optional()
|
|
3840
3873
|
})
|
|
3841
3874
|
]).optional()
|
|
3842
3875
|
})
|
|
@@ -3858,43 +3891,43 @@ import {
|
|
|
3858
3891
|
lazySchema as lazySchema6,
|
|
3859
3892
|
zodSchema as zodSchema19
|
|
3860
3893
|
} from "@ai-sdk/provider-utils";
|
|
3861
|
-
import { z as
|
|
3862
|
-
var comparisonFilterSchema = () =>
|
|
3863
|
-
key:
|
|
3864
|
-
type:
|
|
3865
|
-
value:
|
|
3894
|
+
import { z as z20 } from "zod/v4";
|
|
3895
|
+
var comparisonFilterSchema = () => z20.object({
|
|
3896
|
+
key: z20.string(),
|
|
3897
|
+
type: z20.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
3898
|
+
value: z20.union([z20.string(), z20.number(), z20.boolean(), z20.array(z20.string())])
|
|
3866
3899
|
});
|
|
3867
3900
|
var cachedCompoundFilterSchema;
|
|
3868
|
-
var compoundFilterSchema = () => cachedCompoundFilterSchema != null ? cachedCompoundFilterSchema : cachedCompoundFilterSchema =
|
|
3869
|
-
type:
|
|
3870
|
-
filters:
|
|
3871
|
-
|
|
3901
|
+
var compoundFilterSchema = () => cachedCompoundFilterSchema != null ? cachedCompoundFilterSchema : cachedCompoundFilterSchema = z20.object({
|
|
3902
|
+
type: z20.enum(["and", "or"]),
|
|
3903
|
+
filters: z20.array(
|
|
3904
|
+
z20.union([comparisonFilterSchema(), z20.lazy(() => compoundFilterSchema())])
|
|
3872
3905
|
)
|
|
3873
3906
|
});
|
|
3874
3907
|
var fileSearchArgsSchema = lazySchema6(
|
|
3875
3908
|
() => zodSchema19(
|
|
3876
|
-
|
|
3877
|
-
vectorStoreIds:
|
|
3878
|
-
maxNumResults:
|
|
3879
|
-
ranking:
|
|
3880
|
-
ranker:
|
|
3881
|
-
scoreThreshold:
|
|
3909
|
+
z20.object({
|
|
3910
|
+
vectorStoreIds: z20.array(z20.string()),
|
|
3911
|
+
maxNumResults: z20.number().optional(),
|
|
3912
|
+
ranking: z20.object({
|
|
3913
|
+
ranker: z20.string().optional(),
|
|
3914
|
+
scoreThreshold: z20.number().optional()
|
|
3882
3915
|
}).optional(),
|
|
3883
|
-
filters:
|
|
3916
|
+
filters: z20.union([comparisonFilterSchema(), compoundFilterSchema()]).optional()
|
|
3884
3917
|
})
|
|
3885
3918
|
)
|
|
3886
3919
|
);
|
|
3887
3920
|
var fileSearchOutputSchema = lazySchema6(
|
|
3888
3921
|
() => zodSchema19(
|
|
3889
|
-
|
|
3890
|
-
queries:
|
|
3891
|
-
results:
|
|
3892
|
-
|
|
3893
|
-
attributes:
|
|
3894
|
-
fileId:
|
|
3895
|
-
filename:
|
|
3896
|
-
score:
|
|
3897
|
-
text:
|
|
3922
|
+
z20.object({
|
|
3923
|
+
queries: z20.array(z20.string()),
|
|
3924
|
+
results: z20.array(
|
|
3925
|
+
z20.object({
|
|
3926
|
+
attributes: z20.record(z20.string(), z20.unknown()),
|
|
3927
|
+
fileId: z20.string(),
|
|
3928
|
+
filename: z20.string(),
|
|
3929
|
+
score: z20.number(),
|
|
3930
|
+
text: z20.string()
|
|
3898
3931
|
})
|
|
3899
3932
|
).nullable()
|
|
3900
3933
|
})
|
|
@@ -3903,7 +3936,7 @@ var fileSearchOutputSchema = lazySchema6(
|
|
|
3903
3936
|
var fileSearch = createProviderDefinedToolFactoryWithOutputSchema4({
|
|
3904
3937
|
id: "openai.file_search",
|
|
3905
3938
|
name: "file_search",
|
|
3906
|
-
inputSchema:
|
|
3939
|
+
inputSchema: z20.object({}),
|
|
3907
3940
|
outputSchema: fileSearchOutputSchema
|
|
3908
3941
|
});
|
|
3909
3942
|
|
|
@@ -3913,40 +3946,40 @@ import {
|
|
|
3913
3946
|
lazySchema as lazySchema7,
|
|
3914
3947
|
zodSchema as zodSchema20
|
|
3915
3948
|
} from "@ai-sdk/provider-utils";
|
|
3916
|
-
import { z as
|
|
3949
|
+
import { z as z21 } from "zod/v4";
|
|
3917
3950
|
var webSearchPreviewArgsSchema = lazySchema7(
|
|
3918
3951
|
() => zodSchema20(
|
|
3919
|
-
|
|
3920
|
-
searchContextSize:
|
|
3921
|
-
userLocation:
|
|
3922
|
-
type:
|
|
3923
|
-
country:
|
|
3924
|
-
city:
|
|
3925
|
-
region:
|
|
3926
|
-
timezone:
|
|
3952
|
+
z21.object({
|
|
3953
|
+
searchContextSize: z21.enum(["low", "medium", "high"]).optional(),
|
|
3954
|
+
userLocation: z21.object({
|
|
3955
|
+
type: z21.literal("approximate"),
|
|
3956
|
+
country: z21.string().optional(),
|
|
3957
|
+
city: z21.string().optional(),
|
|
3958
|
+
region: z21.string().optional(),
|
|
3959
|
+
timezone: z21.string().optional()
|
|
3927
3960
|
}).optional()
|
|
3928
3961
|
})
|
|
3929
3962
|
)
|
|
3930
3963
|
);
|
|
3931
3964
|
var webSearchPreviewInputSchema = lazySchema7(
|
|
3932
|
-
() => zodSchema20(
|
|
3965
|
+
() => zodSchema20(z21.object({}))
|
|
3933
3966
|
);
|
|
3934
3967
|
var webSearchPreviewOutputSchema = lazySchema7(
|
|
3935
3968
|
() => zodSchema20(
|
|
3936
|
-
|
|
3937
|
-
action:
|
|
3938
|
-
|
|
3939
|
-
type:
|
|
3940
|
-
query:
|
|
3969
|
+
z21.object({
|
|
3970
|
+
action: z21.discriminatedUnion("type", [
|
|
3971
|
+
z21.object({
|
|
3972
|
+
type: z21.literal("search"),
|
|
3973
|
+
query: z21.string().optional()
|
|
3941
3974
|
}),
|
|
3942
|
-
|
|
3943
|
-
type:
|
|
3944
|
-
url:
|
|
3975
|
+
z21.object({
|
|
3976
|
+
type: z21.literal("openPage"),
|
|
3977
|
+
url: z21.string().nullish()
|
|
3945
3978
|
}),
|
|
3946
|
-
|
|
3947
|
-
type:
|
|
3948
|
-
url:
|
|
3949
|
-
pattern:
|
|
3979
|
+
z21.object({
|
|
3980
|
+
type: z21.literal("findInPage"),
|
|
3981
|
+
url: z21.string().nullish(),
|
|
3982
|
+
pattern: z21.string().nullish()
|
|
3950
3983
|
})
|
|
3951
3984
|
]).optional()
|
|
3952
3985
|
})
|
|
@@ -3965,29 +3998,29 @@ import {
|
|
|
3965
3998
|
lazySchema as lazySchema8,
|
|
3966
3999
|
zodSchema as zodSchema21
|
|
3967
4000
|
} from "@ai-sdk/provider-utils";
|
|
3968
|
-
import { z as
|
|
4001
|
+
import { z as z22 } from "zod/v4";
|
|
3969
4002
|
var imageGenerationArgsSchema = lazySchema8(
|
|
3970
4003
|
() => zodSchema21(
|
|
3971
|
-
|
|
3972
|
-
background:
|
|
3973
|
-
inputFidelity:
|
|
3974
|
-
inputImageMask:
|
|
3975
|
-
fileId:
|
|
3976
|
-
imageUrl:
|
|
4004
|
+
z22.object({
|
|
4005
|
+
background: z22.enum(["auto", "opaque", "transparent"]).optional(),
|
|
4006
|
+
inputFidelity: z22.enum(["low", "high"]).optional(),
|
|
4007
|
+
inputImageMask: z22.object({
|
|
4008
|
+
fileId: z22.string().optional(),
|
|
4009
|
+
imageUrl: z22.string().optional()
|
|
3977
4010
|
}).optional(),
|
|
3978
|
-
model:
|
|
3979
|
-
moderation:
|
|
3980
|
-
outputCompression:
|
|
3981
|
-
outputFormat:
|
|
3982
|
-
partialImages:
|
|
3983
|
-
quality:
|
|
3984
|
-
size:
|
|
4011
|
+
model: z22.string().optional(),
|
|
4012
|
+
moderation: z22.enum(["auto"]).optional(),
|
|
4013
|
+
outputCompression: z22.number().int().min(0).max(100).optional(),
|
|
4014
|
+
outputFormat: z22.enum(["png", "jpeg", "webp"]).optional(),
|
|
4015
|
+
partialImages: z22.number().int().min(0).max(3).optional(),
|
|
4016
|
+
quality: z22.enum(["auto", "low", "medium", "high"]).optional(),
|
|
4017
|
+
size: z22.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
3985
4018
|
}).strict()
|
|
3986
4019
|
)
|
|
3987
4020
|
);
|
|
3988
|
-
var imageGenerationInputSchema = lazySchema8(() => zodSchema21(
|
|
4021
|
+
var imageGenerationInputSchema = lazySchema8(() => zodSchema21(z22.object({})));
|
|
3989
4022
|
var imageGenerationOutputSchema = lazySchema8(
|
|
3990
|
-
() => zodSchema21(
|
|
4023
|
+
() => zodSchema21(z22.object({ result: z22.string() }))
|
|
3991
4024
|
);
|
|
3992
4025
|
var imageGenerationToolFactory = createProviderDefinedToolFactoryWithOutputSchema6({
|
|
3993
4026
|
id: "openai.image_generation",
|
|
@@ -4175,10 +4208,10 @@ function getConfigurationUpdateUnsupportedReason({
|
|
|
4175
4208
|
options
|
|
4176
4209
|
}) {
|
|
4177
4210
|
if (!modelCapabilities.supportsConfigurationUpdate) {
|
|
4178
|
-
return "
|
|
4211
|
+
return "Configuration updates are only supported by GPT-6 and later models";
|
|
4179
4212
|
}
|
|
4180
4213
|
if ((options == null ? void 0 : options.reasoningMode) === "pro" || (options == null ? void 0 : options.truncation) === "auto") {
|
|
4181
|
-
return "
|
|
4214
|
+
return "Configuration updates require standard reasoning mode without automatic truncation";
|
|
4182
4215
|
}
|
|
4183
4216
|
return void 0;
|
|
4184
4217
|
}
|
|
@@ -4210,7 +4243,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4210
4243
|
toolChoice,
|
|
4211
4244
|
responseFormat
|
|
4212
4245
|
}) {
|
|
4213
|
-
var _a2, _b, _c, _d, _e, _f;
|
|
4246
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
|
4214
4247
|
const warnings = [];
|
|
4215
4248
|
const modelCapabilities = getOpenAILanguageModelCapabilities(this.modelId);
|
|
4216
4249
|
if (topK != null) {
|
|
@@ -4286,7 +4319,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4286
4319
|
});
|
|
4287
4320
|
} else if (reasoningEffortUpdate != null) {
|
|
4288
4321
|
const firstItem = input[0];
|
|
4289
|
-
if ((firstItem == null ? void 0 : firstItem.type) !== "configuration_update" || firstItem.reasoning.effort !== reasoningEffortUpdate) {
|
|
4322
|
+
if ((firstItem == null ? void 0 : firstItem.type) !== "configuration_update" || ((_c = firstItem.reasoning) == null ? void 0 : _c.effort) !== reasoningEffortUpdate) {
|
|
4290
4323
|
input.unshift({
|
|
4291
4324
|
type: "configuration_update",
|
|
4292
4325
|
reasoning: { effort: reasoningEffortUpdate }
|
|
@@ -4296,11 +4329,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4296
4329
|
for (let i = 1; i < input.length; i++) {
|
|
4297
4330
|
if (input[i - 1].type === "configuration_update" && input[i].type === "configuration_update") {
|
|
4298
4331
|
throw new UnsupportedFunctionalityError6({
|
|
4299
|
-
functionality: "Adjacent
|
|
4332
|
+
functionality: "Adjacent configuration updates",
|
|
4333
|
+
message: "Configuration updates cannot be consecutive. Set reasoningEffortUpdate and textFormatUpdate in the same empty system message, and omit request-level reasoningEffortUpdate when using message-level updates."
|
|
4300
4334
|
});
|
|
4301
4335
|
}
|
|
4302
4336
|
}
|
|
4303
|
-
const strictJsonSchema = (
|
|
4337
|
+
const strictJsonSchema = (_d = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _d : false;
|
|
4338
|
+
const requestTextFormat = openaiOptions == null ? void 0 : openaiOptions.textFormat;
|
|
4304
4339
|
let include = openaiOptions == null ? void 0 : openaiOptions.include;
|
|
4305
4340
|
function addInclude(key) {
|
|
4306
4341
|
if (include == null) {
|
|
@@ -4334,13 +4369,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4334
4369
|
temperature,
|
|
4335
4370
|
top_p: topP,
|
|
4336
4371
|
max_output_tokens: maxOutputTokens,
|
|
4337
|
-
...((responseFormat == null ? void 0 : responseFormat.type) === "json" || (openaiOptions == null ? void 0 : openaiOptions.textVerbosity)) && {
|
|
4372
|
+
...((responseFormat == null ? void 0 : responseFormat.type) === "json" || requestTextFormat != null || (openaiOptions == null ? void 0 : openaiOptions.textVerbosity)) && {
|
|
4338
4373
|
text: {
|
|
4339
|
-
...(responseFormat == null ? void 0 : responseFormat.type) === "json" && {
|
|
4374
|
+
...requestTextFormat != null ? { format: requestTextFormat } : (responseFormat == null ? void 0 : responseFormat.type) === "json" && {
|
|
4340
4375
|
format: responseFormat.schema != null ? {
|
|
4341
4376
|
type: "json_schema",
|
|
4342
4377
|
strict: strictJsonSchema,
|
|
4343
|
-
name: (
|
|
4378
|
+
name: (_e = responseFormat.name) != null ? _e : "response",
|
|
4344
4379
|
description: responseFormat.description,
|
|
4345
4380
|
schema: responseFormat.schema
|
|
4346
4381
|
} : { type: "json_object" }
|
|
@@ -4362,7 +4397,11 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4362
4397
|
service_tier: openaiOptions == null ? void 0 : openaiOptions.serviceTier,
|
|
4363
4398
|
include,
|
|
4364
4399
|
prompt_cache_key: openaiOptions == null ? void 0 : openaiOptions.promptCacheKey,
|
|
4365
|
-
prompt_cache_options: openaiOptions == null ? void 0 : openaiOptions.promptCacheOptions
|
|
4400
|
+
prompt_cache_options: (openaiOptions == null ? void 0 : openaiOptions.promptCacheOptions) && {
|
|
4401
|
+
mode: openaiOptions.promptCacheOptions.mode,
|
|
4402
|
+
ttl: openaiOptions.promptCacheOptions.ttl,
|
|
4403
|
+
comparison_response_id: openaiOptions.promptCacheOptions.comparisonResponseId
|
|
4404
|
+
},
|
|
4366
4405
|
prompt_cache_retention: openaiOptions == null ? void 0 : openaiOptions.promptCacheRetention,
|
|
4367
4406
|
safety_identifier: openaiOptions == null ? void 0 : openaiOptions.safetyIdentifier,
|
|
4368
4407
|
top_logprobs: topLogprobs,
|
|
@@ -4411,9 +4450,9 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4411
4450
|
details: "topP is not supported for reasoning models"
|
|
4412
4451
|
});
|
|
4413
4452
|
}
|
|
4414
|
-
if (modelCapabilities.supportedReasoningEfforts != null && (baseArgs.top_logprobs != null || ((
|
|
4453
|
+
if (modelCapabilities.supportedReasoningEfforts != null && (baseArgs.top_logprobs != null || ((_f = baseArgs.include) == null ? void 0 : _f.includes("message.output_text.logprobs")))) {
|
|
4415
4454
|
baseArgs.top_logprobs = void 0;
|
|
4416
|
-
const filteredInclude = (
|
|
4455
|
+
const filteredInclude = (_g = baseArgs.include) == null ? void 0 : _g.filter(
|
|
4417
4456
|
(value) => value !== "message.output_text.logprobs"
|
|
4418
4457
|
);
|
|
4419
4458
|
baseArgs.include = filteredInclude != null && filteredInclude.length > 0 ? filteredInclude : void 0;
|
|
@@ -4789,6 +4828,9 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4789
4828
|
if (logprobs.length > 0) {
|
|
4790
4829
|
providerMetadata[providerKey].logprobs = logprobs;
|
|
4791
4830
|
}
|
|
4831
|
+
if (response.prompt_cache_diagnostics != null) {
|
|
4832
|
+
providerMetadata[providerKey].promptCacheDiagnostics = response.prompt_cache_diagnostics;
|
|
4833
|
+
}
|
|
4792
4834
|
if (typeof response.service_tier === "string") {
|
|
4793
4835
|
providerMetadata[providerKey].serviceTier = response.service_tier;
|
|
4794
4836
|
}
|
|
@@ -4868,6 +4910,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4868
4910
|
const activeReasoning = {};
|
|
4869
4911
|
let serviceTier;
|
|
4870
4912
|
let reasoningContext;
|
|
4913
|
+
let promptCacheDiagnostics;
|
|
4871
4914
|
let responsesUsage;
|
|
4872
4915
|
return {
|
|
4873
4916
|
stream: response.pipeThrough(
|
|
@@ -4876,7 +4919,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4876
4919
|
controller.enqueue({ type: "stream-start", warnings });
|
|
4877
4920
|
},
|
|
4878
4921
|
transform(chunk, controller) {
|
|
4879
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
4922
|
+
var _a2, _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;
|
|
4880
4923
|
if (options.includeRawChunks) {
|
|
4881
4924
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
4882
4925
|
}
|
|
@@ -5269,20 +5312,21 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5269
5312
|
activeReasoning[value.item_id].summaryParts[value.summary_index] = "can-conclude";
|
|
5270
5313
|
}
|
|
5271
5314
|
} else if (isResponseFinishedChunk(value)) {
|
|
5315
|
+
promptCacheDiagnostics = (_k = value.response.prompt_cache_diagnostics) != null ? _k : void 0;
|
|
5272
5316
|
finishReason = mapOpenAIResponseFinishReason({
|
|
5273
|
-
finishReason: (
|
|
5317
|
+
finishReason: (_l = value.response.incomplete_details) == null ? void 0 : _l.reason,
|
|
5274
5318
|
hasFunctionCall,
|
|
5275
5319
|
hasRefusal
|
|
5276
5320
|
});
|
|
5277
5321
|
usage.inputTokens = value.response.usage.input_tokens;
|
|
5278
5322
|
usage.outputTokens = value.response.usage.output_tokens;
|
|
5279
5323
|
usage.totalTokens = value.response.usage.input_tokens + value.response.usage.output_tokens;
|
|
5280
|
-
usage.reasoningTokens = (
|
|
5281
|
-
usage.cachedInputTokens = (
|
|
5324
|
+
usage.reasoningTokens = (_n = (_m = value.response.usage.output_tokens_details) == null ? void 0 : _m.reasoning_tokens) != null ? _n : void 0;
|
|
5325
|
+
usage.cachedInputTokens = (_p = (_o = value.response.usage.input_tokens_details) == null ? void 0 : _o.cached_tokens) != null ? _p : void 0;
|
|
5282
5326
|
if (typeof value.response.service_tier === "string") {
|
|
5283
5327
|
serviceTier = value.response.service_tier;
|
|
5284
5328
|
}
|
|
5285
|
-
if (((
|
|
5329
|
+
if (((_q = value.response.reasoning) == null ? void 0 : _q.context) != null) {
|
|
5286
5330
|
reasoningContext = value.response.reasoning.context;
|
|
5287
5331
|
}
|
|
5288
5332
|
responsesUsage = getResponsesUsageMetadata(value.response.usage);
|
|
@@ -5292,7 +5336,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5292
5336
|
controller.enqueue({
|
|
5293
5337
|
type: "source",
|
|
5294
5338
|
sourceType: "url",
|
|
5295
|
-
id: (
|
|
5339
|
+
id: (_t = (_s = (_r = self.config).generateId) == null ? void 0 : _s.call(_r)) != null ? _t : generateId2(),
|
|
5296
5340
|
url: value.annotation.url,
|
|
5297
5341
|
title: value.annotation.title
|
|
5298
5342
|
});
|
|
@@ -5300,10 +5344,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5300
5344
|
controller.enqueue({
|
|
5301
5345
|
type: "source",
|
|
5302
5346
|
sourceType: "document",
|
|
5303
|
-
id: (
|
|
5347
|
+
id: (_w = (_v = (_u = self.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : generateId2(),
|
|
5304
5348
|
mediaType: "text/plain",
|
|
5305
|
-
title: (
|
|
5306
|
-
filename: (
|
|
5349
|
+
title: (_y = (_x = value.annotation.quote) != null ? _x : value.annotation.filename) != null ? _y : "Document",
|
|
5350
|
+
filename: (_z = value.annotation.filename) != null ? _z : value.annotation.file_id,
|
|
5307
5351
|
...value.annotation.file_id ? {
|
|
5308
5352
|
providerMetadata: {
|
|
5309
5353
|
[providerKey]: {
|
|
@@ -5332,6 +5376,9 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5332
5376
|
if (reasoningContext !== void 0) {
|
|
5333
5377
|
providerMetadata[providerKey].reasoningContext = reasoningContext;
|
|
5334
5378
|
}
|
|
5379
|
+
if (promptCacheDiagnostics !== void 0) {
|
|
5380
|
+
providerMetadata[providerKey].promptCacheDiagnostics = promptCacheDiagnostics;
|
|
5381
|
+
}
|
|
5335
5382
|
if (responsesUsage != null) {
|
|
5336
5383
|
providerMetadata[providerKey].usage = responsesUsage;
|
|
5337
5384
|
}
|