@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.js
CHANGED
|
@@ -2438,11 +2438,24 @@ var import_provider_utils30 = require("@ai-sdk/provider-utils");
|
|
|
2438
2438
|
// src/responses/convert-to-openai-responses-input.ts
|
|
2439
2439
|
var import_provider6 = require("@ai-sdk/provider");
|
|
2440
2440
|
var import_provider_utils23 = require("@ai-sdk/provider-utils");
|
|
2441
|
-
var
|
|
2441
|
+
var import_v417 = require("zod/v4");
|
|
2442
|
+
|
|
2443
|
+
// src/responses/openai-responses-text-format.ts
|
|
2444
|
+
var import_v413 = require("zod/v4");
|
|
2445
|
+
var openaiResponsesTextFormatSchema = () => import_v413.z.discriminatedUnion("type", [
|
|
2446
|
+
import_v413.z.object({ type: import_v413.z.literal("text") }),
|
|
2447
|
+
import_v413.z.object({
|
|
2448
|
+
type: import_v413.z.literal("json_schema"),
|
|
2449
|
+
name: import_v413.z.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/),
|
|
2450
|
+
schema: import_v413.z.record(import_v413.z.string(), import_v413.z.json()),
|
|
2451
|
+
description: import_v413.z.string().optional(),
|
|
2452
|
+
strict: import_v413.z.boolean().optional()
|
|
2453
|
+
})
|
|
2454
|
+
]);
|
|
2442
2455
|
|
|
2443
2456
|
// src/responses/openai-responses-options.ts
|
|
2444
2457
|
var import_provider_utils20 = require("@ai-sdk/provider-utils");
|
|
2445
|
-
var
|
|
2458
|
+
var import_v414 = require("zod/v4");
|
|
2446
2459
|
var TOP_LOGPROBS_MAX = 20;
|
|
2447
2460
|
var openaiResponsesReasoningModelIds = [
|
|
2448
2461
|
"o1",
|
|
@@ -2534,17 +2547,17 @@ var openaiResponsesModelIds = [
|
|
|
2534
2547
|
];
|
|
2535
2548
|
var openaiResponsesProviderOptionsSchema = (0, import_provider_utils20.lazyValidator)(
|
|
2536
2549
|
() => (0, import_provider_utils20.zodSchema)(
|
|
2537
|
-
|
|
2538
|
-
conversation:
|
|
2539
|
-
include:
|
|
2540
|
-
|
|
2550
|
+
import_v414.z.object({
|
|
2551
|
+
conversation: import_v414.z.string().nullish(),
|
|
2552
|
+
include: import_v414.z.array(
|
|
2553
|
+
import_v414.z.enum([
|
|
2541
2554
|
"reasoning.encrypted_content",
|
|
2542
2555
|
// handled internally by default, only needed for unknown reasoning models
|
|
2543
2556
|
"file_search_call.results",
|
|
2544
2557
|
"message.output_text.logprobs"
|
|
2545
2558
|
])
|
|
2546
2559
|
).nullish(),
|
|
2547
|
-
instructions:
|
|
2560
|
+
instructions: import_v414.z.string().nullish(),
|
|
2548
2561
|
/**
|
|
2549
2562
|
* Return the log probabilities of the tokens.
|
|
2550
2563
|
*
|
|
@@ -2557,25 +2570,26 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils20.lazyValid
|
|
|
2557
2570
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
2558
2571
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
2559
2572
|
*/
|
|
2560
|
-
logprobs:
|
|
2573
|
+
logprobs: import_v414.z.union([import_v414.z.boolean(), import_v414.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
2561
2574
|
/**
|
|
2562
2575
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
2563
2576
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
2564
2577
|
* Any further attempts to call a tool by the model will be ignored.
|
|
2565
2578
|
*/
|
|
2566
|
-
maxToolCalls:
|
|
2567
|
-
metadata:
|
|
2568
|
-
parallelToolCalls:
|
|
2569
|
-
previousResponseId:
|
|
2570
|
-
promptCacheKey:
|
|
2579
|
+
maxToolCalls: import_v414.z.number().nullish(),
|
|
2580
|
+
metadata: import_v414.z.any().nullish(),
|
|
2581
|
+
parallelToolCalls: import_v414.z.boolean().nullish(),
|
|
2582
|
+
previousResponseId: import_v414.z.string().nullish(),
|
|
2583
|
+
promptCacheKey: import_v414.z.string().nullish(),
|
|
2571
2584
|
/**
|
|
2572
2585
|
* Prompt cache behavior for GPT-5.6 and later models.
|
|
2573
2586
|
* `mode` controls whether OpenAI also places an implicit breakpoint.
|
|
2574
2587
|
* `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
|
|
2575
2588
|
*/
|
|
2576
|
-
promptCacheOptions:
|
|
2577
|
-
|
|
2578
|
-
|
|
2589
|
+
promptCacheOptions: import_v414.z.object({
|
|
2590
|
+
comparisonResponseId: import_v414.z.string().optional(),
|
|
2591
|
+
mode: import_v414.z.enum(["implicit", "explicit"]).optional(),
|
|
2592
|
+
ttl: import_v414.z.literal("30m").optional()
|
|
2579
2593
|
}).optional(),
|
|
2580
2594
|
/**
|
|
2581
2595
|
* The retention policy for the prompt cache.
|
|
@@ -2587,14 +2601,14 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils20.lazyValid
|
|
|
2587
2601
|
*
|
|
2588
2602
|
* @default 'in_memory'
|
|
2589
2603
|
*/
|
|
2590
|
-
promptCacheRetention:
|
|
2604
|
+
promptCacheRetention: import_v414.z.enum(["in_memory", "24h"]).nullish(),
|
|
2591
2605
|
/**
|
|
2592
2606
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
2593
2607
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
2594
2608
|
* GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
2595
2609
|
* Supported values vary by model.
|
|
2596
2610
|
*/
|
|
2597
|
-
reasoningEffort:
|
|
2611
|
+
reasoningEffort: import_v414.z.string().nullish(),
|
|
2598
2612
|
/**
|
|
2599
2613
|
* Updates the reasoning effort for GPT-6 and later models starting with this response
|
|
2600
2614
|
* without changing the request-level reasoning effort. This preserves the
|
|
@@ -2603,32 +2617,36 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils20.lazyValid
|
|
|
2603
2617
|
* Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be
|
|
2604
2618
|
* combined with automatic truncation.
|
|
2605
2619
|
*/
|
|
2606
|
-
reasoningEffortUpdate:
|
|
2620
|
+
reasoningEffortUpdate: import_v414.z.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
2607
2621
|
/**
|
|
2608
2622
|
* Controls how much model work GPT-5.6 performs before returning a final answer.
|
|
2609
2623
|
* `standard` is the default. `pro` increases quality, latency, and token usage.
|
|
2610
2624
|
*/
|
|
2611
|
-
reasoningMode:
|
|
2625
|
+
reasoningMode: import_v414.z.enum(["standard", "pro"]).optional(),
|
|
2612
2626
|
/**
|
|
2613
2627
|
* Controls which available reasoning items GPT-5.6 can use.
|
|
2614
2628
|
* `auto` uses the model default, `current_turn` excludes reasoning from earlier
|
|
2615
2629
|
* turns, and `all_turns` makes compatible earlier reasoning available.
|
|
2616
2630
|
*/
|
|
2617
|
-
reasoningContext:
|
|
2618
|
-
reasoningSummary:
|
|
2619
|
-
safetyIdentifier:
|
|
2620
|
-
serviceTier:
|
|
2621
|
-
store:
|
|
2622
|
-
strictJsonSchema:
|
|
2623
|
-
textVerbosity:
|
|
2624
|
-
|
|
2625
|
-
|
|
2631
|
+
reasoningContext: import_v414.z.enum(["auto", "current_turn", "all_turns"]).optional(),
|
|
2632
|
+
reasoningSummary: import_v414.z.string().nullish(),
|
|
2633
|
+
safetyIdentifier: import_v414.z.string().nullish(),
|
|
2634
|
+
serviceTier: import_v414.z.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
2635
|
+
store: import_v414.z.boolean().nullish(),
|
|
2636
|
+
strictJsonSchema: import_v414.z.boolean().nullish(),
|
|
2637
|
+
textVerbosity: import_v414.z.enum(["low", "medium", "high"]).nullish(),
|
|
2638
|
+
/** Keep the initial wire format stable while Output validates the current schema. */
|
|
2639
|
+
textFormat: openaiResponsesTextFormatSchema().optional(),
|
|
2640
|
+
truncation: import_v414.z.enum(["auto", "disabled"]).nullish(),
|
|
2641
|
+
user: import_v414.z.string().nullish()
|
|
2626
2642
|
})
|
|
2627
2643
|
)
|
|
2628
2644
|
);
|
|
2629
2645
|
var openaiResponsesSystemMessageOptionsSchema = (0, import_provider_utils20.lazyValidator)(
|
|
2630
2646
|
() => (0, import_provider_utils20.zodSchema)(
|
|
2631
|
-
|
|
2647
|
+
import_v414.z.object({
|
|
2648
|
+
/** Replace the format at this position; requires empty system content. */
|
|
2649
|
+
textFormatUpdate: openaiResponsesTextFormatSchema().optional(),
|
|
2632
2650
|
/**
|
|
2633
2651
|
* Emit a configuration update at this position in Responses history.
|
|
2634
2652
|
* Requires empty system message content and the same supported
|
|
@@ -2637,30 +2655,30 @@ var openaiResponsesSystemMessageOptionsSchema = (0, import_provider_utils20.lazy
|
|
|
2637
2655
|
*
|
|
2638
2656
|
* @see https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation
|
|
2639
2657
|
*/
|
|
2640
|
-
reasoningEffortUpdate:
|
|
2658
|
+
reasoningEffortUpdate: import_v414.z.enum(["low", "medium", "high", "xhigh", "max"]).optional()
|
|
2641
2659
|
})
|
|
2642
2660
|
)
|
|
2643
2661
|
);
|
|
2644
2662
|
|
|
2645
2663
|
// src/tool/local-shell.ts
|
|
2646
2664
|
var import_provider_utils21 = require("@ai-sdk/provider-utils");
|
|
2647
|
-
var
|
|
2665
|
+
var import_v415 = require("zod/v4");
|
|
2648
2666
|
var localShellInputSchema = (0, import_provider_utils21.lazySchema)(
|
|
2649
2667
|
() => (0, import_provider_utils21.zodSchema)(
|
|
2650
|
-
|
|
2651
|
-
action:
|
|
2652
|
-
type:
|
|
2653
|
-
command:
|
|
2654
|
-
timeoutMs:
|
|
2655
|
-
user:
|
|
2656
|
-
workingDirectory:
|
|
2657
|
-
env:
|
|
2668
|
+
import_v415.z.object({
|
|
2669
|
+
action: import_v415.z.object({
|
|
2670
|
+
type: import_v415.z.literal("exec"),
|
|
2671
|
+
command: import_v415.z.array(import_v415.z.string()),
|
|
2672
|
+
timeoutMs: import_v415.z.number().optional(),
|
|
2673
|
+
user: import_v415.z.string().optional(),
|
|
2674
|
+
workingDirectory: import_v415.z.string().optional(),
|
|
2675
|
+
env: import_v415.z.record(import_v415.z.string(), import_v415.z.string()).optional()
|
|
2658
2676
|
})
|
|
2659
2677
|
})
|
|
2660
2678
|
)
|
|
2661
2679
|
);
|
|
2662
2680
|
var localShellOutputSchema = (0, import_provider_utils21.lazySchema)(
|
|
2663
|
-
() => (0, import_provider_utils21.zodSchema)(
|
|
2681
|
+
() => (0, import_provider_utils21.zodSchema)(import_v415.z.object({ output: import_v415.z.string() }))
|
|
2664
2682
|
);
|
|
2665
2683
|
var localShell = (0, import_provider_utils21.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
2666
2684
|
id: "openai.local_shell",
|
|
@@ -2671,49 +2689,49 @@ var localShell = (0, import_provider_utils21.createProviderDefinedToolFactoryWit
|
|
|
2671
2689
|
|
|
2672
2690
|
// src/tool/web-search.ts
|
|
2673
2691
|
var import_provider_utils22 = require("@ai-sdk/provider-utils");
|
|
2674
|
-
var
|
|
2692
|
+
var import_v416 = require("zod/v4");
|
|
2675
2693
|
var webSearchArgsSchema = (0, import_provider_utils22.lazySchema)(
|
|
2676
2694
|
() => (0, import_provider_utils22.zodSchema)(
|
|
2677
|
-
|
|
2678
|
-
externalWebAccess:
|
|
2679
|
-
filters:
|
|
2680
|
-
allowedDomains:
|
|
2681
|
-
blockedDomains:
|
|
2695
|
+
import_v416.z.object({
|
|
2696
|
+
externalWebAccess: import_v416.z.boolean().optional(),
|
|
2697
|
+
filters: import_v416.z.object({
|
|
2698
|
+
allowedDomains: import_v416.z.array(import_v416.z.string()).optional(),
|
|
2699
|
+
blockedDomains: import_v416.z.array(import_v416.z.string()).optional()
|
|
2682
2700
|
}).optional(),
|
|
2683
|
-
searchContextSize:
|
|
2684
|
-
userLocation:
|
|
2685
|
-
type:
|
|
2686
|
-
country:
|
|
2687
|
-
city:
|
|
2688
|
-
region:
|
|
2689
|
-
timezone:
|
|
2701
|
+
searchContextSize: import_v416.z.enum(["low", "medium", "high"]).optional(),
|
|
2702
|
+
userLocation: import_v416.z.object({
|
|
2703
|
+
type: import_v416.z.literal("approximate"),
|
|
2704
|
+
country: import_v416.z.string().optional(),
|
|
2705
|
+
city: import_v416.z.string().optional(),
|
|
2706
|
+
region: import_v416.z.string().optional(),
|
|
2707
|
+
timezone: import_v416.z.string().optional()
|
|
2690
2708
|
}).optional()
|
|
2691
2709
|
})
|
|
2692
2710
|
)
|
|
2693
2711
|
);
|
|
2694
|
-
var webSearchInputSchema = (0, import_provider_utils22.lazySchema)(() => (0, import_provider_utils22.zodSchema)(
|
|
2712
|
+
var webSearchInputSchema = (0, import_provider_utils22.lazySchema)(() => (0, import_provider_utils22.zodSchema)(import_v416.z.object({})));
|
|
2695
2713
|
var webSearchOutputSchema = (0, import_provider_utils22.lazySchema)(
|
|
2696
2714
|
() => (0, import_provider_utils22.zodSchema)(
|
|
2697
|
-
|
|
2698
|
-
action:
|
|
2699
|
-
|
|
2700
|
-
type:
|
|
2701
|
-
query:
|
|
2715
|
+
import_v416.z.object({
|
|
2716
|
+
action: import_v416.z.discriminatedUnion("type", [
|
|
2717
|
+
import_v416.z.object({
|
|
2718
|
+
type: import_v416.z.literal("search"),
|
|
2719
|
+
query: import_v416.z.string().optional()
|
|
2702
2720
|
}),
|
|
2703
|
-
|
|
2704
|
-
type:
|
|
2705
|
-
url:
|
|
2721
|
+
import_v416.z.object({
|
|
2722
|
+
type: import_v416.z.literal("openPage"),
|
|
2723
|
+
url: import_v416.z.string().nullish()
|
|
2706
2724
|
}),
|
|
2707
|
-
|
|
2708
|
-
type:
|
|
2709
|
-
url:
|
|
2710
|
-
pattern:
|
|
2725
|
+
import_v416.z.object({
|
|
2726
|
+
type: import_v416.z.literal("findInPage"),
|
|
2727
|
+
url: import_v416.z.string().nullish(),
|
|
2728
|
+
pattern: import_v416.z.string().nullish()
|
|
2711
2729
|
})
|
|
2712
2730
|
]).optional(),
|
|
2713
|
-
sources:
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2731
|
+
sources: import_v416.z.array(
|
|
2732
|
+
import_v416.z.discriminatedUnion("type", [
|
|
2733
|
+
import_v416.z.object({ type: import_v416.z.literal("url"), url: import_v416.z.string() }),
|
|
2734
|
+
import_v416.z.object({ type: import_v416.z.literal("api"), name: import_v416.z.string() })
|
|
2717
2735
|
])
|
|
2718
2736
|
).optional()
|
|
2719
2737
|
})
|
|
@@ -2817,17 +2835,24 @@ async function convertToOpenAIResponsesInput({
|
|
|
2817
2835
|
});
|
|
2818
2836
|
}
|
|
2819
2837
|
const effort = options == null ? void 0 : options.reasoningEffortUpdate;
|
|
2820
|
-
|
|
2821
|
-
|
|
2838
|
+
const textFormat = options == null ? void 0 : options.textFormatUpdate;
|
|
2839
|
+
if (effort != null || textFormat != null) {
|
|
2840
|
+
const feature = effort != null ? "reasoningEffortUpdate" : "textFormatUpdate";
|
|
2841
|
+
const unsupportedReason = content !== "" ? `Message-level ${feature} requires empty system message content.` : configurationUpdateUnsupportedReason;
|
|
2822
2842
|
if (unsupportedReason != null) {
|
|
2823
2843
|
throw new import_provider6.UnsupportedFunctionalityError({
|
|
2824
|
-
functionality:
|
|
2844
|
+
functionality: `Message-level ${feature}`,
|
|
2825
2845
|
message: unsupportedReason
|
|
2826
2846
|
});
|
|
2827
2847
|
}
|
|
2828
2848
|
input.push({
|
|
2829
2849
|
type: "configuration_update",
|
|
2830
|
-
reasoning: { effort }
|
|
2850
|
+
...effort != null && { reasoning: { effort } },
|
|
2851
|
+
...textFormat != null && {
|
|
2852
|
+
text: {
|
|
2853
|
+
format: textFormat
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2831
2856
|
});
|
|
2832
2857
|
break;
|
|
2833
2858
|
}
|
|
@@ -3197,9 +3222,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
3197
3222
|
}
|
|
3198
3223
|
var openaiResponsesReasoningProviderOptionsSchema = (0, import_provider_utils23.lazySchema)(
|
|
3199
3224
|
() => (0, import_provider_utils23.zodSchema)(
|
|
3200
|
-
|
|
3201
|
-
itemId:
|
|
3202
|
-
reasoningEncryptedContent:
|
|
3225
|
+
import_v417.z.object({
|
|
3226
|
+
itemId: import_v417.z.string().nullish(),
|
|
3227
|
+
reasoningEncryptedContent: import_v417.z.string().nullish()
|
|
3203
3228
|
})
|
|
3204
3229
|
)
|
|
3205
3230
|
);
|
|
@@ -3237,301 +3262,308 @@ function mapOpenAIResponseFinishReason({
|
|
|
3237
3262
|
|
|
3238
3263
|
// src/responses/openai-responses-api.ts
|
|
3239
3264
|
var import_provider_utils24 = require("@ai-sdk/provider-utils");
|
|
3240
|
-
var
|
|
3265
|
+
var import_v418 = require("zod/v4");
|
|
3266
|
+
var openaiResponsesPromptCacheDiagnosticsSchema = () => import_v418.z.object({
|
|
3267
|
+
type: import_v418.z.string(),
|
|
3268
|
+
reason: import_v418.z.string().nullish(),
|
|
3269
|
+
cache_missed_tokens: import_v418.z.number().nullish(),
|
|
3270
|
+
comparison_reusable_tokens: import_v418.z.number().nullish()
|
|
3271
|
+
});
|
|
3241
3272
|
var openaiResponsesChunkSchema = (0, import_provider_utils24.lazyValidator)(
|
|
3242
3273
|
() => (0, import_provider_utils24.zodSchema)(
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
type:
|
|
3246
|
-
item_id:
|
|
3247
|
-
delta:
|
|
3248
|
-
logprobs:
|
|
3249
|
-
|
|
3250
|
-
token:
|
|
3251
|
-
logprob:
|
|
3252
|
-
top_logprobs:
|
|
3253
|
-
|
|
3254
|
-
token:
|
|
3255
|
-
logprob:
|
|
3274
|
+
import_v418.z.union([
|
|
3275
|
+
import_v418.z.object({
|
|
3276
|
+
type: import_v418.z.literal("response.output_text.delta"),
|
|
3277
|
+
item_id: import_v418.z.string(),
|
|
3278
|
+
delta: import_v418.z.string(),
|
|
3279
|
+
logprobs: import_v418.z.array(
|
|
3280
|
+
import_v418.z.object({
|
|
3281
|
+
token: import_v418.z.string(),
|
|
3282
|
+
logprob: import_v418.z.number(),
|
|
3283
|
+
top_logprobs: import_v418.z.array(
|
|
3284
|
+
import_v418.z.object({
|
|
3285
|
+
token: import_v418.z.string(),
|
|
3286
|
+
logprob: import_v418.z.number()
|
|
3256
3287
|
})
|
|
3257
3288
|
)
|
|
3258
3289
|
})
|
|
3259
3290
|
).nullish()
|
|
3260
3291
|
}),
|
|
3261
|
-
|
|
3262
|
-
type:
|
|
3263
|
-
item_id:
|
|
3264
|
-
output_index:
|
|
3265
|
-
content_index:
|
|
3266
|
-
delta:
|
|
3292
|
+
import_v418.z.object({
|
|
3293
|
+
type: import_v418.z.literal("response.refusal.delta"),
|
|
3294
|
+
item_id: import_v418.z.string(),
|
|
3295
|
+
output_index: import_v418.z.number().nullish(),
|
|
3296
|
+
content_index: import_v418.z.number().nullish(),
|
|
3297
|
+
delta: import_v418.z.string()
|
|
3267
3298
|
}),
|
|
3268
|
-
|
|
3269
|
-
type:
|
|
3270
|
-
item_id:
|
|
3271
|
-
output_index:
|
|
3272
|
-
content_index:
|
|
3273
|
-
refusal:
|
|
3299
|
+
import_v418.z.object({
|
|
3300
|
+
type: import_v418.z.literal("response.refusal.done"),
|
|
3301
|
+
item_id: import_v418.z.string(),
|
|
3302
|
+
output_index: import_v418.z.number().nullish(),
|
|
3303
|
+
content_index: import_v418.z.number().nullish(),
|
|
3304
|
+
refusal: import_v418.z.string()
|
|
3274
3305
|
}),
|
|
3275
|
-
|
|
3276
|
-
type:
|
|
3277
|
-
response:
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3306
|
+
import_v418.z.object({
|
|
3307
|
+
type: import_v418.z.enum(["response.completed", "response.incomplete"]),
|
|
3308
|
+
response: import_v418.z.object({
|
|
3309
|
+
prompt_cache_diagnostics: openaiResponsesPromptCacheDiagnosticsSchema().nullish(),
|
|
3310
|
+
incomplete_details: import_v418.z.object({ reason: import_v418.z.string() }).nullish(),
|
|
3311
|
+
usage: import_v418.z.object({
|
|
3312
|
+
input_tokens: import_v418.z.number(),
|
|
3313
|
+
input_tokens_details: import_v418.z.object({
|
|
3314
|
+
cached_tokens: import_v418.z.number().nullish(),
|
|
3315
|
+
cache_write_tokens: import_v418.z.number().nullish(),
|
|
3316
|
+
orchestration_input_tokens: import_v418.z.number().nullish(),
|
|
3317
|
+
orchestration_input_cached_tokens: import_v418.z.number().nullish()
|
|
3286
3318
|
}).nullish(),
|
|
3287
|
-
output_tokens:
|
|
3288
|
-
output_tokens_details:
|
|
3289
|
-
reasoning_tokens:
|
|
3290
|
-
orchestration_output_tokens:
|
|
3319
|
+
output_tokens: import_v418.z.number(),
|
|
3320
|
+
output_tokens_details: import_v418.z.object({
|
|
3321
|
+
reasoning_tokens: import_v418.z.number().nullish(),
|
|
3322
|
+
orchestration_output_tokens: import_v418.z.number().nullish()
|
|
3291
3323
|
}).nullish()
|
|
3292
3324
|
}),
|
|
3293
|
-
reasoning:
|
|
3294
|
-
context:
|
|
3325
|
+
reasoning: import_v418.z.object({
|
|
3326
|
+
context: import_v418.z.string().nullish()
|
|
3295
3327
|
}).nullish(),
|
|
3296
|
-
service_tier:
|
|
3328
|
+
service_tier: import_v418.z.string().nullish()
|
|
3297
3329
|
})
|
|
3298
3330
|
}),
|
|
3299
|
-
|
|
3300
|
-
type:
|
|
3301
|
-
response:
|
|
3302
|
-
id:
|
|
3303
|
-
created_at:
|
|
3304
|
-
model:
|
|
3305
|
-
service_tier:
|
|
3331
|
+
import_v418.z.object({
|
|
3332
|
+
type: import_v418.z.literal("response.created"),
|
|
3333
|
+
response: import_v418.z.object({
|
|
3334
|
+
id: import_v418.z.string(),
|
|
3335
|
+
created_at: import_v418.z.number(),
|
|
3336
|
+
model: import_v418.z.string(),
|
|
3337
|
+
service_tier: import_v418.z.string().nullish()
|
|
3306
3338
|
})
|
|
3307
3339
|
}),
|
|
3308
|
-
|
|
3309
|
-
type:
|
|
3310
|
-
output_index:
|
|
3311
|
-
item:
|
|
3312
|
-
|
|
3313
|
-
type:
|
|
3314
|
-
id:
|
|
3315
|
-
phase:
|
|
3340
|
+
import_v418.z.object({
|
|
3341
|
+
type: import_v418.z.literal("response.output_item.added"),
|
|
3342
|
+
output_index: import_v418.z.number(),
|
|
3343
|
+
item: import_v418.z.discriminatedUnion("type", [
|
|
3344
|
+
import_v418.z.object({
|
|
3345
|
+
type: import_v418.z.literal("message"),
|
|
3346
|
+
id: import_v418.z.string(),
|
|
3347
|
+
phase: import_v418.z.enum(["commentary", "final_answer"]).nullish()
|
|
3316
3348
|
}),
|
|
3317
|
-
|
|
3318
|
-
type:
|
|
3319
|
-
id:
|
|
3320
|
-
encrypted_content:
|
|
3349
|
+
import_v418.z.object({
|
|
3350
|
+
type: import_v418.z.literal("reasoning"),
|
|
3351
|
+
id: import_v418.z.string(),
|
|
3352
|
+
encrypted_content: import_v418.z.string().nullish()
|
|
3321
3353
|
}),
|
|
3322
|
-
|
|
3323
|
-
type:
|
|
3324
|
-
id:
|
|
3325
|
-
call_id:
|
|
3326
|
-
name:
|
|
3327
|
-
arguments:
|
|
3328
|
-
async:
|
|
3354
|
+
import_v418.z.object({
|
|
3355
|
+
type: import_v418.z.literal("function_call"),
|
|
3356
|
+
id: import_v418.z.string(),
|
|
3357
|
+
call_id: import_v418.z.string(),
|
|
3358
|
+
name: import_v418.z.string(),
|
|
3359
|
+
arguments: import_v418.z.string(),
|
|
3360
|
+
async: import_v418.z.boolean().nullish()
|
|
3329
3361
|
}),
|
|
3330
|
-
|
|
3331
|
-
type:
|
|
3332
|
-
id:
|
|
3333
|
-
status:
|
|
3362
|
+
import_v418.z.object({
|
|
3363
|
+
type: import_v418.z.literal("web_search_call"),
|
|
3364
|
+
id: import_v418.z.string(),
|
|
3365
|
+
status: import_v418.z.string()
|
|
3334
3366
|
}),
|
|
3335
|
-
|
|
3336
|
-
type:
|
|
3337
|
-
id:
|
|
3338
|
-
status:
|
|
3367
|
+
import_v418.z.object({
|
|
3368
|
+
type: import_v418.z.literal("computer_call"),
|
|
3369
|
+
id: import_v418.z.string(),
|
|
3370
|
+
status: import_v418.z.string()
|
|
3339
3371
|
}),
|
|
3340
|
-
|
|
3341
|
-
type:
|
|
3342
|
-
id:
|
|
3372
|
+
import_v418.z.object({
|
|
3373
|
+
type: import_v418.z.literal("file_search_call"),
|
|
3374
|
+
id: import_v418.z.string()
|
|
3343
3375
|
}),
|
|
3344
|
-
|
|
3345
|
-
type:
|
|
3346
|
-
id:
|
|
3376
|
+
import_v418.z.object({
|
|
3377
|
+
type: import_v418.z.literal("image_generation_call"),
|
|
3378
|
+
id: import_v418.z.string()
|
|
3347
3379
|
}),
|
|
3348
|
-
|
|
3349
|
-
type:
|
|
3350
|
-
id:
|
|
3351
|
-
container_id:
|
|
3352
|
-
code:
|
|
3353
|
-
outputs:
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3380
|
+
import_v418.z.object({
|
|
3381
|
+
type: import_v418.z.literal("code_interpreter_call"),
|
|
3382
|
+
id: import_v418.z.string(),
|
|
3383
|
+
container_id: import_v418.z.string(),
|
|
3384
|
+
code: import_v418.z.string().nullable(),
|
|
3385
|
+
outputs: import_v418.z.array(
|
|
3386
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3387
|
+
import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
|
|
3388
|
+
import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
|
|
3357
3389
|
])
|
|
3358
3390
|
).nullable(),
|
|
3359
|
-
status:
|
|
3391
|
+
status: import_v418.z.string()
|
|
3360
3392
|
})
|
|
3361
3393
|
])
|
|
3362
3394
|
}),
|
|
3363
|
-
|
|
3364
|
-
type:
|
|
3365
|
-
output_index:
|
|
3366
|
-
item:
|
|
3367
|
-
|
|
3368
|
-
type:
|
|
3369
|
-
id:
|
|
3370
|
-
phase:
|
|
3395
|
+
import_v418.z.object({
|
|
3396
|
+
type: import_v418.z.literal("response.output_item.done"),
|
|
3397
|
+
output_index: import_v418.z.number(),
|
|
3398
|
+
item: import_v418.z.discriminatedUnion("type", [
|
|
3399
|
+
import_v418.z.object({
|
|
3400
|
+
type: import_v418.z.literal("message"),
|
|
3401
|
+
id: import_v418.z.string(),
|
|
3402
|
+
phase: import_v418.z.enum(["commentary", "final_answer"]).nullish()
|
|
3371
3403
|
}),
|
|
3372
|
-
|
|
3373
|
-
type:
|
|
3374
|
-
id:
|
|
3375
|
-
encrypted_content:
|
|
3404
|
+
import_v418.z.object({
|
|
3405
|
+
type: import_v418.z.literal("reasoning"),
|
|
3406
|
+
id: import_v418.z.string(),
|
|
3407
|
+
encrypted_content: import_v418.z.string().nullish()
|
|
3376
3408
|
}),
|
|
3377
|
-
|
|
3378
|
-
type:
|
|
3379
|
-
id:
|
|
3380
|
-
call_id:
|
|
3381
|
-
name:
|
|
3382
|
-
arguments:
|
|
3383
|
-
async:
|
|
3384
|
-
status:
|
|
3409
|
+
import_v418.z.object({
|
|
3410
|
+
type: import_v418.z.literal("function_call"),
|
|
3411
|
+
id: import_v418.z.string(),
|
|
3412
|
+
call_id: import_v418.z.string(),
|
|
3413
|
+
name: import_v418.z.string(),
|
|
3414
|
+
arguments: import_v418.z.string(),
|
|
3415
|
+
async: import_v418.z.boolean().nullish(),
|
|
3416
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"])
|
|
3385
3417
|
}),
|
|
3386
|
-
|
|
3387
|
-
type:
|
|
3388
|
-
id:
|
|
3389
|
-
code:
|
|
3390
|
-
container_id:
|
|
3391
|
-
outputs:
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3418
|
+
import_v418.z.object({
|
|
3419
|
+
type: import_v418.z.literal("code_interpreter_call"),
|
|
3420
|
+
id: import_v418.z.string(),
|
|
3421
|
+
code: import_v418.z.string().nullable(),
|
|
3422
|
+
container_id: import_v418.z.string(),
|
|
3423
|
+
outputs: import_v418.z.array(
|
|
3424
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3425
|
+
import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
|
|
3426
|
+
import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
|
|
3395
3427
|
])
|
|
3396
3428
|
).nullable()
|
|
3397
3429
|
}),
|
|
3398
|
-
|
|
3399
|
-
type:
|
|
3400
|
-
id:
|
|
3401
|
-
result:
|
|
3430
|
+
import_v418.z.object({
|
|
3431
|
+
type: import_v418.z.literal("image_generation_call"),
|
|
3432
|
+
id: import_v418.z.string(),
|
|
3433
|
+
result: import_v418.z.string()
|
|
3402
3434
|
}),
|
|
3403
|
-
|
|
3404
|
-
type:
|
|
3405
|
-
id:
|
|
3406
|
-
status:
|
|
3407
|
-
action:
|
|
3408
|
-
|
|
3409
|
-
type:
|
|
3410
|
-
query:
|
|
3411
|
-
sources:
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3435
|
+
import_v418.z.object({
|
|
3436
|
+
type: import_v418.z.literal("web_search_call"),
|
|
3437
|
+
id: import_v418.z.string(),
|
|
3438
|
+
status: import_v418.z.string(),
|
|
3439
|
+
action: import_v418.z.discriminatedUnion("type", [
|
|
3440
|
+
import_v418.z.object({
|
|
3441
|
+
type: import_v418.z.literal("search"),
|
|
3442
|
+
query: import_v418.z.string().nullish(),
|
|
3443
|
+
sources: import_v418.z.array(
|
|
3444
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3445
|
+
import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
|
|
3446
|
+
import_v418.z.object({ type: import_v418.z.literal("api"), name: import_v418.z.string() })
|
|
3415
3447
|
])
|
|
3416
3448
|
).nullish()
|
|
3417
3449
|
}),
|
|
3418
|
-
|
|
3419
|
-
type:
|
|
3420
|
-
url:
|
|
3450
|
+
import_v418.z.object({
|
|
3451
|
+
type: import_v418.z.literal("open_page"),
|
|
3452
|
+
url: import_v418.z.string().nullish()
|
|
3421
3453
|
}),
|
|
3422
|
-
|
|
3423
|
-
type:
|
|
3424
|
-
url:
|
|
3425
|
-
pattern:
|
|
3454
|
+
import_v418.z.object({
|
|
3455
|
+
type: import_v418.z.literal("find_in_page"),
|
|
3456
|
+
url: import_v418.z.string().nullish(),
|
|
3457
|
+
pattern: import_v418.z.string().nullish()
|
|
3426
3458
|
})
|
|
3427
3459
|
]).nullish()
|
|
3428
3460
|
}),
|
|
3429
|
-
|
|
3430
|
-
type:
|
|
3431
|
-
id:
|
|
3432
|
-
queries:
|
|
3433
|
-
results:
|
|
3434
|
-
|
|
3435
|
-
attributes:
|
|
3436
|
-
file_id:
|
|
3437
|
-
filename:
|
|
3438
|
-
score:
|
|
3439
|
-
text:
|
|
3461
|
+
import_v418.z.object({
|
|
3462
|
+
type: import_v418.z.literal("file_search_call"),
|
|
3463
|
+
id: import_v418.z.string(),
|
|
3464
|
+
queries: import_v418.z.array(import_v418.z.string()),
|
|
3465
|
+
results: import_v418.z.array(
|
|
3466
|
+
import_v418.z.object({
|
|
3467
|
+
attributes: import_v418.z.record(import_v418.z.string(), import_v418.z.unknown()),
|
|
3468
|
+
file_id: import_v418.z.string(),
|
|
3469
|
+
filename: import_v418.z.string(),
|
|
3470
|
+
score: import_v418.z.number(),
|
|
3471
|
+
text: import_v418.z.string()
|
|
3440
3472
|
})
|
|
3441
3473
|
).nullish()
|
|
3442
3474
|
}),
|
|
3443
|
-
|
|
3444
|
-
type:
|
|
3445
|
-
id:
|
|
3446
|
-
call_id:
|
|
3447
|
-
action:
|
|
3448
|
-
type:
|
|
3449
|
-
command:
|
|
3450
|
-
timeout_ms:
|
|
3451
|
-
user:
|
|
3452
|
-
working_directory:
|
|
3453
|
-
env:
|
|
3475
|
+
import_v418.z.object({
|
|
3476
|
+
type: import_v418.z.literal("local_shell_call"),
|
|
3477
|
+
id: import_v418.z.string(),
|
|
3478
|
+
call_id: import_v418.z.string(),
|
|
3479
|
+
action: import_v418.z.object({
|
|
3480
|
+
type: import_v418.z.literal("exec"),
|
|
3481
|
+
command: import_v418.z.array(import_v418.z.string()),
|
|
3482
|
+
timeout_ms: import_v418.z.number().optional(),
|
|
3483
|
+
user: import_v418.z.string().optional(),
|
|
3484
|
+
working_directory: import_v418.z.string().optional(),
|
|
3485
|
+
env: import_v418.z.record(import_v418.z.string(), import_v418.z.string()).optional()
|
|
3454
3486
|
})
|
|
3455
3487
|
}),
|
|
3456
|
-
|
|
3457
|
-
type:
|
|
3458
|
-
id:
|
|
3459
|
-
status:
|
|
3488
|
+
import_v418.z.object({
|
|
3489
|
+
type: import_v418.z.literal("computer_call"),
|
|
3490
|
+
id: import_v418.z.string(),
|
|
3491
|
+
status: import_v418.z.literal("completed")
|
|
3460
3492
|
})
|
|
3461
3493
|
])
|
|
3462
3494
|
}),
|
|
3463
|
-
|
|
3464
|
-
type:
|
|
3465
|
-
item_id:
|
|
3466
|
-
output_index:
|
|
3467
|
-
delta:
|
|
3495
|
+
import_v418.z.object({
|
|
3496
|
+
type: import_v418.z.literal("response.function_call_arguments.delta"),
|
|
3497
|
+
item_id: import_v418.z.string(),
|
|
3498
|
+
output_index: import_v418.z.number(),
|
|
3499
|
+
delta: import_v418.z.string()
|
|
3468
3500
|
}),
|
|
3469
|
-
|
|
3470
|
-
type:
|
|
3471
|
-
item_id:
|
|
3472
|
-
output_index:
|
|
3473
|
-
partial_image_b64:
|
|
3501
|
+
import_v418.z.object({
|
|
3502
|
+
type: import_v418.z.literal("response.image_generation_call.partial_image"),
|
|
3503
|
+
item_id: import_v418.z.string(),
|
|
3504
|
+
output_index: import_v418.z.number(),
|
|
3505
|
+
partial_image_b64: import_v418.z.string()
|
|
3474
3506
|
}),
|
|
3475
|
-
|
|
3476
|
-
type:
|
|
3477
|
-
item_id:
|
|
3478
|
-
output_index:
|
|
3479
|
-
delta:
|
|
3507
|
+
import_v418.z.object({
|
|
3508
|
+
type: import_v418.z.literal("response.code_interpreter_call_code.delta"),
|
|
3509
|
+
item_id: import_v418.z.string(),
|
|
3510
|
+
output_index: import_v418.z.number(),
|
|
3511
|
+
delta: import_v418.z.string()
|
|
3480
3512
|
}),
|
|
3481
|
-
|
|
3482
|
-
type:
|
|
3483
|
-
item_id:
|
|
3484
|
-
output_index:
|
|
3485
|
-
code:
|
|
3513
|
+
import_v418.z.object({
|
|
3514
|
+
type: import_v418.z.literal("response.code_interpreter_call_code.done"),
|
|
3515
|
+
item_id: import_v418.z.string(),
|
|
3516
|
+
output_index: import_v418.z.number(),
|
|
3517
|
+
code: import_v418.z.string()
|
|
3486
3518
|
}),
|
|
3487
|
-
|
|
3488
|
-
type:
|
|
3489
|
-
annotation:
|
|
3490
|
-
|
|
3491
|
-
type:
|
|
3492
|
-
start_index:
|
|
3493
|
-
end_index:
|
|
3494
|
-
url:
|
|
3495
|
-
title:
|
|
3519
|
+
import_v418.z.object({
|
|
3520
|
+
type: import_v418.z.literal("response.output_text.annotation.added"),
|
|
3521
|
+
annotation: import_v418.z.discriminatedUnion("type", [
|
|
3522
|
+
import_v418.z.object({
|
|
3523
|
+
type: import_v418.z.literal("url_citation"),
|
|
3524
|
+
start_index: import_v418.z.number(),
|
|
3525
|
+
end_index: import_v418.z.number(),
|
|
3526
|
+
url: import_v418.z.string(),
|
|
3527
|
+
title: import_v418.z.string()
|
|
3496
3528
|
}),
|
|
3497
|
-
|
|
3498
|
-
type:
|
|
3499
|
-
file_id:
|
|
3500
|
-
filename:
|
|
3501
|
-
index:
|
|
3502
|
-
start_index:
|
|
3503
|
-
end_index:
|
|
3504
|
-
quote:
|
|
3529
|
+
import_v418.z.object({
|
|
3530
|
+
type: import_v418.z.literal("file_citation"),
|
|
3531
|
+
file_id: import_v418.z.string(),
|
|
3532
|
+
filename: import_v418.z.string().nullish(),
|
|
3533
|
+
index: import_v418.z.number().nullish(),
|
|
3534
|
+
start_index: import_v418.z.number().nullish(),
|
|
3535
|
+
end_index: import_v418.z.number().nullish(),
|
|
3536
|
+
quote: import_v418.z.string().nullish()
|
|
3505
3537
|
})
|
|
3506
3538
|
])
|
|
3507
3539
|
}),
|
|
3508
|
-
|
|
3509
|
-
type:
|
|
3510
|
-
item_id:
|
|
3511
|
-
summary_index:
|
|
3540
|
+
import_v418.z.object({
|
|
3541
|
+
type: import_v418.z.literal("response.reasoning_summary_part.added"),
|
|
3542
|
+
item_id: import_v418.z.string(),
|
|
3543
|
+
summary_index: import_v418.z.number()
|
|
3512
3544
|
}),
|
|
3513
|
-
|
|
3514
|
-
type:
|
|
3515
|
-
item_id:
|
|
3516
|
-
summary_index:
|
|
3517
|
-
delta:
|
|
3545
|
+
import_v418.z.object({
|
|
3546
|
+
type: import_v418.z.literal("response.reasoning_summary_text.delta"),
|
|
3547
|
+
item_id: import_v418.z.string(),
|
|
3548
|
+
summary_index: import_v418.z.number(),
|
|
3549
|
+
delta: import_v418.z.string()
|
|
3518
3550
|
}),
|
|
3519
|
-
|
|
3520
|
-
type:
|
|
3521
|
-
item_id:
|
|
3522
|
-
summary_index:
|
|
3551
|
+
import_v418.z.object({
|
|
3552
|
+
type: import_v418.z.literal("response.reasoning_summary_part.done"),
|
|
3553
|
+
item_id: import_v418.z.string(),
|
|
3554
|
+
summary_index: import_v418.z.number()
|
|
3523
3555
|
}),
|
|
3524
|
-
|
|
3525
|
-
type:
|
|
3526
|
-
sequence_number:
|
|
3527
|
-
error:
|
|
3528
|
-
type:
|
|
3529
|
-
code:
|
|
3530
|
-
message:
|
|
3531
|
-
param:
|
|
3556
|
+
import_v418.z.object({
|
|
3557
|
+
type: import_v418.z.literal("error"),
|
|
3558
|
+
sequence_number: import_v418.z.number(),
|
|
3559
|
+
error: import_v418.z.object({
|
|
3560
|
+
type: import_v418.z.string(),
|
|
3561
|
+
code: import_v418.z.string(),
|
|
3562
|
+
message: import_v418.z.string(),
|
|
3563
|
+
param: import_v418.z.string().nullish()
|
|
3532
3564
|
})
|
|
3533
3565
|
}),
|
|
3534
|
-
|
|
3566
|
+
import_v418.z.object({ type: import_v418.z.string() }).loose().transform((value) => ({
|
|
3535
3567
|
type: "unknown_chunk",
|
|
3536
3568
|
message: value.type
|
|
3537
3569
|
}))
|
|
@@ -3541,202 +3573,203 @@ var openaiResponsesChunkSchema = (0, import_provider_utils24.lazyValidator)(
|
|
|
3541
3573
|
);
|
|
3542
3574
|
var openaiResponsesResponseSchema = (0, import_provider_utils24.lazyValidator)(
|
|
3543
3575
|
() => (0, import_provider_utils24.zodSchema)(
|
|
3544
|
-
|
|
3545
|
-
id:
|
|
3546
|
-
created_at:
|
|
3547
|
-
error:
|
|
3548
|
-
message:
|
|
3549
|
-
type:
|
|
3550
|
-
param:
|
|
3551
|
-
code:
|
|
3576
|
+
import_v418.z.object({
|
|
3577
|
+
id: import_v418.z.string().optional(),
|
|
3578
|
+
created_at: import_v418.z.number().optional(),
|
|
3579
|
+
error: import_v418.z.object({
|
|
3580
|
+
message: import_v418.z.string(),
|
|
3581
|
+
type: import_v418.z.string(),
|
|
3582
|
+
param: import_v418.z.string().nullish(),
|
|
3583
|
+
code: import_v418.z.string()
|
|
3552
3584
|
}).nullish(),
|
|
3553
|
-
model:
|
|
3554
|
-
output:
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
type:
|
|
3558
|
-
role:
|
|
3559
|
-
id:
|
|
3560
|
-
phase:
|
|
3585
|
+
model: import_v418.z.string().optional(),
|
|
3586
|
+
output: import_v418.z.array(
|
|
3587
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3588
|
+
import_v418.z.object({
|
|
3589
|
+
type: import_v418.z.literal("message"),
|
|
3590
|
+
role: import_v418.z.literal("assistant"),
|
|
3591
|
+
id: import_v418.z.string(),
|
|
3592
|
+
phase: import_v418.z.enum(["commentary", "final_answer"]).nullish(),
|
|
3561
3593
|
// the API returns either text or a refusal as content parts:
|
|
3562
|
-
content:
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
type:
|
|
3566
|
-
text:
|
|
3567
|
-
logprobs:
|
|
3568
|
-
|
|
3569
|
-
token:
|
|
3570
|
-
logprob:
|
|
3571
|
-
top_logprobs:
|
|
3572
|
-
|
|
3573
|
-
token:
|
|
3574
|
-
logprob:
|
|
3594
|
+
content: import_v418.z.array(
|
|
3595
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3596
|
+
import_v418.z.object({
|
|
3597
|
+
type: import_v418.z.literal("output_text"),
|
|
3598
|
+
text: import_v418.z.string(),
|
|
3599
|
+
logprobs: import_v418.z.array(
|
|
3600
|
+
import_v418.z.object({
|
|
3601
|
+
token: import_v418.z.string(),
|
|
3602
|
+
logprob: import_v418.z.number(),
|
|
3603
|
+
top_logprobs: import_v418.z.array(
|
|
3604
|
+
import_v418.z.object({
|
|
3605
|
+
token: import_v418.z.string(),
|
|
3606
|
+
logprob: import_v418.z.number()
|
|
3575
3607
|
})
|
|
3576
3608
|
)
|
|
3577
3609
|
})
|
|
3578
3610
|
).nullish(),
|
|
3579
|
-
annotations:
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
type:
|
|
3583
|
-
start_index:
|
|
3584
|
-
end_index:
|
|
3585
|
-
url:
|
|
3586
|
-
title:
|
|
3611
|
+
annotations: import_v418.z.array(
|
|
3612
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3613
|
+
import_v418.z.object({
|
|
3614
|
+
type: import_v418.z.literal("url_citation"),
|
|
3615
|
+
start_index: import_v418.z.number(),
|
|
3616
|
+
end_index: import_v418.z.number(),
|
|
3617
|
+
url: import_v418.z.string(),
|
|
3618
|
+
title: import_v418.z.string()
|
|
3587
3619
|
}),
|
|
3588
|
-
|
|
3589
|
-
type:
|
|
3590
|
-
file_id:
|
|
3591
|
-
filename:
|
|
3592
|
-
index:
|
|
3593
|
-
start_index:
|
|
3594
|
-
end_index:
|
|
3595
|
-
quote:
|
|
3620
|
+
import_v418.z.object({
|
|
3621
|
+
type: import_v418.z.literal("file_citation"),
|
|
3622
|
+
file_id: import_v418.z.string(),
|
|
3623
|
+
filename: import_v418.z.string().nullish(),
|
|
3624
|
+
index: import_v418.z.number().nullish(),
|
|
3625
|
+
start_index: import_v418.z.number().nullish(),
|
|
3626
|
+
end_index: import_v418.z.number().nullish(),
|
|
3627
|
+
quote: import_v418.z.string().nullish()
|
|
3596
3628
|
}),
|
|
3597
|
-
|
|
3598
|
-
type:
|
|
3599
|
-
container_id:
|
|
3600
|
-
file_id:
|
|
3601
|
-
filename:
|
|
3602
|
-
start_index:
|
|
3603
|
-
end_index:
|
|
3604
|
-
index:
|
|
3629
|
+
import_v418.z.object({
|
|
3630
|
+
type: import_v418.z.literal("container_file_citation"),
|
|
3631
|
+
container_id: import_v418.z.string(),
|
|
3632
|
+
file_id: import_v418.z.string(),
|
|
3633
|
+
filename: import_v418.z.string().nullish(),
|
|
3634
|
+
start_index: import_v418.z.number().nullish(),
|
|
3635
|
+
end_index: import_v418.z.number().nullish(),
|
|
3636
|
+
index: import_v418.z.number().nullish()
|
|
3605
3637
|
}),
|
|
3606
|
-
|
|
3607
|
-
type:
|
|
3608
|
-
file_id:
|
|
3609
|
-
index:
|
|
3638
|
+
import_v418.z.object({
|
|
3639
|
+
type: import_v418.z.literal("file_path"),
|
|
3640
|
+
file_id: import_v418.z.string(),
|
|
3641
|
+
index: import_v418.z.number().nullish()
|
|
3610
3642
|
})
|
|
3611
3643
|
])
|
|
3612
3644
|
)
|
|
3613
3645
|
}),
|
|
3614
|
-
|
|
3615
|
-
type:
|
|
3616
|
-
refusal:
|
|
3646
|
+
import_v418.z.object({
|
|
3647
|
+
type: import_v418.z.literal("refusal"),
|
|
3648
|
+
refusal: import_v418.z.string()
|
|
3617
3649
|
})
|
|
3618
3650
|
])
|
|
3619
3651
|
)
|
|
3620
3652
|
}),
|
|
3621
|
-
|
|
3622
|
-
type:
|
|
3623
|
-
id:
|
|
3624
|
-
status:
|
|
3625
|
-
action:
|
|
3626
|
-
|
|
3627
|
-
type:
|
|
3628
|
-
query:
|
|
3629
|
-
sources:
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
type:
|
|
3634
|
-
name:
|
|
3653
|
+
import_v418.z.object({
|
|
3654
|
+
type: import_v418.z.literal("web_search_call"),
|
|
3655
|
+
id: import_v418.z.string(),
|
|
3656
|
+
status: import_v418.z.string(),
|
|
3657
|
+
action: import_v418.z.discriminatedUnion("type", [
|
|
3658
|
+
import_v418.z.object({
|
|
3659
|
+
type: import_v418.z.literal("search"),
|
|
3660
|
+
query: import_v418.z.string().nullish(),
|
|
3661
|
+
sources: import_v418.z.array(
|
|
3662
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3663
|
+
import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
|
|
3664
|
+
import_v418.z.object({
|
|
3665
|
+
type: import_v418.z.literal("api"),
|
|
3666
|
+
name: import_v418.z.string()
|
|
3635
3667
|
})
|
|
3636
3668
|
])
|
|
3637
3669
|
).nullish()
|
|
3638
3670
|
}),
|
|
3639
|
-
|
|
3640
|
-
type:
|
|
3641
|
-
url:
|
|
3671
|
+
import_v418.z.object({
|
|
3672
|
+
type: import_v418.z.literal("open_page"),
|
|
3673
|
+
url: import_v418.z.string().nullish()
|
|
3642
3674
|
}),
|
|
3643
|
-
|
|
3644
|
-
type:
|
|
3645
|
-
url:
|
|
3646
|
-
pattern:
|
|
3675
|
+
import_v418.z.object({
|
|
3676
|
+
type: import_v418.z.literal("find_in_page"),
|
|
3677
|
+
url: import_v418.z.string().nullish(),
|
|
3678
|
+
pattern: import_v418.z.string().nullish()
|
|
3647
3679
|
})
|
|
3648
3680
|
]).nullish()
|
|
3649
3681
|
}),
|
|
3650
|
-
|
|
3651
|
-
type:
|
|
3652
|
-
id:
|
|
3653
|
-
queries:
|
|
3654
|
-
results:
|
|
3655
|
-
|
|
3656
|
-
attributes:
|
|
3657
|
-
|
|
3658
|
-
|
|
3682
|
+
import_v418.z.object({
|
|
3683
|
+
type: import_v418.z.literal("file_search_call"),
|
|
3684
|
+
id: import_v418.z.string(),
|
|
3685
|
+
queries: import_v418.z.array(import_v418.z.string()),
|
|
3686
|
+
results: import_v418.z.array(
|
|
3687
|
+
import_v418.z.object({
|
|
3688
|
+
attributes: import_v418.z.record(
|
|
3689
|
+
import_v418.z.string(),
|
|
3690
|
+
import_v418.z.union([import_v418.z.string(), import_v418.z.number(), import_v418.z.boolean()])
|
|
3659
3691
|
),
|
|
3660
|
-
file_id:
|
|
3661
|
-
filename:
|
|
3662
|
-
score:
|
|
3663
|
-
text:
|
|
3692
|
+
file_id: import_v418.z.string(),
|
|
3693
|
+
filename: import_v418.z.string(),
|
|
3694
|
+
score: import_v418.z.number(),
|
|
3695
|
+
text: import_v418.z.string()
|
|
3664
3696
|
})
|
|
3665
3697
|
).nullish()
|
|
3666
3698
|
}),
|
|
3667
|
-
|
|
3668
|
-
type:
|
|
3669
|
-
id:
|
|
3670
|
-
code:
|
|
3671
|
-
container_id:
|
|
3672
|
-
outputs:
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3699
|
+
import_v418.z.object({
|
|
3700
|
+
type: import_v418.z.literal("code_interpreter_call"),
|
|
3701
|
+
id: import_v418.z.string(),
|
|
3702
|
+
code: import_v418.z.string().nullable(),
|
|
3703
|
+
container_id: import_v418.z.string(),
|
|
3704
|
+
outputs: import_v418.z.array(
|
|
3705
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3706
|
+
import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
|
|
3707
|
+
import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
|
|
3676
3708
|
])
|
|
3677
3709
|
).nullable()
|
|
3678
3710
|
}),
|
|
3679
|
-
|
|
3680
|
-
type:
|
|
3681
|
-
id:
|
|
3682
|
-
result:
|
|
3711
|
+
import_v418.z.object({
|
|
3712
|
+
type: import_v418.z.literal("image_generation_call"),
|
|
3713
|
+
id: import_v418.z.string(),
|
|
3714
|
+
result: import_v418.z.string()
|
|
3683
3715
|
}),
|
|
3684
|
-
|
|
3685
|
-
type:
|
|
3686
|
-
id:
|
|
3687
|
-
call_id:
|
|
3688
|
-
action:
|
|
3689
|
-
type:
|
|
3690
|
-
command:
|
|
3691
|
-
timeout_ms:
|
|
3692
|
-
user:
|
|
3693
|
-
working_directory:
|
|
3694
|
-
env:
|
|
3716
|
+
import_v418.z.object({
|
|
3717
|
+
type: import_v418.z.literal("local_shell_call"),
|
|
3718
|
+
id: import_v418.z.string(),
|
|
3719
|
+
call_id: import_v418.z.string(),
|
|
3720
|
+
action: import_v418.z.object({
|
|
3721
|
+
type: import_v418.z.literal("exec"),
|
|
3722
|
+
command: import_v418.z.array(import_v418.z.string()),
|
|
3723
|
+
timeout_ms: import_v418.z.number().optional(),
|
|
3724
|
+
user: import_v418.z.string().optional(),
|
|
3725
|
+
working_directory: import_v418.z.string().optional(),
|
|
3726
|
+
env: import_v418.z.record(import_v418.z.string(), import_v418.z.string()).optional()
|
|
3695
3727
|
})
|
|
3696
3728
|
}),
|
|
3697
|
-
|
|
3698
|
-
type:
|
|
3699
|
-
call_id:
|
|
3700
|
-
name:
|
|
3701
|
-
arguments:
|
|
3702
|
-
id:
|
|
3703
|
-
async:
|
|
3729
|
+
import_v418.z.object({
|
|
3730
|
+
type: import_v418.z.literal("function_call"),
|
|
3731
|
+
call_id: import_v418.z.string(),
|
|
3732
|
+
name: import_v418.z.string(),
|
|
3733
|
+
arguments: import_v418.z.string(),
|
|
3734
|
+
id: import_v418.z.string(),
|
|
3735
|
+
async: import_v418.z.boolean().nullish()
|
|
3704
3736
|
}),
|
|
3705
|
-
|
|
3706
|
-
type:
|
|
3707
|
-
id:
|
|
3708
|
-
status:
|
|
3737
|
+
import_v418.z.object({
|
|
3738
|
+
type: import_v418.z.literal("computer_call"),
|
|
3739
|
+
id: import_v418.z.string(),
|
|
3740
|
+
status: import_v418.z.string().optional()
|
|
3709
3741
|
}),
|
|
3710
|
-
|
|
3711
|
-
type:
|
|
3712
|
-
id:
|
|
3713
|
-
encrypted_content:
|
|
3714
|
-
summary:
|
|
3715
|
-
|
|
3716
|
-
type:
|
|
3717
|
-
text:
|
|
3742
|
+
import_v418.z.object({
|
|
3743
|
+
type: import_v418.z.literal("reasoning"),
|
|
3744
|
+
id: import_v418.z.string(),
|
|
3745
|
+
encrypted_content: import_v418.z.string().nullish(),
|
|
3746
|
+
summary: import_v418.z.array(
|
|
3747
|
+
import_v418.z.object({
|
|
3748
|
+
type: import_v418.z.literal("summary_text"),
|
|
3749
|
+
text: import_v418.z.string()
|
|
3718
3750
|
})
|
|
3719
3751
|
)
|
|
3720
3752
|
})
|
|
3721
3753
|
])
|
|
3722
3754
|
).optional(),
|
|
3723
|
-
service_tier:
|
|
3724
|
-
|
|
3725
|
-
|
|
3755
|
+
service_tier: import_v418.z.string().nullish(),
|
|
3756
|
+
prompt_cache_diagnostics: openaiResponsesPromptCacheDiagnosticsSchema().nullish(),
|
|
3757
|
+
reasoning: import_v418.z.object({
|
|
3758
|
+
context: import_v418.z.string().nullish()
|
|
3726
3759
|
}).nullish(),
|
|
3727
|
-
incomplete_details:
|
|
3728
|
-
usage:
|
|
3729
|
-
input_tokens:
|
|
3730
|
-
input_tokens_details:
|
|
3731
|
-
cached_tokens:
|
|
3732
|
-
cache_write_tokens:
|
|
3733
|
-
orchestration_input_tokens:
|
|
3734
|
-
orchestration_input_cached_tokens:
|
|
3760
|
+
incomplete_details: import_v418.z.object({ reason: import_v418.z.string() }).nullish(),
|
|
3761
|
+
usage: import_v418.z.object({
|
|
3762
|
+
input_tokens: import_v418.z.number(),
|
|
3763
|
+
input_tokens_details: import_v418.z.object({
|
|
3764
|
+
cached_tokens: import_v418.z.number().nullish(),
|
|
3765
|
+
cache_write_tokens: import_v418.z.number().nullish(),
|
|
3766
|
+
orchestration_input_tokens: import_v418.z.number().nullish(),
|
|
3767
|
+
orchestration_input_cached_tokens: import_v418.z.number().nullish()
|
|
3735
3768
|
}).nullish(),
|
|
3736
|
-
output_tokens:
|
|
3737
|
-
output_tokens_details:
|
|
3738
|
-
reasoning_tokens:
|
|
3739
|
-
orchestration_output_tokens:
|
|
3769
|
+
output_tokens: import_v418.z.number(),
|
|
3770
|
+
output_tokens_details: import_v418.z.object({
|
|
3771
|
+
reasoning_tokens: import_v418.z.number().nullish(),
|
|
3772
|
+
orchestration_output_tokens: import_v418.z.number().nullish()
|
|
3740
3773
|
}).nullish()
|
|
3741
3774
|
}).optional()
|
|
3742
3775
|
})
|
|
@@ -3748,22 +3781,22 @@ var import_provider7 = require("@ai-sdk/provider");
|
|
|
3748
3781
|
|
|
3749
3782
|
// src/tool/code-interpreter.ts
|
|
3750
3783
|
var import_provider_utils25 = require("@ai-sdk/provider-utils");
|
|
3751
|
-
var
|
|
3784
|
+
var import_v419 = require("zod/v4");
|
|
3752
3785
|
var codeInterpreterInputSchema = (0, import_provider_utils25.lazySchema)(
|
|
3753
3786
|
() => (0, import_provider_utils25.zodSchema)(
|
|
3754
|
-
|
|
3755
|
-
code:
|
|
3756
|
-
containerId:
|
|
3787
|
+
import_v419.z.object({
|
|
3788
|
+
code: import_v419.z.string().nullish(),
|
|
3789
|
+
containerId: import_v419.z.string()
|
|
3757
3790
|
})
|
|
3758
3791
|
)
|
|
3759
3792
|
);
|
|
3760
3793
|
var codeInterpreterOutputSchema = (0, import_provider_utils25.lazySchema)(
|
|
3761
3794
|
() => (0, import_provider_utils25.zodSchema)(
|
|
3762
|
-
|
|
3763
|
-
outputs:
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3795
|
+
import_v419.z.object({
|
|
3796
|
+
outputs: import_v419.z.array(
|
|
3797
|
+
import_v419.z.discriminatedUnion("type", [
|
|
3798
|
+
import_v419.z.object({ type: import_v419.z.literal("logs"), logs: import_v419.z.string() }),
|
|
3799
|
+
import_v419.z.object({ type: import_v419.z.literal("image"), url: import_v419.z.string() })
|
|
3767
3800
|
])
|
|
3768
3801
|
).nullish()
|
|
3769
3802
|
})
|
|
@@ -3771,11 +3804,11 @@ var codeInterpreterOutputSchema = (0, import_provider_utils25.lazySchema)(
|
|
|
3771
3804
|
);
|
|
3772
3805
|
var codeInterpreterArgsSchema = (0, import_provider_utils25.lazySchema)(
|
|
3773
3806
|
() => (0, import_provider_utils25.zodSchema)(
|
|
3774
|
-
|
|
3775
|
-
container:
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
fileIds:
|
|
3807
|
+
import_v419.z.object({
|
|
3808
|
+
container: import_v419.z.union([
|
|
3809
|
+
import_v419.z.string(),
|
|
3810
|
+
import_v419.z.object({
|
|
3811
|
+
fileIds: import_v419.z.array(import_v419.z.string()).optional()
|
|
3779
3812
|
})
|
|
3780
3813
|
]).optional()
|
|
3781
3814
|
})
|
|
@@ -3793,43 +3826,43 @@ var codeInterpreter = (args = {}) => {
|
|
|
3793
3826
|
|
|
3794
3827
|
// src/tool/file-search.ts
|
|
3795
3828
|
var import_provider_utils26 = require("@ai-sdk/provider-utils");
|
|
3796
|
-
var
|
|
3797
|
-
var comparisonFilterSchema = () =>
|
|
3798
|
-
key:
|
|
3799
|
-
type:
|
|
3800
|
-
value:
|
|
3829
|
+
var import_v420 = require("zod/v4");
|
|
3830
|
+
var comparisonFilterSchema = () => import_v420.z.object({
|
|
3831
|
+
key: import_v420.z.string(),
|
|
3832
|
+
type: import_v420.z.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
3833
|
+
value: import_v420.z.union([import_v420.z.string(), import_v420.z.number(), import_v420.z.boolean(), import_v420.z.array(import_v420.z.string())])
|
|
3801
3834
|
});
|
|
3802
3835
|
var cachedCompoundFilterSchema;
|
|
3803
|
-
var compoundFilterSchema = () => cachedCompoundFilterSchema != null ? cachedCompoundFilterSchema : cachedCompoundFilterSchema =
|
|
3804
|
-
type:
|
|
3805
|
-
filters:
|
|
3806
|
-
|
|
3836
|
+
var compoundFilterSchema = () => cachedCompoundFilterSchema != null ? cachedCompoundFilterSchema : cachedCompoundFilterSchema = import_v420.z.object({
|
|
3837
|
+
type: import_v420.z.enum(["and", "or"]),
|
|
3838
|
+
filters: import_v420.z.array(
|
|
3839
|
+
import_v420.z.union([comparisonFilterSchema(), import_v420.z.lazy(() => compoundFilterSchema())])
|
|
3807
3840
|
)
|
|
3808
3841
|
});
|
|
3809
3842
|
var fileSearchArgsSchema = (0, import_provider_utils26.lazySchema)(
|
|
3810
3843
|
() => (0, import_provider_utils26.zodSchema)(
|
|
3811
|
-
|
|
3812
|
-
vectorStoreIds:
|
|
3813
|
-
maxNumResults:
|
|
3814
|
-
ranking:
|
|
3815
|
-
ranker:
|
|
3816
|
-
scoreThreshold:
|
|
3844
|
+
import_v420.z.object({
|
|
3845
|
+
vectorStoreIds: import_v420.z.array(import_v420.z.string()),
|
|
3846
|
+
maxNumResults: import_v420.z.number().optional(),
|
|
3847
|
+
ranking: import_v420.z.object({
|
|
3848
|
+
ranker: import_v420.z.string().optional(),
|
|
3849
|
+
scoreThreshold: import_v420.z.number().optional()
|
|
3817
3850
|
}).optional(),
|
|
3818
|
-
filters:
|
|
3851
|
+
filters: import_v420.z.union([comparisonFilterSchema(), compoundFilterSchema()]).optional()
|
|
3819
3852
|
})
|
|
3820
3853
|
)
|
|
3821
3854
|
);
|
|
3822
3855
|
var fileSearchOutputSchema = (0, import_provider_utils26.lazySchema)(
|
|
3823
3856
|
() => (0, import_provider_utils26.zodSchema)(
|
|
3824
|
-
|
|
3825
|
-
queries:
|
|
3826
|
-
results:
|
|
3827
|
-
|
|
3828
|
-
attributes:
|
|
3829
|
-
fileId:
|
|
3830
|
-
filename:
|
|
3831
|
-
score:
|
|
3832
|
-
text:
|
|
3857
|
+
import_v420.z.object({
|
|
3858
|
+
queries: import_v420.z.array(import_v420.z.string()),
|
|
3859
|
+
results: import_v420.z.array(
|
|
3860
|
+
import_v420.z.object({
|
|
3861
|
+
attributes: import_v420.z.record(import_v420.z.string(), import_v420.z.unknown()),
|
|
3862
|
+
fileId: import_v420.z.string(),
|
|
3863
|
+
filename: import_v420.z.string(),
|
|
3864
|
+
score: import_v420.z.number(),
|
|
3865
|
+
text: import_v420.z.string()
|
|
3833
3866
|
})
|
|
3834
3867
|
).nullable()
|
|
3835
3868
|
})
|
|
@@ -3838,46 +3871,46 @@ var fileSearchOutputSchema = (0, import_provider_utils26.lazySchema)(
|
|
|
3838
3871
|
var fileSearch = (0, import_provider_utils26.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
3839
3872
|
id: "openai.file_search",
|
|
3840
3873
|
name: "file_search",
|
|
3841
|
-
inputSchema:
|
|
3874
|
+
inputSchema: import_v420.z.object({}),
|
|
3842
3875
|
outputSchema: fileSearchOutputSchema
|
|
3843
3876
|
});
|
|
3844
3877
|
|
|
3845
3878
|
// src/tool/web-search-preview.ts
|
|
3846
3879
|
var import_provider_utils27 = require("@ai-sdk/provider-utils");
|
|
3847
|
-
var
|
|
3880
|
+
var import_v421 = require("zod/v4");
|
|
3848
3881
|
var webSearchPreviewArgsSchema = (0, import_provider_utils27.lazySchema)(
|
|
3849
3882
|
() => (0, import_provider_utils27.zodSchema)(
|
|
3850
|
-
|
|
3851
|
-
searchContextSize:
|
|
3852
|
-
userLocation:
|
|
3853
|
-
type:
|
|
3854
|
-
country:
|
|
3855
|
-
city:
|
|
3856
|
-
region:
|
|
3857
|
-
timezone:
|
|
3883
|
+
import_v421.z.object({
|
|
3884
|
+
searchContextSize: import_v421.z.enum(["low", "medium", "high"]).optional(),
|
|
3885
|
+
userLocation: import_v421.z.object({
|
|
3886
|
+
type: import_v421.z.literal("approximate"),
|
|
3887
|
+
country: import_v421.z.string().optional(),
|
|
3888
|
+
city: import_v421.z.string().optional(),
|
|
3889
|
+
region: import_v421.z.string().optional(),
|
|
3890
|
+
timezone: import_v421.z.string().optional()
|
|
3858
3891
|
}).optional()
|
|
3859
3892
|
})
|
|
3860
3893
|
)
|
|
3861
3894
|
);
|
|
3862
3895
|
var webSearchPreviewInputSchema = (0, import_provider_utils27.lazySchema)(
|
|
3863
|
-
() => (0, import_provider_utils27.zodSchema)(
|
|
3896
|
+
() => (0, import_provider_utils27.zodSchema)(import_v421.z.object({}))
|
|
3864
3897
|
);
|
|
3865
3898
|
var webSearchPreviewOutputSchema = (0, import_provider_utils27.lazySchema)(
|
|
3866
3899
|
() => (0, import_provider_utils27.zodSchema)(
|
|
3867
|
-
|
|
3868
|
-
action:
|
|
3869
|
-
|
|
3870
|
-
type:
|
|
3871
|
-
query:
|
|
3900
|
+
import_v421.z.object({
|
|
3901
|
+
action: import_v421.z.discriminatedUnion("type", [
|
|
3902
|
+
import_v421.z.object({
|
|
3903
|
+
type: import_v421.z.literal("search"),
|
|
3904
|
+
query: import_v421.z.string().optional()
|
|
3872
3905
|
}),
|
|
3873
|
-
|
|
3874
|
-
type:
|
|
3875
|
-
url:
|
|
3906
|
+
import_v421.z.object({
|
|
3907
|
+
type: import_v421.z.literal("openPage"),
|
|
3908
|
+
url: import_v421.z.string().nullish()
|
|
3876
3909
|
}),
|
|
3877
|
-
|
|
3878
|
-
type:
|
|
3879
|
-
url:
|
|
3880
|
-
pattern:
|
|
3910
|
+
import_v421.z.object({
|
|
3911
|
+
type: import_v421.z.literal("findInPage"),
|
|
3912
|
+
url: import_v421.z.string().nullish(),
|
|
3913
|
+
pattern: import_v421.z.string().nullish()
|
|
3881
3914
|
})
|
|
3882
3915
|
]).optional()
|
|
3883
3916
|
})
|
|
@@ -3892,29 +3925,29 @@ var webSearchPreview = (0, import_provider_utils27.createProviderDefinedToolFact
|
|
|
3892
3925
|
|
|
3893
3926
|
// src/tool/image-generation.ts
|
|
3894
3927
|
var import_provider_utils28 = require("@ai-sdk/provider-utils");
|
|
3895
|
-
var
|
|
3928
|
+
var import_v422 = require("zod/v4");
|
|
3896
3929
|
var imageGenerationArgsSchema = (0, import_provider_utils28.lazySchema)(
|
|
3897
3930
|
() => (0, import_provider_utils28.zodSchema)(
|
|
3898
|
-
|
|
3899
|
-
background:
|
|
3900
|
-
inputFidelity:
|
|
3901
|
-
inputImageMask:
|
|
3902
|
-
fileId:
|
|
3903
|
-
imageUrl:
|
|
3931
|
+
import_v422.z.object({
|
|
3932
|
+
background: import_v422.z.enum(["auto", "opaque", "transparent"]).optional(),
|
|
3933
|
+
inputFidelity: import_v422.z.enum(["low", "high"]).optional(),
|
|
3934
|
+
inputImageMask: import_v422.z.object({
|
|
3935
|
+
fileId: import_v422.z.string().optional(),
|
|
3936
|
+
imageUrl: import_v422.z.string().optional()
|
|
3904
3937
|
}).optional(),
|
|
3905
|
-
model:
|
|
3906
|
-
moderation:
|
|
3907
|
-
outputCompression:
|
|
3908
|
-
outputFormat:
|
|
3909
|
-
partialImages:
|
|
3910
|
-
quality:
|
|
3911
|
-
size:
|
|
3938
|
+
model: import_v422.z.string().optional(),
|
|
3939
|
+
moderation: import_v422.z.enum(["auto"]).optional(),
|
|
3940
|
+
outputCompression: import_v422.z.number().int().min(0).max(100).optional(),
|
|
3941
|
+
outputFormat: import_v422.z.enum(["png", "jpeg", "webp"]).optional(),
|
|
3942
|
+
partialImages: import_v422.z.number().int().min(0).max(3).optional(),
|
|
3943
|
+
quality: import_v422.z.enum(["auto", "low", "medium", "high"]).optional(),
|
|
3944
|
+
size: import_v422.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
3912
3945
|
}).strict()
|
|
3913
3946
|
)
|
|
3914
3947
|
);
|
|
3915
|
-
var imageGenerationInputSchema = (0, import_provider_utils28.lazySchema)(() => (0, import_provider_utils28.zodSchema)(
|
|
3948
|
+
var imageGenerationInputSchema = (0, import_provider_utils28.lazySchema)(() => (0, import_provider_utils28.zodSchema)(import_v422.z.object({})));
|
|
3916
3949
|
var imageGenerationOutputSchema = (0, import_provider_utils28.lazySchema)(
|
|
3917
|
-
() => (0, import_provider_utils28.zodSchema)(
|
|
3950
|
+
() => (0, import_provider_utils28.zodSchema)(import_v422.z.object({ result: import_v422.z.string() }))
|
|
3918
3951
|
);
|
|
3919
3952
|
var imageGenerationToolFactory = (0, import_provider_utils28.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
3920
3953
|
id: "openai.image_generation",
|
|
@@ -4102,10 +4135,10 @@ function getConfigurationUpdateUnsupportedReason({
|
|
|
4102
4135
|
options
|
|
4103
4136
|
}) {
|
|
4104
4137
|
if (!modelCapabilities.supportsConfigurationUpdate) {
|
|
4105
|
-
return "
|
|
4138
|
+
return "Configuration updates are only supported by GPT-6 and later models";
|
|
4106
4139
|
}
|
|
4107
4140
|
if ((options == null ? void 0 : options.reasoningMode) === "pro" || (options == null ? void 0 : options.truncation) === "auto") {
|
|
4108
|
-
return "
|
|
4141
|
+
return "Configuration updates require standard reasoning mode without automatic truncation";
|
|
4109
4142
|
}
|
|
4110
4143
|
return void 0;
|
|
4111
4144
|
}
|
|
@@ -4137,7 +4170,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4137
4170
|
toolChoice,
|
|
4138
4171
|
responseFormat
|
|
4139
4172
|
}) {
|
|
4140
|
-
var _a2, _b, _c, _d, _e, _f;
|
|
4173
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
|
4141
4174
|
const warnings = [];
|
|
4142
4175
|
const modelCapabilities = getOpenAILanguageModelCapabilities(this.modelId);
|
|
4143
4176
|
if (topK != null) {
|
|
@@ -4213,7 +4246,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4213
4246
|
});
|
|
4214
4247
|
} else if (reasoningEffortUpdate != null) {
|
|
4215
4248
|
const firstItem = input[0];
|
|
4216
|
-
if ((firstItem == null ? void 0 : firstItem.type) !== "configuration_update" || firstItem.reasoning.effort !== reasoningEffortUpdate) {
|
|
4249
|
+
if ((firstItem == null ? void 0 : firstItem.type) !== "configuration_update" || ((_c = firstItem.reasoning) == null ? void 0 : _c.effort) !== reasoningEffortUpdate) {
|
|
4217
4250
|
input.unshift({
|
|
4218
4251
|
type: "configuration_update",
|
|
4219
4252
|
reasoning: { effort: reasoningEffortUpdate }
|
|
@@ -4223,11 +4256,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4223
4256
|
for (let i = 1; i < input.length; i++) {
|
|
4224
4257
|
if (input[i - 1].type === "configuration_update" && input[i].type === "configuration_update") {
|
|
4225
4258
|
throw new import_provider8.UnsupportedFunctionalityError({
|
|
4226
|
-
functionality: "Adjacent
|
|
4259
|
+
functionality: "Adjacent configuration updates",
|
|
4260
|
+
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."
|
|
4227
4261
|
});
|
|
4228
4262
|
}
|
|
4229
4263
|
}
|
|
4230
|
-
const strictJsonSchema = (
|
|
4264
|
+
const strictJsonSchema = (_d = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _d : false;
|
|
4265
|
+
const requestTextFormat = openaiOptions == null ? void 0 : openaiOptions.textFormat;
|
|
4231
4266
|
let include = openaiOptions == null ? void 0 : openaiOptions.include;
|
|
4232
4267
|
function addInclude(key) {
|
|
4233
4268
|
if (include == null) {
|
|
@@ -4261,13 +4296,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4261
4296
|
temperature,
|
|
4262
4297
|
top_p: topP,
|
|
4263
4298
|
max_output_tokens: maxOutputTokens,
|
|
4264
|
-
...((responseFormat == null ? void 0 : responseFormat.type) === "json" || (openaiOptions == null ? void 0 : openaiOptions.textVerbosity)) && {
|
|
4299
|
+
...((responseFormat == null ? void 0 : responseFormat.type) === "json" || requestTextFormat != null || (openaiOptions == null ? void 0 : openaiOptions.textVerbosity)) && {
|
|
4265
4300
|
text: {
|
|
4266
|
-
...(responseFormat == null ? void 0 : responseFormat.type) === "json" && {
|
|
4301
|
+
...requestTextFormat != null ? { format: requestTextFormat } : (responseFormat == null ? void 0 : responseFormat.type) === "json" && {
|
|
4267
4302
|
format: responseFormat.schema != null ? {
|
|
4268
4303
|
type: "json_schema",
|
|
4269
4304
|
strict: strictJsonSchema,
|
|
4270
|
-
name: (
|
|
4305
|
+
name: (_e = responseFormat.name) != null ? _e : "response",
|
|
4271
4306
|
description: responseFormat.description,
|
|
4272
4307
|
schema: responseFormat.schema
|
|
4273
4308
|
} : { type: "json_object" }
|
|
@@ -4289,7 +4324,11 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4289
4324
|
service_tier: openaiOptions == null ? void 0 : openaiOptions.serviceTier,
|
|
4290
4325
|
include,
|
|
4291
4326
|
prompt_cache_key: openaiOptions == null ? void 0 : openaiOptions.promptCacheKey,
|
|
4292
|
-
prompt_cache_options: openaiOptions == null ? void 0 : openaiOptions.promptCacheOptions
|
|
4327
|
+
prompt_cache_options: (openaiOptions == null ? void 0 : openaiOptions.promptCacheOptions) && {
|
|
4328
|
+
mode: openaiOptions.promptCacheOptions.mode,
|
|
4329
|
+
ttl: openaiOptions.promptCacheOptions.ttl,
|
|
4330
|
+
comparison_response_id: openaiOptions.promptCacheOptions.comparisonResponseId
|
|
4331
|
+
},
|
|
4293
4332
|
prompt_cache_retention: openaiOptions == null ? void 0 : openaiOptions.promptCacheRetention,
|
|
4294
4333
|
safety_identifier: openaiOptions == null ? void 0 : openaiOptions.safetyIdentifier,
|
|
4295
4334
|
top_logprobs: topLogprobs,
|
|
@@ -4338,9 +4377,9 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4338
4377
|
details: "topP is not supported for reasoning models"
|
|
4339
4378
|
});
|
|
4340
4379
|
}
|
|
4341
|
-
if (modelCapabilities.supportedReasoningEfforts != null && (baseArgs.top_logprobs != null || ((
|
|
4380
|
+
if (modelCapabilities.supportedReasoningEfforts != null && (baseArgs.top_logprobs != null || ((_f = baseArgs.include) == null ? void 0 : _f.includes("message.output_text.logprobs")))) {
|
|
4342
4381
|
baseArgs.top_logprobs = void 0;
|
|
4343
|
-
const filteredInclude = (
|
|
4382
|
+
const filteredInclude = (_g = baseArgs.include) == null ? void 0 : _g.filter(
|
|
4344
4383
|
(value) => value !== "message.output_text.logprobs"
|
|
4345
4384
|
);
|
|
4346
4385
|
baseArgs.include = filteredInclude != null && filteredInclude.length > 0 ? filteredInclude : void 0;
|
|
@@ -4716,6 +4755,9 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4716
4755
|
if (logprobs.length > 0) {
|
|
4717
4756
|
providerMetadata[providerKey].logprobs = logprobs;
|
|
4718
4757
|
}
|
|
4758
|
+
if (response.prompt_cache_diagnostics != null) {
|
|
4759
|
+
providerMetadata[providerKey].promptCacheDiagnostics = response.prompt_cache_diagnostics;
|
|
4760
|
+
}
|
|
4719
4761
|
if (typeof response.service_tier === "string") {
|
|
4720
4762
|
providerMetadata[providerKey].serviceTier = response.service_tier;
|
|
4721
4763
|
}
|
|
@@ -4795,6 +4837,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4795
4837
|
const activeReasoning = {};
|
|
4796
4838
|
let serviceTier;
|
|
4797
4839
|
let reasoningContext;
|
|
4840
|
+
let promptCacheDiagnostics;
|
|
4798
4841
|
let responsesUsage;
|
|
4799
4842
|
return {
|
|
4800
4843
|
stream: response.pipeThrough(
|
|
@@ -4803,7 +4846,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4803
4846
|
controller.enqueue({ type: "stream-start", warnings });
|
|
4804
4847
|
},
|
|
4805
4848
|
transform(chunk, controller) {
|
|
4806
|
-
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;
|
|
4849
|
+
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;
|
|
4807
4850
|
if (options.includeRawChunks) {
|
|
4808
4851
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
4809
4852
|
}
|
|
@@ -5196,20 +5239,21 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5196
5239
|
activeReasoning[value.item_id].summaryParts[value.summary_index] = "can-conclude";
|
|
5197
5240
|
}
|
|
5198
5241
|
} else if (isResponseFinishedChunk(value)) {
|
|
5242
|
+
promptCacheDiagnostics = (_k = value.response.prompt_cache_diagnostics) != null ? _k : void 0;
|
|
5199
5243
|
finishReason = mapOpenAIResponseFinishReason({
|
|
5200
|
-
finishReason: (
|
|
5244
|
+
finishReason: (_l = value.response.incomplete_details) == null ? void 0 : _l.reason,
|
|
5201
5245
|
hasFunctionCall,
|
|
5202
5246
|
hasRefusal
|
|
5203
5247
|
});
|
|
5204
5248
|
usage.inputTokens = value.response.usage.input_tokens;
|
|
5205
5249
|
usage.outputTokens = value.response.usage.output_tokens;
|
|
5206
5250
|
usage.totalTokens = value.response.usage.input_tokens + value.response.usage.output_tokens;
|
|
5207
|
-
usage.reasoningTokens = (
|
|
5208
|
-
usage.cachedInputTokens = (
|
|
5251
|
+
usage.reasoningTokens = (_n = (_m = value.response.usage.output_tokens_details) == null ? void 0 : _m.reasoning_tokens) != null ? _n : void 0;
|
|
5252
|
+
usage.cachedInputTokens = (_p = (_o = value.response.usage.input_tokens_details) == null ? void 0 : _o.cached_tokens) != null ? _p : void 0;
|
|
5209
5253
|
if (typeof value.response.service_tier === "string") {
|
|
5210
5254
|
serviceTier = value.response.service_tier;
|
|
5211
5255
|
}
|
|
5212
|
-
if (((
|
|
5256
|
+
if (((_q = value.response.reasoning) == null ? void 0 : _q.context) != null) {
|
|
5213
5257
|
reasoningContext = value.response.reasoning.context;
|
|
5214
5258
|
}
|
|
5215
5259
|
responsesUsage = getResponsesUsageMetadata(value.response.usage);
|
|
@@ -5219,7 +5263,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5219
5263
|
controller.enqueue({
|
|
5220
5264
|
type: "source",
|
|
5221
5265
|
sourceType: "url",
|
|
5222
|
-
id: (
|
|
5266
|
+
id: (_t = (_s = (_r = self.config).generateId) == null ? void 0 : _s.call(_r)) != null ? _t : (0, import_provider_utils30.generateId)(),
|
|
5223
5267
|
url: value.annotation.url,
|
|
5224
5268
|
title: value.annotation.title
|
|
5225
5269
|
});
|
|
@@ -5227,10 +5271,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5227
5271
|
controller.enqueue({
|
|
5228
5272
|
type: "source",
|
|
5229
5273
|
sourceType: "document",
|
|
5230
|
-
id: (
|
|
5274
|
+
id: (_w = (_v = (_u = self.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : (0, import_provider_utils30.generateId)(),
|
|
5231
5275
|
mediaType: "text/plain",
|
|
5232
|
-
title: (
|
|
5233
|
-
filename: (
|
|
5276
|
+
title: (_y = (_x = value.annotation.quote) != null ? _x : value.annotation.filename) != null ? _y : "Document",
|
|
5277
|
+
filename: (_z = value.annotation.filename) != null ? _z : value.annotation.file_id,
|
|
5234
5278
|
...value.annotation.file_id ? {
|
|
5235
5279
|
providerMetadata: {
|
|
5236
5280
|
[providerKey]: {
|
|
@@ -5259,6 +5303,9 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5259
5303
|
if (reasoningContext !== void 0) {
|
|
5260
5304
|
providerMetadata[providerKey].reasoningContext = reasoningContext;
|
|
5261
5305
|
}
|
|
5306
|
+
if (promptCacheDiagnostics !== void 0) {
|
|
5307
|
+
providerMetadata[providerKey].promptCacheDiagnostics = promptCacheDiagnostics;
|
|
5308
|
+
}
|
|
5262
5309
|
if (responsesUsage != null) {
|
|
5263
5310
|
providerMetadata[providerKey].usage = responsesUsage;
|
|
5264
5311
|
}
|