@ai-sdk/openai 2.0.129 → 2.0.130
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 +6 -0
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +647 -574
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +647 -573
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +658 -587
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +657 -585
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2357,8 +2357,211 @@ var import_provider_utils25 = require("@ai-sdk/provider-utils");
|
|
|
2357
2357
|
|
|
2358
2358
|
// src/responses/convert-to-openai-responses-input.ts
|
|
2359
2359
|
var import_provider6 = require("@ai-sdk/provider");
|
|
2360
|
+
var import_provider_utils22 = require("@ai-sdk/provider-utils");
|
|
2361
|
+
var import_v417 = require("zod/v4");
|
|
2362
|
+
|
|
2363
|
+
// src/responses/openai-responses-options.ts
|
|
2360
2364
|
var import_provider_utils21 = require("@ai-sdk/provider-utils");
|
|
2361
2365
|
var import_v416 = require("zod/v4");
|
|
2366
|
+
var TOP_LOGPROBS_MAX = 20;
|
|
2367
|
+
var openaiResponsesReasoningModelIds = [
|
|
2368
|
+
"o1",
|
|
2369
|
+
"o1-2024-12-17",
|
|
2370
|
+
"o3",
|
|
2371
|
+
"o3-2025-04-16",
|
|
2372
|
+
"o3-deep-research",
|
|
2373
|
+
"o3-deep-research-2025-06-26",
|
|
2374
|
+
"o3-mini",
|
|
2375
|
+
"o3-mini-2025-01-31",
|
|
2376
|
+
"o4-mini",
|
|
2377
|
+
"o4-mini-2025-04-16",
|
|
2378
|
+
"o4-mini-deep-research",
|
|
2379
|
+
"o4-mini-deep-research-2025-06-26",
|
|
2380
|
+
"codex-mini-latest",
|
|
2381
|
+
"computer-use-preview",
|
|
2382
|
+
"gpt-5",
|
|
2383
|
+
"gpt-5-2025-08-07",
|
|
2384
|
+
"gpt-5-codex",
|
|
2385
|
+
"gpt-5-mini",
|
|
2386
|
+
"gpt-5-mini-2025-08-07",
|
|
2387
|
+
"gpt-5-nano",
|
|
2388
|
+
"gpt-5-nano-2025-08-07",
|
|
2389
|
+
"gpt-5-pro",
|
|
2390
|
+
"gpt-5-pro-2025-10-06",
|
|
2391
|
+
"gpt-5.1",
|
|
2392
|
+
"gpt-5.1-chat-latest",
|
|
2393
|
+
"gpt-5.1-codex-mini",
|
|
2394
|
+
"gpt-5.1-codex",
|
|
2395
|
+
"gpt-5.1-codex-max",
|
|
2396
|
+
"gpt-5.2",
|
|
2397
|
+
"gpt-5.2-chat-latest",
|
|
2398
|
+
"gpt-5.2-pro",
|
|
2399
|
+
"gpt-5.2-codex",
|
|
2400
|
+
"gpt-5.3-chat-latest",
|
|
2401
|
+
"gpt-5.3-codex",
|
|
2402
|
+
"gpt-5.4",
|
|
2403
|
+
"gpt-5.4-2026-03-05",
|
|
2404
|
+
"gpt-5.4-mini",
|
|
2405
|
+
"gpt-5.4-mini-2026-03-17",
|
|
2406
|
+
"gpt-5.4-nano",
|
|
2407
|
+
"gpt-5.4-nano-2026-03-17",
|
|
2408
|
+
"gpt-5.4-pro",
|
|
2409
|
+
"gpt-5.4-pro-2026-03-05",
|
|
2410
|
+
"gpt-5.6",
|
|
2411
|
+
"gpt-5.6-luna",
|
|
2412
|
+
"gpt-5.6-sol",
|
|
2413
|
+
"gpt-5.6-terra",
|
|
2414
|
+
"gpt-6-astra",
|
|
2415
|
+
"gpt-6-luna",
|
|
2416
|
+
"gpt-6-sol"
|
|
2417
|
+
];
|
|
2418
|
+
var openaiResponsesModelIds = [
|
|
2419
|
+
"gpt-4.1",
|
|
2420
|
+
"gpt-4.1-2025-04-14",
|
|
2421
|
+
"gpt-4.1-mini",
|
|
2422
|
+
"gpt-4.1-mini-2025-04-14",
|
|
2423
|
+
"gpt-4.1-nano",
|
|
2424
|
+
"gpt-4.1-nano-2025-04-14",
|
|
2425
|
+
"gpt-4o",
|
|
2426
|
+
"gpt-4o-2024-05-13",
|
|
2427
|
+
"gpt-4o-2024-08-06",
|
|
2428
|
+
"gpt-4o-2024-11-20",
|
|
2429
|
+
"gpt-4o-audio-preview",
|
|
2430
|
+
"gpt-4o-audio-preview-2024-10-01",
|
|
2431
|
+
"gpt-4o-audio-preview-2024-12-17",
|
|
2432
|
+
"gpt-4o-search-preview",
|
|
2433
|
+
"gpt-4o-search-preview-2025-03-11",
|
|
2434
|
+
"gpt-4o-mini-search-preview",
|
|
2435
|
+
"gpt-4o-mini-search-preview-2025-03-11",
|
|
2436
|
+
"gpt-4o-mini",
|
|
2437
|
+
"gpt-4o-mini-2024-07-18",
|
|
2438
|
+
"gpt-4-turbo",
|
|
2439
|
+
"gpt-4-turbo-2024-04-09",
|
|
2440
|
+
"gpt-4-turbo-preview",
|
|
2441
|
+
"gpt-4-0125-preview",
|
|
2442
|
+
"gpt-4-1106-preview",
|
|
2443
|
+
"gpt-4",
|
|
2444
|
+
"gpt-4-0613",
|
|
2445
|
+
"gpt-4.5-preview",
|
|
2446
|
+
"gpt-4.5-preview-2025-02-27",
|
|
2447
|
+
"gpt-3.5-turbo-0125",
|
|
2448
|
+
"gpt-3.5-turbo",
|
|
2449
|
+
"gpt-3.5-turbo-1106",
|
|
2450
|
+
"chatgpt-4o-latest",
|
|
2451
|
+
"gpt-5-chat-latest",
|
|
2452
|
+
...openaiResponsesReasoningModelIds
|
|
2453
|
+
];
|
|
2454
|
+
var openaiResponsesProviderOptionsSchema = (0, import_provider_utils21.lazyValidator)(
|
|
2455
|
+
() => (0, import_provider_utils21.zodSchema)(
|
|
2456
|
+
import_v416.z.object({
|
|
2457
|
+
conversation: import_v416.z.string().nullish(),
|
|
2458
|
+
include: import_v416.z.array(
|
|
2459
|
+
import_v416.z.enum([
|
|
2460
|
+
"reasoning.encrypted_content",
|
|
2461
|
+
// handled internally by default, only needed for unknown reasoning models
|
|
2462
|
+
"file_search_call.results",
|
|
2463
|
+
"message.output_text.logprobs"
|
|
2464
|
+
])
|
|
2465
|
+
).nullish(),
|
|
2466
|
+
instructions: import_v416.z.string().nullish(),
|
|
2467
|
+
/**
|
|
2468
|
+
* Return the log probabilities of the tokens.
|
|
2469
|
+
*
|
|
2470
|
+
* Setting to true will return the log probabilities of the tokens that
|
|
2471
|
+
* were generated.
|
|
2472
|
+
*
|
|
2473
|
+
* Setting to a number will return the log probabilities of the top n
|
|
2474
|
+
* tokens that were generated.
|
|
2475
|
+
*
|
|
2476
|
+
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
2477
|
+
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
2478
|
+
*/
|
|
2479
|
+
logprobs: import_v416.z.union([import_v416.z.boolean(), import_v416.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
2480
|
+
/**
|
|
2481
|
+
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
2482
|
+
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
2483
|
+
* Any further attempts to call a tool by the model will be ignored.
|
|
2484
|
+
*/
|
|
2485
|
+
maxToolCalls: import_v416.z.number().nullish(),
|
|
2486
|
+
metadata: import_v416.z.any().nullish(),
|
|
2487
|
+
parallelToolCalls: import_v416.z.boolean().nullish(),
|
|
2488
|
+
previousResponseId: import_v416.z.string().nullish(),
|
|
2489
|
+
promptCacheKey: import_v416.z.string().nullish(),
|
|
2490
|
+
/**
|
|
2491
|
+
* Prompt cache behavior for GPT-5.6 and later models.
|
|
2492
|
+
* `mode` controls whether OpenAI also places an implicit breakpoint.
|
|
2493
|
+
* `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
|
|
2494
|
+
*/
|
|
2495
|
+
promptCacheOptions: import_v416.z.object({
|
|
2496
|
+
mode: import_v416.z.enum(["implicit", "explicit"]).optional(),
|
|
2497
|
+
ttl: import_v416.z.literal("30m").optional()
|
|
2498
|
+
}).optional(),
|
|
2499
|
+
/**
|
|
2500
|
+
* The retention policy for the prompt cache.
|
|
2501
|
+
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
2502
|
+
* - '24h': Extended prompt caching that keeps cached prefixes active for up to 24 hours.
|
|
2503
|
+
* Available for models before GPT-5.6 that support extended caching.
|
|
2504
|
+
*
|
|
2505
|
+
* @deprecated For GPT-5.6 and later models, use `promptCacheOptions.ttl`.
|
|
2506
|
+
*
|
|
2507
|
+
* @default 'in_memory'
|
|
2508
|
+
*/
|
|
2509
|
+
promptCacheRetention: import_v416.z.enum(["in_memory", "24h"]).nullish(),
|
|
2510
|
+
/**
|
|
2511
|
+
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
2512
|
+
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
2513
|
+
* GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
2514
|
+
* Supported values vary by model.
|
|
2515
|
+
*/
|
|
2516
|
+
reasoningEffort: import_v416.z.string().nullish(),
|
|
2517
|
+
/**
|
|
2518
|
+
* Updates the reasoning effort for GPT-6 and later models starting with this response
|
|
2519
|
+
* without changing the request-level reasoning effort. This preserves the
|
|
2520
|
+
* request prefix for prompt caching.
|
|
2521
|
+
*
|
|
2522
|
+
* Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be
|
|
2523
|
+
* combined with automatic truncation.
|
|
2524
|
+
*/
|
|
2525
|
+
reasoningEffortUpdate: import_v416.z.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
2526
|
+
/**
|
|
2527
|
+
* Controls how much model work GPT-5.6 performs before returning a final answer.
|
|
2528
|
+
* `standard` is the default. `pro` increases quality, latency, and token usage.
|
|
2529
|
+
*/
|
|
2530
|
+
reasoningMode: import_v416.z.enum(["standard", "pro"]).optional(),
|
|
2531
|
+
/**
|
|
2532
|
+
* Controls which available reasoning items GPT-5.6 can use.
|
|
2533
|
+
* `auto` uses the model default, `current_turn` excludes reasoning from earlier
|
|
2534
|
+
* turns, and `all_turns` makes compatible earlier reasoning available.
|
|
2535
|
+
*/
|
|
2536
|
+
reasoningContext: import_v416.z.enum(["auto", "current_turn", "all_turns"]).optional(),
|
|
2537
|
+
reasoningSummary: import_v416.z.string().nullish(),
|
|
2538
|
+
safetyIdentifier: import_v416.z.string().nullish(),
|
|
2539
|
+
serviceTier: import_v416.z.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
2540
|
+
store: import_v416.z.boolean().nullish(),
|
|
2541
|
+
strictJsonSchema: import_v416.z.boolean().nullish(),
|
|
2542
|
+
textVerbosity: import_v416.z.enum(["low", "medium", "high"]).nullish(),
|
|
2543
|
+
truncation: import_v416.z.enum(["auto", "disabled"]).nullish(),
|
|
2544
|
+
user: import_v416.z.string().nullish()
|
|
2545
|
+
})
|
|
2546
|
+
)
|
|
2547
|
+
);
|
|
2548
|
+
var openaiResponsesSystemMessageOptionsSchema = (0, import_provider_utils21.lazyValidator)(
|
|
2549
|
+
() => (0, import_provider_utils21.zodSchema)(
|
|
2550
|
+
import_v416.z.object({
|
|
2551
|
+
/**
|
|
2552
|
+
* Emit a configuration update at this position in Responses history.
|
|
2553
|
+
* Requires empty system message content and the same supported
|
|
2554
|
+
* configuration as the request-level reasoningEffortUpdate option.
|
|
2555
|
+
* Unsupported historical updates throw instead of being omitted.
|
|
2556
|
+
*
|
|
2557
|
+
* @see https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation
|
|
2558
|
+
*/
|
|
2559
|
+
reasoningEffortUpdate: import_v416.z.enum(["low", "medium", "high", "xhigh", "max"]).optional()
|
|
2560
|
+
})
|
|
2561
|
+
)
|
|
2562
|
+
);
|
|
2563
|
+
|
|
2564
|
+
// src/responses/convert-to-openai-responses-input.ts
|
|
2362
2565
|
function getPromptCacheBreakpoint2(providerOptions) {
|
|
2363
2566
|
var _a2;
|
|
2364
2567
|
return (_a2 = providerOptions == null ? void 0 : providerOptions.openai) == null ? void 0 : _a2.promptCacheBreakpoint;
|
|
@@ -2370,9 +2573,11 @@ function isFileId(data, prefixes) {
|
|
|
2370
2573
|
async function convertToOpenAIResponsesInput({
|
|
2371
2574
|
prompt,
|
|
2372
2575
|
systemMessageMode,
|
|
2576
|
+
providerOptionsName = "openai",
|
|
2373
2577
|
explicitMessageItemType = false,
|
|
2374
2578
|
fileIdPrefixes,
|
|
2375
2579
|
store,
|
|
2580
|
+
configurationUpdateUnsupportedReason,
|
|
2376
2581
|
hasLocalShellTool = false
|
|
2377
2582
|
}) {
|
|
2378
2583
|
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -2381,6 +2586,33 @@ async function convertToOpenAIResponsesInput({
|
|
|
2381
2586
|
for (const { role, content, providerOptions } of prompt) {
|
|
2382
2587
|
switch (role) {
|
|
2383
2588
|
case "system": {
|
|
2589
|
+
let options = await (0, import_provider_utils22.parseProviderOptions)({
|
|
2590
|
+
provider: providerOptionsName,
|
|
2591
|
+
providerOptions,
|
|
2592
|
+
schema: openaiResponsesSystemMessageOptionsSchema
|
|
2593
|
+
});
|
|
2594
|
+
if (options == null && providerOptionsName !== "openai") {
|
|
2595
|
+
options = await (0, import_provider_utils22.parseProviderOptions)({
|
|
2596
|
+
provider: "openai",
|
|
2597
|
+
providerOptions,
|
|
2598
|
+
schema: openaiResponsesSystemMessageOptionsSchema
|
|
2599
|
+
});
|
|
2600
|
+
}
|
|
2601
|
+
const effort = options == null ? void 0 : options.reasoningEffortUpdate;
|
|
2602
|
+
if (effort != null) {
|
|
2603
|
+
const unsupportedReason = content !== "" ? "Message-level reasoningEffortUpdate requires empty system message content." : configurationUpdateUnsupportedReason;
|
|
2604
|
+
if (unsupportedReason != null) {
|
|
2605
|
+
throw new import_provider6.UnsupportedFunctionalityError({
|
|
2606
|
+
functionality: "Message-level reasoningEffortUpdate",
|
|
2607
|
+
message: unsupportedReason
|
|
2608
|
+
});
|
|
2609
|
+
}
|
|
2610
|
+
input.push({
|
|
2611
|
+
type: "configuration_update",
|
|
2612
|
+
reasoning: { effort }
|
|
2613
|
+
});
|
|
2614
|
+
break;
|
|
2615
|
+
}
|
|
2384
2616
|
switch (systemMessageMode) {
|
|
2385
2617
|
case "system": {
|
|
2386
2618
|
const promptCacheBreakpoint = getPromptCacheBreakpoint2(providerOptions);
|
|
@@ -2456,7 +2688,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2456
2688
|
return {
|
|
2457
2689
|
type: "input_image",
|
|
2458
2690
|
...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
2459
|
-
image_url: `data:${mediaType};base64,${(0,
|
|
2691
|
+
image_url: `data:${mediaType};base64,${(0, import_provider_utils22.convertToBase64)(part.data)}`
|
|
2460
2692
|
},
|
|
2461
2693
|
detail: (_b2 = (_a3 = part.providerOptions) == null ? void 0 : _a3.openai) == null ? void 0 : _b2.imageDetail,
|
|
2462
2694
|
...promptCacheBreakpoint != null && {
|
|
@@ -2477,7 +2709,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2477
2709
|
type: "input_file",
|
|
2478
2710
|
...typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
2479
2711
|
filename: (_c2 = part.filename) != null ? _c2 : `part-${index}.pdf`,
|
|
2480
|
-
file_data: `data:application/pdf;base64,${(0,
|
|
2712
|
+
file_data: `data:application/pdf;base64,${(0, import_provider_utils22.convertToBase64)(part.data)}`
|
|
2481
2713
|
},
|
|
2482
2714
|
...promptCacheBreakpoint != null && {
|
|
2483
2715
|
prompt_cache_breakpoint: promptCacheBreakpoint
|
|
@@ -2527,7 +2759,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2527
2759
|
break;
|
|
2528
2760
|
}
|
|
2529
2761
|
if (hasLocalShellTool && part.toolName === "local_shell") {
|
|
2530
|
-
const parsedInput = await (0,
|
|
2762
|
+
const parsedInput = await (0, import_provider_utils22.validateTypes)({
|
|
2531
2763
|
value: part.input,
|
|
2532
2764
|
schema: localShellInputSchema
|
|
2533
2765
|
});
|
|
@@ -2569,7 +2801,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2569
2801
|
break;
|
|
2570
2802
|
}
|
|
2571
2803
|
case "reasoning": {
|
|
2572
|
-
const providerOptions2 = await (0,
|
|
2804
|
+
const providerOptions2 = await (0, import_provider_utils22.parseProviderOptions)({
|
|
2573
2805
|
provider: "openai",
|
|
2574
2806
|
providerOptions: part.providerOptions,
|
|
2575
2807
|
schema: openaiResponsesReasoningProviderOptionsSchema
|
|
@@ -2633,7 +2865,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2633
2865
|
part.providerOptions
|
|
2634
2866
|
);
|
|
2635
2867
|
if (hasLocalShellTool && part.toolName === "local_shell" && output.type === "json") {
|
|
2636
|
-
const parsedOutput = await (0,
|
|
2868
|
+
const parsedOutput = await (0, import_provider_utils22.validateTypes)({
|
|
2637
2869
|
value: output.value,
|
|
2638
2870
|
schema: localShellOutputSchema
|
|
2639
2871
|
});
|
|
@@ -2726,9 +2958,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
2726
2958
|
}
|
|
2727
2959
|
return { input, warnings };
|
|
2728
2960
|
}
|
|
2729
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
2730
|
-
itemId:
|
|
2731
|
-
reasoningEncryptedContent:
|
|
2961
|
+
var openaiResponsesReasoningProviderOptionsSchema = import_v417.z.object({
|
|
2962
|
+
itemId: import_v417.z.string().nullish(),
|
|
2963
|
+
reasoningEncryptedContent: import_v417.z.string().nullish()
|
|
2732
2964
|
});
|
|
2733
2965
|
|
|
2734
2966
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -2750,288 +2982,288 @@ function mapOpenAIResponseFinishReason({
|
|
|
2750
2982
|
}
|
|
2751
2983
|
|
|
2752
2984
|
// src/responses/openai-responses-api.ts
|
|
2753
|
-
var
|
|
2754
|
-
var
|
|
2755
|
-
var openaiResponsesChunkSchema = (0,
|
|
2756
|
-
() => (0,
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
type:
|
|
2760
|
-
item_id:
|
|
2761
|
-
delta:
|
|
2762
|
-
logprobs:
|
|
2763
|
-
|
|
2764
|
-
token:
|
|
2765
|
-
logprob:
|
|
2766
|
-
top_logprobs:
|
|
2767
|
-
|
|
2768
|
-
token:
|
|
2769
|
-
logprob:
|
|
2985
|
+
var import_provider_utils23 = require("@ai-sdk/provider-utils");
|
|
2986
|
+
var import_v418 = require("zod/v4");
|
|
2987
|
+
var openaiResponsesChunkSchema = (0, import_provider_utils23.lazyValidator)(
|
|
2988
|
+
() => (0, import_provider_utils23.zodSchema)(
|
|
2989
|
+
import_v418.z.union([
|
|
2990
|
+
import_v418.z.object({
|
|
2991
|
+
type: import_v418.z.literal("response.output_text.delta"),
|
|
2992
|
+
item_id: import_v418.z.string(),
|
|
2993
|
+
delta: import_v418.z.string(),
|
|
2994
|
+
logprobs: import_v418.z.array(
|
|
2995
|
+
import_v418.z.object({
|
|
2996
|
+
token: import_v418.z.string(),
|
|
2997
|
+
logprob: import_v418.z.number(),
|
|
2998
|
+
top_logprobs: import_v418.z.array(
|
|
2999
|
+
import_v418.z.object({
|
|
3000
|
+
token: import_v418.z.string(),
|
|
3001
|
+
logprob: import_v418.z.number()
|
|
2770
3002
|
})
|
|
2771
3003
|
)
|
|
2772
3004
|
})
|
|
2773
3005
|
).nullish()
|
|
2774
3006
|
}),
|
|
2775
|
-
|
|
2776
|
-
type:
|
|
2777
|
-
response:
|
|
2778
|
-
incomplete_details:
|
|
2779
|
-
usage:
|
|
2780
|
-
input_tokens:
|
|
2781
|
-
input_tokens_details:
|
|
2782
|
-
cached_tokens:
|
|
2783
|
-
cache_write_tokens:
|
|
2784
|
-
orchestration_input_tokens:
|
|
2785
|
-
orchestration_input_cached_tokens:
|
|
3007
|
+
import_v418.z.object({
|
|
3008
|
+
type: import_v418.z.enum(["response.completed", "response.incomplete"]),
|
|
3009
|
+
response: import_v418.z.object({
|
|
3010
|
+
incomplete_details: import_v418.z.object({ reason: import_v418.z.string() }).nullish(),
|
|
3011
|
+
usage: import_v418.z.object({
|
|
3012
|
+
input_tokens: import_v418.z.number(),
|
|
3013
|
+
input_tokens_details: import_v418.z.object({
|
|
3014
|
+
cached_tokens: import_v418.z.number().nullish(),
|
|
3015
|
+
cache_write_tokens: import_v418.z.number().nullish(),
|
|
3016
|
+
orchestration_input_tokens: import_v418.z.number().nullish(),
|
|
3017
|
+
orchestration_input_cached_tokens: import_v418.z.number().nullish()
|
|
2786
3018
|
}).nullish(),
|
|
2787
|
-
output_tokens:
|
|
2788
|
-
output_tokens_details:
|
|
2789
|
-
reasoning_tokens:
|
|
2790
|
-
orchestration_output_tokens:
|
|
3019
|
+
output_tokens: import_v418.z.number(),
|
|
3020
|
+
output_tokens_details: import_v418.z.object({
|
|
3021
|
+
reasoning_tokens: import_v418.z.number().nullish(),
|
|
3022
|
+
orchestration_output_tokens: import_v418.z.number().nullish()
|
|
2791
3023
|
}).nullish()
|
|
2792
3024
|
}),
|
|
2793
|
-
reasoning:
|
|
2794
|
-
context:
|
|
3025
|
+
reasoning: import_v418.z.object({
|
|
3026
|
+
context: import_v418.z.string().nullish()
|
|
2795
3027
|
}).nullish(),
|
|
2796
|
-
service_tier:
|
|
3028
|
+
service_tier: import_v418.z.string().nullish()
|
|
2797
3029
|
})
|
|
2798
3030
|
}),
|
|
2799
|
-
|
|
2800
|
-
type:
|
|
2801
|
-
response:
|
|
2802
|
-
id:
|
|
2803
|
-
created_at:
|
|
2804
|
-
model:
|
|
2805
|
-
service_tier:
|
|
3031
|
+
import_v418.z.object({
|
|
3032
|
+
type: import_v418.z.literal("response.created"),
|
|
3033
|
+
response: import_v418.z.object({
|
|
3034
|
+
id: import_v418.z.string(),
|
|
3035
|
+
created_at: import_v418.z.number(),
|
|
3036
|
+
model: import_v418.z.string(),
|
|
3037
|
+
service_tier: import_v418.z.string().nullish()
|
|
2806
3038
|
})
|
|
2807
3039
|
}),
|
|
2808
|
-
|
|
2809
|
-
type:
|
|
2810
|
-
output_index:
|
|
2811
|
-
item:
|
|
2812
|
-
|
|
2813
|
-
type:
|
|
2814
|
-
id:
|
|
2815
|
-
phase:
|
|
3040
|
+
import_v418.z.object({
|
|
3041
|
+
type: import_v418.z.literal("response.output_item.added"),
|
|
3042
|
+
output_index: import_v418.z.number(),
|
|
3043
|
+
item: import_v418.z.discriminatedUnion("type", [
|
|
3044
|
+
import_v418.z.object({
|
|
3045
|
+
type: import_v418.z.literal("message"),
|
|
3046
|
+
id: import_v418.z.string(),
|
|
3047
|
+
phase: import_v418.z.enum(["commentary", "final_answer"]).nullish()
|
|
2816
3048
|
}),
|
|
2817
|
-
|
|
2818
|
-
type:
|
|
2819
|
-
id:
|
|
2820
|
-
encrypted_content:
|
|
3049
|
+
import_v418.z.object({
|
|
3050
|
+
type: import_v418.z.literal("reasoning"),
|
|
3051
|
+
id: import_v418.z.string(),
|
|
3052
|
+
encrypted_content: import_v418.z.string().nullish()
|
|
2821
3053
|
}),
|
|
2822
|
-
|
|
2823
|
-
type:
|
|
2824
|
-
id:
|
|
2825
|
-
call_id:
|
|
2826
|
-
name:
|
|
2827
|
-
arguments:
|
|
2828
|
-
async:
|
|
3054
|
+
import_v418.z.object({
|
|
3055
|
+
type: import_v418.z.literal("function_call"),
|
|
3056
|
+
id: import_v418.z.string(),
|
|
3057
|
+
call_id: import_v418.z.string(),
|
|
3058
|
+
name: import_v418.z.string(),
|
|
3059
|
+
arguments: import_v418.z.string(),
|
|
3060
|
+
async: import_v418.z.boolean().nullish()
|
|
2829
3061
|
}),
|
|
2830
|
-
|
|
2831
|
-
type:
|
|
2832
|
-
id:
|
|
2833
|
-
status:
|
|
3062
|
+
import_v418.z.object({
|
|
3063
|
+
type: import_v418.z.literal("web_search_call"),
|
|
3064
|
+
id: import_v418.z.string(),
|
|
3065
|
+
status: import_v418.z.string()
|
|
2834
3066
|
}),
|
|
2835
|
-
|
|
2836
|
-
type:
|
|
2837
|
-
id:
|
|
2838
|
-
status:
|
|
3067
|
+
import_v418.z.object({
|
|
3068
|
+
type: import_v418.z.literal("computer_call"),
|
|
3069
|
+
id: import_v418.z.string(),
|
|
3070
|
+
status: import_v418.z.string()
|
|
2839
3071
|
}),
|
|
2840
|
-
|
|
2841
|
-
type:
|
|
2842
|
-
id:
|
|
3072
|
+
import_v418.z.object({
|
|
3073
|
+
type: import_v418.z.literal("file_search_call"),
|
|
3074
|
+
id: import_v418.z.string()
|
|
2843
3075
|
}),
|
|
2844
|
-
|
|
2845
|
-
type:
|
|
2846
|
-
id:
|
|
3076
|
+
import_v418.z.object({
|
|
3077
|
+
type: import_v418.z.literal("image_generation_call"),
|
|
3078
|
+
id: import_v418.z.string()
|
|
2847
3079
|
}),
|
|
2848
|
-
|
|
2849
|
-
type:
|
|
2850
|
-
id:
|
|
2851
|
-
container_id:
|
|
2852
|
-
code:
|
|
2853
|
-
outputs:
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
3080
|
+
import_v418.z.object({
|
|
3081
|
+
type: import_v418.z.literal("code_interpreter_call"),
|
|
3082
|
+
id: import_v418.z.string(),
|
|
3083
|
+
container_id: import_v418.z.string(),
|
|
3084
|
+
code: import_v418.z.string().nullable(),
|
|
3085
|
+
outputs: import_v418.z.array(
|
|
3086
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3087
|
+
import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
|
|
3088
|
+
import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
|
|
2857
3089
|
])
|
|
2858
3090
|
).nullable(),
|
|
2859
|
-
status:
|
|
3091
|
+
status: import_v418.z.string()
|
|
2860
3092
|
})
|
|
2861
3093
|
])
|
|
2862
3094
|
}),
|
|
2863
|
-
|
|
2864
|
-
type:
|
|
2865
|
-
output_index:
|
|
2866
|
-
item:
|
|
2867
|
-
|
|
2868
|
-
type:
|
|
2869
|
-
id:
|
|
2870
|
-
phase:
|
|
3095
|
+
import_v418.z.object({
|
|
3096
|
+
type: import_v418.z.literal("response.output_item.done"),
|
|
3097
|
+
output_index: import_v418.z.number(),
|
|
3098
|
+
item: import_v418.z.discriminatedUnion("type", [
|
|
3099
|
+
import_v418.z.object({
|
|
3100
|
+
type: import_v418.z.literal("message"),
|
|
3101
|
+
id: import_v418.z.string(),
|
|
3102
|
+
phase: import_v418.z.enum(["commentary", "final_answer"]).nullish()
|
|
2871
3103
|
}),
|
|
2872
|
-
|
|
2873
|
-
type:
|
|
2874
|
-
id:
|
|
2875
|
-
encrypted_content:
|
|
3104
|
+
import_v418.z.object({
|
|
3105
|
+
type: import_v418.z.literal("reasoning"),
|
|
3106
|
+
id: import_v418.z.string(),
|
|
3107
|
+
encrypted_content: import_v418.z.string().nullish()
|
|
2876
3108
|
}),
|
|
2877
|
-
|
|
2878
|
-
type:
|
|
2879
|
-
id:
|
|
2880
|
-
call_id:
|
|
2881
|
-
name:
|
|
2882
|
-
arguments:
|
|
2883
|
-
async:
|
|
2884
|
-
status:
|
|
3109
|
+
import_v418.z.object({
|
|
3110
|
+
type: import_v418.z.literal("function_call"),
|
|
3111
|
+
id: import_v418.z.string(),
|
|
3112
|
+
call_id: import_v418.z.string(),
|
|
3113
|
+
name: import_v418.z.string(),
|
|
3114
|
+
arguments: import_v418.z.string(),
|
|
3115
|
+
async: import_v418.z.boolean().nullish(),
|
|
3116
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"])
|
|
2885
3117
|
}),
|
|
2886
|
-
|
|
2887
|
-
type:
|
|
2888
|
-
id:
|
|
2889
|
-
code:
|
|
2890
|
-
container_id:
|
|
2891
|
-
outputs:
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
3118
|
+
import_v418.z.object({
|
|
3119
|
+
type: import_v418.z.literal("code_interpreter_call"),
|
|
3120
|
+
id: import_v418.z.string(),
|
|
3121
|
+
code: import_v418.z.string().nullable(),
|
|
3122
|
+
container_id: import_v418.z.string(),
|
|
3123
|
+
outputs: import_v418.z.array(
|
|
3124
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3125
|
+
import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
|
|
3126
|
+
import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
|
|
2895
3127
|
])
|
|
2896
3128
|
).nullable()
|
|
2897
3129
|
}),
|
|
2898
|
-
|
|
2899
|
-
type:
|
|
2900
|
-
id:
|
|
2901
|
-
result:
|
|
3130
|
+
import_v418.z.object({
|
|
3131
|
+
type: import_v418.z.literal("image_generation_call"),
|
|
3132
|
+
id: import_v418.z.string(),
|
|
3133
|
+
result: import_v418.z.string()
|
|
2902
3134
|
}),
|
|
2903
|
-
|
|
2904
|
-
type:
|
|
2905
|
-
id:
|
|
2906
|
-
status:
|
|
2907
|
-
action:
|
|
2908
|
-
|
|
2909
|
-
type:
|
|
2910
|
-
query:
|
|
2911
|
-
sources:
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
3135
|
+
import_v418.z.object({
|
|
3136
|
+
type: import_v418.z.literal("web_search_call"),
|
|
3137
|
+
id: import_v418.z.string(),
|
|
3138
|
+
status: import_v418.z.string(),
|
|
3139
|
+
action: import_v418.z.discriminatedUnion("type", [
|
|
3140
|
+
import_v418.z.object({
|
|
3141
|
+
type: import_v418.z.literal("search"),
|
|
3142
|
+
query: import_v418.z.string().nullish(),
|
|
3143
|
+
sources: import_v418.z.array(
|
|
3144
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3145
|
+
import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
|
|
3146
|
+
import_v418.z.object({ type: import_v418.z.literal("api"), name: import_v418.z.string() })
|
|
2915
3147
|
])
|
|
2916
3148
|
).nullish()
|
|
2917
3149
|
}),
|
|
2918
|
-
|
|
2919
|
-
type:
|
|
2920
|
-
url:
|
|
3150
|
+
import_v418.z.object({
|
|
3151
|
+
type: import_v418.z.literal("open_page"),
|
|
3152
|
+
url: import_v418.z.string().nullish()
|
|
2921
3153
|
}),
|
|
2922
|
-
|
|
2923
|
-
type:
|
|
2924
|
-
url:
|
|
2925
|
-
pattern:
|
|
3154
|
+
import_v418.z.object({
|
|
3155
|
+
type: import_v418.z.literal("find_in_page"),
|
|
3156
|
+
url: import_v418.z.string().nullish(),
|
|
3157
|
+
pattern: import_v418.z.string().nullish()
|
|
2926
3158
|
})
|
|
2927
3159
|
]).nullish()
|
|
2928
3160
|
}),
|
|
2929
|
-
|
|
2930
|
-
type:
|
|
2931
|
-
id:
|
|
2932
|
-
queries:
|
|
2933
|
-
results:
|
|
2934
|
-
|
|
2935
|
-
attributes:
|
|
2936
|
-
file_id:
|
|
2937
|
-
filename:
|
|
2938
|
-
score:
|
|
2939
|
-
text:
|
|
3161
|
+
import_v418.z.object({
|
|
3162
|
+
type: import_v418.z.literal("file_search_call"),
|
|
3163
|
+
id: import_v418.z.string(),
|
|
3164
|
+
queries: import_v418.z.array(import_v418.z.string()),
|
|
3165
|
+
results: import_v418.z.array(
|
|
3166
|
+
import_v418.z.object({
|
|
3167
|
+
attributes: import_v418.z.record(import_v418.z.string(), import_v418.z.unknown()),
|
|
3168
|
+
file_id: import_v418.z.string(),
|
|
3169
|
+
filename: import_v418.z.string(),
|
|
3170
|
+
score: import_v418.z.number(),
|
|
3171
|
+
text: import_v418.z.string()
|
|
2940
3172
|
})
|
|
2941
3173
|
).nullish()
|
|
2942
3174
|
}),
|
|
2943
|
-
|
|
2944
|
-
type:
|
|
2945
|
-
id:
|
|
2946
|
-
call_id:
|
|
2947
|
-
action:
|
|
2948
|
-
type:
|
|
2949
|
-
command:
|
|
2950
|
-
timeout_ms:
|
|
2951
|
-
user:
|
|
2952
|
-
working_directory:
|
|
2953
|
-
env:
|
|
3175
|
+
import_v418.z.object({
|
|
3176
|
+
type: import_v418.z.literal("local_shell_call"),
|
|
3177
|
+
id: import_v418.z.string(),
|
|
3178
|
+
call_id: import_v418.z.string(),
|
|
3179
|
+
action: import_v418.z.object({
|
|
3180
|
+
type: import_v418.z.literal("exec"),
|
|
3181
|
+
command: import_v418.z.array(import_v418.z.string()),
|
|
3182
|
+
timeout_ms: import_v418.z.number().optional(),
|
|
3183
|
+
user: import_v418.z.string().optional(),
|
|
3184
|
+
working_directory: import_v418.z.string().optional(),
|
|
3185
|
+
env: import_v418.z.record(import_v418.z.string(), import_v418.z.string()).optional()
|
|
2954
3186
|
})
|
|
2955
3187
|
}),
|
|
2956
|
-
|
|
2957
|
-
type:
|
|
2958
|
-
id:
|
|
2959
|
-
status:
|
|
3188
|
+
import_v418.z.object({
|
|
3189
|
+
type: import_v418.z.literal("computer_call"),
|
|
3190
|
+
id: import_v418.z.string(),
|
|
3191
|
+
status: import_v418.z.literal("completed")
|
|
2960
3192
|
})
|
|
2961
3193
|
])
|
|
2962
3194
|
}),
|
|
2963
|
-
|
|
2964
|
-
type:
|
|
2965
|
-
item_id:
|
|
2966
|
-
output_index:
|
|
2967
|
-
delta:
|
|
3195
|
+
import_v418.z.object({
|
|
3196
|
+
type: import_v418.z.literal("response.function_call_arguments.delta"),
|
|
3197
|
+
item_id: import_v418.z.string(),
|
|
3198
|
+
output_index: import_v418.z.number(),
|
|
3199
|
+
delta: import_v418.z.string()
|
|
2968
3200
|
}),
|
|
2969
|
-
|
|
2970
|
-
type:
|
|
2971
|
-
item_id:
|
|
2972
|
-
output_index:
|
|
2973
|
-
partial_image_b64:
|
|
3201
|
+
import_v418.z.object({
|
|
3202
|
+
type: import_v418.z.literal("response.image_generation_call.partial_image"),
|
|
3203
|
+
item_id: import_v418.z.string(),
|
|
3204
|
+
output_index: import_v418.z.number(),
|
|
3205
|
+
partial_image_b64: import_v418.z.string()
|
|
2974
3206
|
}),
|
|
2975
|
-
|
|
2976
|
-
type:
|
|
2977
|
-
item_id:
|
|
2978
|
-
output_index:
|
|
2979
|
-
delta:
|
|
3207
|
+
import_v418.z.object({
|
|
3208
|
+
type: import_v418.z.literal("response.code_interpreter_call_code.delta"),
|
|
3209
|
+
item_id: import_v418.z.string(),
|
|
3210
|
+
output_index: import_v418.z.number(),
|
|
3211
|
+
delta: import_v418.z.string()
|
|
2980
3212
|
}),
|
|
2981
|
-
|
|
2982
|
-
type:
|
|
2983
|
-
item_id:
|
|
2984
|
-
output_index:
|
|
2985
|
-
code:
|
|
3213
|
+
import_v418.z.object({
|
|
3214
|
+
type: import_v418.z.literal("response.code_interpreter_call_code.done"),
|
|
3215
|
+
item_id: import_v418.z.string(),
|
|
3216
|
+
output_index: import_v418.z.number(),
|
|
3217
|
+
code: import_v418.z.string()
|
|
2986
3218
|
}),
|
|
2987
|
-
|
|
2988
|
-
type:
|
|
2989
|
-
annotation:
|
|
2990
|
-
|
|
2991
|
-
type:
|
|
2992
|
-
start_index:
|
|
2993
|
-
end_index:
|
|
2994
|
-
url:
|
|
2995
|
-
title:
|
|
3219
|
+
import_v418.z.object({
|
|
3220
|
+
type: import_v418.z.literal("response.output_text.annotation.added"),
|
|
3221
|
+
annotation: import_v418.z.discriminatedUnion("type", [
|
|
3222
|
+
import_v418.z.object({
|
|
3223
|
+
type: import_v418.z.literal("url_citation"),
|
|
3224
|
+
start_index: import_v418.z.number(),
|
|
3225
|
+
end_index: import_v418.z.number(),
|
|
3226
|
+
url: import_v418.z.string(),
|
|
3227
|
+
title: import_v418.z.string()
|
|
2996
3228
|
}),
|
|
2997
|
-
|
|
2998
|
-
type:
|
|
2999
|
-
file_id:
|
|
3000
|
-
filename:
|
|
3001
|
-
index:
|
|
3002
|
-
start_index:
|
|
3003
|
-
end_index:
|
|
3004
|
-
quote:
|
|
3229
|
+
import_v418.z.object({
|
|
3230
|
+
type: import_v418.z.literal("file_citation"),
|
|
3231
|
+
file_id: import_v418.z.string(),
|
|
3232
|
+
filename: import_v418.z.string().nullish(),
|
|
3233
|
+
index: import_v418.z.number().nullish(),
|
|
3234
|
+
start_index: import_v418.z.number().nullish(),
|
|
3235
|
+
end_index: import_v418.z.number().nullish(),
|
|
3236
|
+
quote: import_v418.z.string().nullish()
|
|
3005
3237
|
})
|
|
3006
3238
|
])
|
|
3007
3239
|
}),
|
|
3008
|
-
|
|
3009
|
-
type:
|
|
3010
|
-
item_id:
|
|
3011
|
-
summary_index:
|
|
3240
|
+
import_v418.z.object({
|
|
3241
|
+
type: import_v418.z.literal("response.reasoning_summary_part.added"),
|
|
3242
|
+
item_id: import_v418.z.string(),
|
|
3243
|
+
summary_index: import_v418.z.number()
|
|
3012
3244
|
}),
|
|
3013
|
-
|
|
3014
|
-
type:
|
|
3015
|
-
item_id:
|
|
3016
|
-
summary_index:
|
|
3017
|
-
delta:
|
|
3245
|
+
import_v418.z.object({
|
|
3246
|
+
type: import_v418.z.literal("response.reasoning_summary_text.delta"),
|
|
3247
|
+
item_id: import_v418.z.string(),
|
|
3248
|
+
summary_index: import_v418.z.number(),
|
|
3249
|
+
delta: import_v418.z.string()
|
|
3018
3250
|
}),
|
|
3019
|
-
|
|
3020
|
-
type:
|
|
3021
|
-
item_id:
|
|
3022
|
-
summary_index:
|
|
3251
|
+
import_v418.z.object({
|
|
3252
|
+
type: import_v418.z.literal("response.reasoning_summary_part.done"),
|
|
3253
|
+
item_id: import_v418.z.string(),
|
|
3254
|
+
summary_index: import_v418.z.number()
|
|
3023
3255
|
}),
|
|
3024
|
-
|
|
3025
|
-
type:
|
|
3026
|
-
sequence_number:
|
|
3027
|
-
error:
|
|
3028
|
-
type:
|
|
3029
|
-
code:
|
|
3030
|
-
message:
|
|
3031
|
-
param:
|
|
3256
|
+
import_v418.z.object({
|
|
3257
|
+
type: import_v418.z.literal("error"),
|
|
3258
|
+
sequence_number: import_v418.z.number(),
|
|
3259
|
+
error: import_v418.z.object({
|
|
3260
|
+
type: import_v418.z.string(),
|
|
3261
|
+
code: import_v418.z.string(),
|
|
3262
|
+
message: import_v418.z.string(),
|
|
3263
|
+
param: import_v418.z.string().nullish()
|
|
3032
3264
|
})
|
|
3033
3265
|
}),
|
|
3034
|
-
|
|
3266
|
+
import_v418.z.object({ type: import_v418.z.string() }).loose().transform((value) => ({
|
|
3035
3267
|
type: "unknown_chunk",
|
|
3036
3268
|
message: value.type
|
|
3037
3269
|
}))
|
|
@@ -3039,389 +3271,203 @@ var openaiResponsesChunkSchema = (0, import_provider_utils22.lazyValidator)(
|
|
|
3039
3271
|
])
|
|
3040
3272
|
)
|
|
3041
3273
|
);
|
|
3042
|
-
var openaiResponsesResponseSchema = (0,
|
|
3043
|
-
() => (0,
|
|
3044
|
-
|
|
3045
|
-
id:
|
|
3046
|
-
created_at:
|
|
3047
|
-
error:
|
|
3048
|
-
message:
|
|
3049
|
-
type:
|
|
3050
|
-
param:
|
|
3051
|
-
code:
|
|
3274
|
+
var openaiResponsesResponseSchema = (0, import_provider_utils23.lazyValidator)(
|
|
3275
|
+
() => (0, import_provider_utils23.zodSchema)(
|
|
3276
|
+
import_v418.z.object({
|
|
3277
|
+
id: import_v418.z.string().optional(),
|
|
3278
|
+
created_at: import_v418.z.number().optional(),
|
|
3279
|
+
error: import_v418.z.object({
|
|
3280
|
+
message: import_v418.z.string(),
|
|
3281
|
+
type: import_v418.z.string(),
|
|
3282
|
+
param: import_v418.z.string().nullish(),
|
|
3283
|
+
code: import_v418.z.string()
|
|
3052
3284
|
}).nullish(),
|
|
3053
|
-
model:
|
|
3054
|
-
output:
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
type:
|
|
3058
|
-
role:
|
|
3059
|
-
id:
|
|
3060
|
-
phase:
|
|
3061
|
-
content:
|
|
3062
|
-
|
|
3063
|
-
type:
|
|
3064
|
-
text:
|
|
3065
|
-
logprobs:
|
|
3066
|
-
|
|
3067
|
-
token:
|
|
3068
|
-
logprob:
|
|
3069
|
-
top_logprobs:
|
|
3070
|
-
|
|
3071
|
-
token:
|
|
3072
|
-
logprob:
|
|
3285
|
+
model: import_v418.z.string().optional(),
|
|
3286
|
+
output: import_v418.z.array(
|
|
3287
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3288
|
+
import_v418.z.object({
|
|
3289
|
+
type: import_v418.z.literal("message"),
|
|
3290
|
+
role: import_v418.z.literal("assistant"),
|
|
3291
|
+
id: import_v418.z.string(),
|
|
3292
|
+
phase: import_v418.z.enum(["commentary", "final_answer"]).nullish(),
|
|
3293
|
+
content: import_v418.z.array(
|
|
3294
|
+
import_v418.z.object({
|
|
3295
|
+
type: import_v418.z.literal("output_text"),
|
|
3296
|
+
text: import_v418.z.string(),
|
|
3297
|
+
logprobs: import_v418.z.array(
|
|
3298
|
+
import_v418.z.object({
|
|
3299
|
+
token: import_v418.z.string(),
|
|
3300
|
+
logprob: import_v418.z.number(),
|
|
3301
|
+
top_logprobs: import_v418.z.array(
|
|
3302
|
+
import_v418.z.object({
|
|
3303
|
+
token: import_v418.z.string(),
|
|
3304
|
+
logprob: import_v418.z.number()
|
|
3073
3305
|
})
|
|
3074
3306
|
)
|
|
3075
3307
|
})
|
|
3076
3308
|
).nullish(),
|
|
3077
|
-
annotations:
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
type:
|
|
3081
|
-
start_index:
|
|
3082
|
-
end_index:
|
|
3083
|
-
url:
|
|
3084
|
-
title:
|
|
3309
|
+
annotations: import_v418.z.array(
|
|
3310
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3311
|
+
import_v418.z.object({
|
|
3312
|
+
type: import_v418.z.literal("url_citation"),
|
|
3313
|
+
start_index: import_v418.z.number(),
|
|
3314
|
+
end_index: import_v418.z.number(),
|
|
3315
|
+
url: import_v418.z.string(),
|
|
3316
|
+
title: import_v418.z.string()
|
|
3085
3317
|
}),
|
|
3086
|
-
|
|
3087
|
-
type:
|
|
3088
|
-
file_id:
|
|
3089
|
-
filename:
|
|
3090
|
-
index:
|
|
3091
|
-
start_index:
|
|
3092
|
-
end_index:
|
|
3093
|
-
quote:
|
|
3318
|
+
import_v418.z.object({
|
|
3319
|
+
type: import_v418.z.literal("file_citation"),
|
|
3320
|
+
file_id: import_v418.z.string(),
|
|
3321
|
+
filename: import_v418.z.string().nullish(),
|
|
3322
|
+
index: import_v418.z.number().nullish(),
|
|
3323
|
+
start_index: import_v418.z.number().nullish(),
|
|
3324
|
+
end_index: import_v418.z.number().nullish(),
|
|
3325
|
+
quote: import_v418.z.string().nullish()
|
|
3094
3326
|
}),
|
|
3095
|
-
|
|
3096
|
-
type:
|
|
3097
|
-
container_id:
|
|
3098
|
-
file_id:
|
|
3099
|
-
filename:
|
|
3100
|
-
start_index:
|
|
3101
|
-
end_index:
|
|
3102
|
-
index:
|
|
3327
|
+
import_v418.z.object({
|
|
3328
|
+
type: import_v418.z.literal("container_file_citation"),
|
|
3329
|
+
container_id: import_v418.z.string(),
|
|
3330
|
+
file_id: import_v418.z.string(),
|
|
3331
|
+
filename: import_v418.z.string().nullish(),
|
|
3332
|
+
start_index: import_v418.z.number().nullish(),
|
|
3333
|
+
end_index: import_v418.z.number().nullish(),
|
|
3334
|
+
index: import_v418.z.number().nullish()
|
|
3103
3335
|
}),
|
|
3104
|
-
|
|
3105
|
-
type:
|
|
3106
|
-
file_id:
|
|
3107
|
-
index:
|
|
3336
|
+
import_v418.z.object({
|
|
3337
|
+
type: import_v418.z.literal("file_path"),
|
|
3338
|
+
file_id: import_v418.z.string(),
|
|
3339
|
+
index: import_v418.z.number().nullish()
|
|
3108
3340
|
})
|
|
3109
3341
|
])
|
|
3110
3342
|
)
|
|
3111
3343
|
})
|
|
3112
3344
|
)
|
|
3113
3345
|
}),
|
|
3114
|
-
|
|
3115
|
-
type:
|
|
3116
|
-
id:
|
|
3117
|
-
status:
|
|
3118
|
-
action:
|
|
3119
|
-
|
|
3120
|
-
type:
|
|
3121
|
-
query:
|
|
3122
|
-
sources:
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
type:
|
|
3127
|
-
name:
|
|
3346
|
+
import_v418.z.object({
|
|
3347
|
+
type: import_v418.z.literal("web_search_call"),
|
|
3348
|
+
id: import_v418.z.string(),
|
|
3349
|
+
status: import_v418.z.string(),
|
|
3350
|
+
action: import_v418.z.discriminatedUnion("type", [
|
|
3351
|
+
import_v418.z.object({
|
|
3352
|
+
type: import_v418.z.literal("search"),
|
|
3353
|
+
query: import_v418.z.string().nullish(),
|
|
3354
|
+
sources: import_v418.z.array(
|
|
3355
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3356
|
+
import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
|
|
3357
|
+
import_v418.z.object({
|
|
3358
|
+
type: import_v418.z.literal("api"),
|
|
3359
|
+
name: import_v418.z.string()
|
|
3128
3360
|
})
|
|
3129
3361
|
])
|
|
3130
3362
|
).nullish()
|
|
3131
3363
|
}),
|
|
3132
|
-
|
|
3133
|
-
type:
|
|
3134
|
-
url:
|
|
3364
|
+
import_v418.z.object({
|
|
3365
|
+
type: import_v418.z.literal("open_page"),
|
|
3366
|
+
url: import_v418.z.string().nullish()
|
|
3135
3367
|
}),
|
|
3136
|
-
|
|
3137
|
-
type:
|
|
3138
|
-
url:
|
|
3139
|
-
pattern:
|
|
3368
|
+
import_v418.z.object({
|
|
3369
|
+
type: import_v418.z.literal("find_in_page"),
|
|
3370
|
+
url: import_v418.z.string().nullish(),
|
|
3371
|
+
pattern: import_v418.z.string().nullish()
|
|
3140
3372
|
})
|
|
3141
3373
|
]).nullish()
|
|
3142
3374
|
}),
|
|
3143
|
-
|
|
3144
|
-
type:
|
|
3145
|
-
id:
|
|
3146
|
-
queries:
|
|
3147
|
-
results:
|
|
3148
|
-
|
|
3149
|
-
attributes:
|
|
3150
|
-
|
|
3151
|
-
|
|
3375
|
+
import_v418.z.object({
|
|
3376
|
+
type: import_v418.z.literal("file_search_call"),
|
|
3377
|
+
id: import_v418.z.string(),
|
|
3378
|
+
queries: import_v418.z.array(import_v418.z.string()),
|
|
3379
|
+
results: import_v418.z.array(
|
|
3380
|
+
import_v418.z.object({
|
|
3381
|
+
attributes: import_v418.z.record(
|
|
3382
|
+
import_v418.z.string(),
|
|
3383
|
+
import_v418.z.union([import_v418.z.string(), import_v418.z.number(), import_v418.z.boolean()])
|
|
3152
3384
|
),
|
|
3153
|
-
file_id:
|
|
3154
|
-
filename:
|
|
3155
|
-
score:
|
|
3156
|
-
text:
|
|
3385
|
+
file_id: import_v418.z.string(),
|
|
3386
|
+
filename: import_v418.z.string(),
|
|
3387
|
+
score: import_v418.z.number(),
|
|
3388
|
+
text: import_v418.z.string()
|
|
3157
3389
|
})
|
|
3158
3390
|
).nullish()
|
|
3159
3391
|
}),
|
|
3160
|
-
|
|
3161
|
-
type:
|
|
3162
|
-
id:
|
|
3163
|
-
code:
|
|
3164
|
-
container_id:
|
|
3165
|
-
outputs:
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3392
|
+
import_v418.z.object({
|
|
3393
|
+
type: import_v418.z.literal("code_interpreter_call"),
|
|
3394
|
+
id: import_v418.z.string(),
|
|
3395
|
+
code: import_v418.z.string().nullable(),
|
|
3396
|
+
container_id: import_v418.z.string(),
|
|
3397
|
+
outputs: import_v418.z.array(
|
|
3398
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3399
|
+
import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
|
|
3400
|
+
import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
|
|
3169
3401
|
])
|
|
3170
3402
|
).nullable()
|
|
3171
3403
|
}),
|
|
3172
|
-
|
|
3173
|
-
type:
|
|
3174
|
-
id:
|
|
3175
|
-
result:
|
|
3404
|
+
import_v418.z.object({
|
|
3405
|
+
type: import_v418.z.literal("image_generation_call"),
|
|
3406
|
+
id: import_v418.z.string(),
|
|
3407
|
+
result: import_v418.z.string()
|
|
3176
3408
|
}),
|
|
3177
|
-
|
|
3178
|
-
type:
|
|
3179
|
-
id:
|
|
3180
|
-
call_id:
|
|
3181
|
-
action:
|
|
3182
|
-
type:
|
|
3183
|
-
command:
|
|
3184
|
-
timeout_ms:
|
|
3185
|
-
user:
|
|
3186
|
-
working_directory:
|
|
3187
|
-
env:
|
|
3409
|
+
import_v418.z.object({
|
|
3410
|
+
type: import_v418.z.literal("local_shell_call"),
|
|
3411
|
+
id: import_v418.z.string(),
|
|
3412
|
+
call_id: import_v418.z.string(),
|
|
3413
|
+
action: import_v418.z.object({
|
|
3414
|
+
type: import_v418.z.literal("exec"),
|
|
3415
|
+
command: import_v418.z.array(import_v418.z.string()),
|
|
3416
|
+
timeout_ms: import_v418.z.number().optional(),
|
|
3417
|
+
user: import_v418.z.string().optional(),
|
|
3418
|
+
working_directory: import_v418.z.string().optional(),
|
|
3419
|
+
env: import_v418.z.record(import_v418.z.string(), import_v418.z.string()).optional()
|
|
3188
3420
|
})
|
|
3189
3421
|
}),
|
|
3190
|
-
|
|
3191
|
-
type:
|
|
3192
|
-
call_id:
|
|
3193
|
-
name:
|
|
3194
|
-
arguments:
|
|
3195
|
-
id:
|
|
3196
|
-
async:
|
|
3422
|
+
import_v418.z.object({
|
|
3423
|
+
type: import_v418.z.literal("function_call"),
|
|
3424
|
+
call_id: import_v418.z.string(),
|
|
3425
|
+
name: import_v418.z.string(),
|
|
3426
|
+
arguments: import_v418.z.string(),
|
|
3427
|
+
id: import_v418.z.string(),
|
|
3428
|
+
async: import_v418.z.boolean().nullish()
|
|
3197
3429
|
}),
|
|
3198
|
-
|
|
3199
|
-
type:
|
|
3200
|
-
id:
|
|
3201
|
-
status:
|
|
3430
|
+
import_v418.z.object({
|
|
3431
|
+
type: import_v418.z.literal("computer_call"),
|
|
3432
|
+
id: import_v418.z.string(),
|
|
3433
|
+
status: import_v418.z.string().optional()
|
|
3202
3434
|
}),
|
|
3203
|
-
|
|
3204
|
-
type:
|
|
3205
|
-
id:
|
|
3206
|
-
encrypted_content:
|
|
3207
|
-
summary:
|
|
3208
|
-
|
|
3209
|
-
type:
|
|
3210
|
-
text:
|
|
3435
|
+
import_v418.z.object({
|
|
3436
|
+
type: import_v418.z.literal("reasoning"),
|
|
3437
|
+
id: import_v418.z.string(),
|
|
3438
|
+
encrypted_content: import_v418.z.string().nullish(),
|
|
3439
|
+
summary: import_v418.z.array(
|
|
3440
|
+
import_v418.z.object({
|
|
3441
|
+
type: import_v418.z.literal("summary_text"),
|
|
3442
|
+
text: import_v418.z.string()
|
|
3211
3443
|
})
|
|
3212
3444
|
)
|
|
3213
3445
|
})
|
|
3214
3446
|
])
|
|
3215
3447
|
).optional(),
|
|
3216
|
-
service_tier:
|
|
3217
|
-
reasoning:
|
|
3218
|
-
context:
|
|
3448
|
+
service_tier: import_v418.z.string().nullish(),
|
|
3449
|
+
reasoning: import_v418.z.object({
|
|
3450
|
+
context: import_v418.z.string().nullish()
|
|
3219
3451
|
}).nullish(),
|
|
3220
|
-
incomplete_details:
|
|
3221
|
-
usage:
|
|
3222
|
-
input_tokens:
|
|
3223
|
-
input_tokens_details:
|
|
3224
|
-
cached_tokens:
|
|
3225
|
-
cache_write_tokens:
|
|
3226
|
-
orchestration_input_tokens:
|
|
3227
|
-
orchestration_input_cached_tokens:
|
|
3452
|
+
incomplete_details: import_v418.z.object({ reason: import_v418.z.string() }).nullish(),
|
|
3453
|
+
usage: import_v418.z.object({
|
|
3454
|
+
input_tokens: import_v418.z.number(),
|
|
3455
|
+
input_tokens_details: import_v418.z.object({
|
|
3456
|
+
cached_tokens: import_v418.z.number().nullish(),
|
|
3457
|
+
cache_write_tokens: import_v418.z.number().nullish(),
|
|
3458
|
+
orchestration_input_tokens: import_v418.z.number().nullish(),
|
|
3459
|
+
orchestration_input_cached_tokens: import_v418.z.number().nullish()
|
|
3228
3460
|
}).nullish(),
|
|
3229
|
-
output_tokens:
|
|
3230
|
-
output_tokens_details:
|
|
3231
|
-
reasoning_tokens:
|
|
3232
|
-
orchestration_output_tokens:
|
|
3461
|
+
output_tokens: import_v418.z.number(),
|
|
3462
|
+
output_tokens_details: import_v418.z.object({
|
|
3463
|
+
reasoning_tokens: import_v418.z.number().nullish(),
|
|
3464
|
+
orchestration_output_tokens: import_v418.z.number().nullish()
|
|
3233
3465
|
}).nullish()
|
|
3234
3466
|
}).optional()
|
|
3235
3467
|
})
|
|
3236
3468
|
)
|
|
3237
3469
|
);
|
|
3238
3470
|
|
|
3239
|
-
// src/responses/openai-responses-options.ts
|
|
3240
|
-
var import_provider_utils23 = require("@ai-sdk/provider-utils");
|
|
3241
|
-
var import_v418 = require("zod/v4");
|
|
3242
|
-
var TOP_LOGPROBS_MAX = 20;
|
|
3243
|
-
var openaiResponsesReasoningModelIds = [
|
|
3244
|
-
"o1",
|
|
3245
|
-
"o1-2024-12-17",
|
|
3246
|
-
"o3",
|
|
3247
|
-
"o3-2025-04-16",
|
|
3248
|
-
"o3-deep-research",
|
|
3249
|
-
"o3-deep-research-2025-06-26",
|
|
3250
|
-
"o3-mini",
|
|
3251
|
-
"o3-mini-2025-01-31",
|
|
3252
|
-
"o4-mini",
|
|
3253
|
-
"o4-mini-2025-04-16",
|
|
3254
|
-
"o4-mini-deep-research",
|
|
3255
|
-
"o4-mini-deep-research-2025-06-26",
|
|
3256
|
-
"codex-mini-latest",
|
|
3257
|
-
"computer-use-preview",
|
|
3258
|
-
"gpt-5",
|
|
3259
|
-
"gpt-5-2025-08-07",
|
|
3260
|
-
"gpt-5-codex",
|
|
3261
|
-
"gpt-5-mini",
|
|
3262
|
-
"gpt-5-mini-2025-08-07",
|
|
3263
|
-
"gpt-5-nano",
|
|
3264
|
-
"gpt-5-nano-2025-08-07",
|
|
3265
|
-
"gpt-5-pro",
|
|
3266
|
-
"gpt-5-pro-2025-10-06",
|
|
3267
|
-
"gpt-5.1",
|
|
3268
|
-
"gpt-5.1-chat-latest",
|
|
3269
|
-
"gpt-5.1-codex-mini",
|
|
3270
|
-
"gpt-5.1-codex",
|
|
3271
|
-
"gpt-5.1-codex-max",
|
|
3272
|
-
"gpt-5.2",
|
|
3273
|
-
"gpt-5.2-chat-latest",
|
|
3274
|
-
"gpt-5.2-pro",
|
|
3275
|
-
"gpt-5.2-codex",
|
|
3276
|
-
"gpt-5.3-chat-latest",
|
|
3277
|
-
"gpt-5.3-codex",
|
|
3278
|
-
"gpt-5.4",
|
|
3279
|
-
"gpt-5.4-2026-03-05",
|
|
3280
|
-
"gpt-5.4-mini",
|
|
3281
|
-
"gpt-5.4-mini-2026-03-17",
|
|
3282
|
-
"gpt-5.4-nano",
|
|
3283
|
-
"gpt-5.4-nano-2026-03-17",
|
|
3284
|
-
"gpt-5.4-pro",
|
|
3285
|
-
"gpt-5.4-pro-2026-03-05",
|
|
3286
|
-
"gpt-5.6",
|
|
3287
|
-
"gpt-5.6-luna",
|
|
3288
|
-
"gpt-5.6-sol",
|
|
3289
|
-
"gpt-5.6-terra",
|
|
3290
|
-
"gpt-6-astra",
|
|
3291
|
-
"gpt-6-luna",
|
|
3292
|
-
"gpt-6-sol"
|
|
3293
|
-
];
|
|
3294
|
-
var openaiResponsesModelIds = [
|
|
3295
|
-
"gpt-4.1",
|
|
3296
|
-
"gpt-4.1-2025-04-14",
|
|
3297
|
-
"gpt-4.1-mini",
|
|
3298
|
-
"gpt-4.1-mini-2025-04-14",
|
|
3299
|
-
"gpt-4.1-nano",
|
|
3300
|
-
"gpt-4.1-nano-2025-04-14",
|
|
3301
|
-
"gpt-4o",
|
|
3302
|
-
"gpt-4o-2024-05-13",
|
|
3303
|
-
"gpt-4o-2024-08-06",
|
|
3304
|
-
"gpt-4o-2024-11-20",
|
|
3305
|
-
"gpt-4o-audio-preview",
|
|
3306
|
-
"gpt-4o-audio-preview-2024-10-01",
|
|
3307
|
-
"gpt-4o-audio-preview-2024-12-17",
|
|
3308
|
-
"gpt-4o-search-preview",
|
|
3309
|
-
"gpt-4o-search-preview-2025-03-11",
|
|
3310
|
-
"gpt-4o-mini-search-preview",
|
|
3311
|
-
"gpt-4o-mini-search-preview-2025-03-11",
|
|
3312
|
-
"gpt-4o-mini",
|
|
3313
|
-
"gpt-4o-mini-2024-07-18",
|
|
3314
|
-
"gpt-4-turbo",
|
|
3315
|
-
"gpt-4-turbo-2024-04-09",
|
|
3316
|
-
"gpt-4-turbo-preview",
|
|
3317
|
-
"gpt-4-0125-preview",
|
|
3318
|
-
"gpt-4-1106-preview",
|
|
3319
|
-
"gpt-4",
|
|
3320
|
-
"gpt-4-0613",
|
|
3321
|
-
"gpt-4.5-preview",
|
|
3322
|
-
"gpt-4.5-preview-2025-02-27",
|
|
3323
|
-
"gpt-3.5-turbo-0125",
|
|
3324
|
-
"gpt-3.5-turbo",
|
|
3325
|
-
"gpt-3.5-turbo-1106",
|
|
3326
|
-
"chatgpt-4o-latest",
|
|
3327
|
-
"gpt-5-chat-latest",
|
|
3328
|
-
...openaiResponsesReasoningModelIds
|
|
3329
|
-
];
|
|
3330
|
-
var openaiResponsesProviderOptionsSchema = (0, import_provider_utils23.lazyValidator)(
|
|
3331
|
-
() => (0, import_provider_utils23.zodSchema)(
|
|
3332
|
-
import_v418.z.object({
|
|
3333
|
-
conversation: import_v418.z.string().nullish(),
|
|
3334
|
-
include: import_v418.z.array(
|
|
3335
|
-
import_v418.z.enum([
|
|
3336
|
-
"reasoning.encrypted_content",
|
|
3337
|
-
// handled internally by default, only needed for unknown reasoning models
|
|
3338
|
-
"file_search_call.results",
|
|
3339
|
-
"message.output_text.logprobs"
|
|
3340
|
-
])
|
|
3341
|
-
).nullish(),
|
|
3342
|
-
instructions: import_v418.z.string().nullish(),
|
|
3343
|
-
/**
|
|
3344
|
-
* Return the log probabilities of the tokens.
|
|
3345
|
-
*
|
|
3346
|
-
* Setting to true will return the log probabilities of the tokens that
|
|
3347
|
-
* were generated.
|
|
3348
|
-
*
|
|
3349
|
-
* Setting to a number will return the log probabilities of the top n
|
|
3350
|
-
* tokens that were generated.
|
|
3351
|
-
*
|
|
3352
|
-
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
3353
|
-
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
3354
|
-
*/
|
|
3355
|
-
logprobs: import_v418.z.union([import_v418.z.boolean(), import_v418.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
3356
|
-
/**
|
|
3357
|
-
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
3358
|
-
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
3359
|
-
* Any further attempts to call a tool by the model will be ignored.
|
|
3360
|
-
*/
|
|
3361
|
-
maxToolCalls: import_v418.z.number().nullish(),
|
|
3362
|
-
metadata: import_v418.z.any().nullish(),
|
|
3363
|
-
parallelToolCalls: import_v418.z.boolean().nullish(),
|
|
3364
|
-
previousResponseId: import_v418.z.string().nullish(),
|
|
3365
|
-
promptCacheKey: import_v418.z.string().nullish(),
|
|
3366
|
-
/**
|
|
3367
|
-
* Prompt cache behavior for GPT-5.6 and later models.
|
|
3368
|
-
* `mode` controls whether OpenAI also places an implicit breakpoint.
|
|
3369
|
-
* `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
|
|
3370
|
-
*/
|
|
3371
|
-
promptCacheOptions: import_v418.z.object({
|
|
3372
|
-
mode: import_v418.z.enum(["implicit", "explicit"]).optional(),
|
|
3373
|
-
ttl: import_v418.z.literal("30m").optional()
|
|
3374
|
-
}).optional(),
|
|
3375
|
-
/**
|
|
3376
|
-
* The retention policy for the prompt cache.
|
|
3377
|
-
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
3378
|
-
* - '24h': Extended prompt caching that keeps cached prefixes active for up to 24 hours.
|
|
3379
|
-
* Available for models before GPT-5.6 that support extended caching.
|
|
3380
|
-
*
|
|
3381
|
-
* @deprecated For GPT-5.6 and later models, use `promptCacheOptions.ttl`.
|
|
3382
|
-
*
|
|
3383
|
-
* @default 'in_memory'
|
|
3384
|
-
*/
|
|
3385
|
-
promptCacheRetention: import_v418.z.enum(["in_memory", "24h"]).nullish(),
|
|
3386
|
-
/**
|
|
3387
|
-
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
3388
|
-
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
3389
|
-
* GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
3390
|
-
* Supported values vary by model.
|
|
3391
|
-
*/
|
|
3392
|
-
reasoningEffort: import_v418.z.string().nullish(),
|
|
3393
|
-
/**
|
|
3394
|
-
* Updates the reasoning effort for GPT-6 and later models starting with this response
|
|
3395
|
-
* without changing the request-level reasoning effort. This preserves the
|
|
3396
|
-
* request prefix for prompt caching.
|
|
3397
|
-
*
|
|
3398
|
-
* Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be
|
|
3399
|
-
* combined with automatic truncation.
|
|
3400
|
-
*/
|
|
3401
|
-
reasoningEffortUpdate: import_v418.z.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
3402
|
-
/**
|
|
3403
|
-
* Controls how much model work GPT-5.6 performs before returning a final answer.
|
|
3404
|
-
* `standard` is the default. `pro` increases quality, latency, and token usage.
|
|
3405
|
-
*/
|
|
3406
|
-
reasoningMode: import_v418.z.enum(["standard", "pro"]).optional(),
|
|
3407
|
-
/**
|
|
3408
|
-
* Controls which available reasoning items GPT-5.6 can use.
|
|
3409
|
-
* `auto` uses the model default, `current_turn` excludes reasoning from earlier
|
|
3410
|
-
* turns, and `all_turns` makes compatible earlier reasoning available.
|
|
3411
|
-
*/
|
|
3412
|
-
reasoningContext: import_v418.z.enum(["auto", "current_turn", "all_turns"]).optional(),
|
|
3413
|
-
reasoningSummary: import_v418.z.string().nullish(),
|
|
3414
|
-
safetyIdentifier: import_v418.z.string().nullish(),
|
|
3415
|
-
serviceTier: import_v418.z.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
3416
|
-
store: import_v418.z.boolean().nullish(),
|
|
3417
|
-
strictJsonSchema: import_v418.z.boolean().nullish(),
|
|
3418
|
-
textVerbosity: import_v418.z.enum(["low", "medium", "high"]).nullish(),
|
|
3419
|
-
truncation: import_v418.z.enum(["auto", "disabled"]).nullish(),
|
|
3420
|
-
user: import_v418.z.string().nullish()
|
|
3421
|
-
})
|
|
3422
|
-
)
|
|
3423
|
-
);
|
|
3424
|
-
|
|
3425
3471
|
// src/responses/openai-responses-prepare-tools.ts
|
|
3426
3472
|
var import_provider7 = require("@ai-sdk/provider");
|
|
3427
3473
|
var import_provider_utils24 = require("@ai-sdk/provider-utils");
|
|
@@ -3594,6 +3640,18 @@ function resolveAsyncToolOption({
|
|
|
3594
3640
|
}
|
|
3595
3641
|
|
|
3596
3642
|
// src/responses/openai-responses-language-model.ts
|
|
3643
|
+
function getConfigurationUpdateUnsupportedReason({
|
|
3644
|
+
modelCapabilities,
|
|
3645
|
+
options
|
|
3646
|
+
}) {
|
|
3647
|
+
if (!modelCapabilities.supportsConfigurationUpdate) {
|
|
3648
|
+
return "reasoningEffortUpdate is only supported by GPT-6 and later models";
|
|
3649
|
+
}
|
|
3650
|
+
if ((options == null ? void 0 : options.reasoningMode) === "pro" || (options == null ? void 0 : options.truncation) === "auto") {
|
|
3651
|
+
return "reasoningEffortUpdate requires standard reasoning mode without automatic truncation";
|
|
3652
|
+
}
|
|
3653
|
+
return void 0;
|
|
3654
|
+
}
|
|
3597
3655
|
var OpenAIResponsesLanguageModel = class {
|
|
3598
3656
|
constructor(modelId, config) {
|
|
3599
3657
|
this.specificationVersion = "v2";
|
|
@@ -3658,8 +3716,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3658
3716
|
details: "conversation and previousResponseId cannot be used together"
|
|
3659
3717
|
});
|
|
3660
3718
|
}
|
|
3719
|
+
const configurationUpdateUnsupportedReason = getConfigurationUpdateUnsupportedReason({
|
|
3720
|
+
modelCapabilities,
|
|
3721
|
+
options: openaiOptions
|
|
3722
|
+
});
|
|
3661
3723
|
const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
|
|
3662
3724
|
prompt,
|
|
3725
|
+
configurationUpdateUnsupportedReason,
|
|
3726
|
+
providerOptionsName: this.config.provider.includes("azure") ? "azure" : "openai",
|
|
3663
3727
|
systemMessageMode: modelCapabilities.systemMessageMode,
|
|
3664
3728
|
explicitMessageItemType: this.config.explicitMessageItemType,
|
|
3665
3729
|
fileIdPrefixes: this.config.fileIdPrefixes,
|
|
@@ -3679,18 +3743,27 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3679
3743
|
resolvedReasoningEffort = void 0;
|
|
3680
3744
|
}
|
|
3681
3745
|
const reasoningEffortUpdate = openaiOptions == null ? void 0 : openaiOptions.reasoningEffortUpdate;
|
|
3682
|
-
|
|
3683
|
-
if (reasoningEffortUpdate != null && !configurationUpdateIsSupported) {
|
|
3746
|
+
if (reasoningEffortUpdate != null && configurationUpdateUnsupportedReason != null) {
|
|
3684
3747
|
warnings.push({
|
|
3685
3748
|
type: "unsupported-setting",
|
|
3686
3749
|
setting: "reasoningEffortUpdate",
|
|
3687
|
-
details:
|
|
3750
|
+
details: configurationUpdateUnsupportedReason
|
|
3688
3751
|
});
|
|
3689
3752
|
} else if (reasoningEffortUpdate != null) {
|
|
3690
|
-
input
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3753
|
+
const firstItem = input[0];
|
|
3754
|
+
if ((firstItem == null ? void 0 : firstItem.type) !== "configuration_update" || firstItem.reasoning.effort !== reasoningEffortUpdate) {
|
|
3755
|
+
input.unshift({
|
|
3756
|
+
type: "configuration_update",
|
|
3757
|
+
reasoning: { effort: reasoningEffortUpdate }
|
|
3758
|
+
});
|
|
3759
|
+
}
|
|
3760
|
+
}
|
|
3761
|
+
for (let i = 1; i < input.length; i++) {
|
|
3762
|
+
if (input[i - 1].type === "configuration_update" && input[i].type === "configuration_update") {
|
|
3763
|
+
throw new import_provider8.UnsupportedFunctionalityError({
|
|
3764
|
+
functionality: "Adjacent reasoning effort configuration updates"
|
|
3765
|
+
});
|
|
3766
|
+
}
|
|
3694
3767
|
}
|
|
3695
3768
|
const strictJsonSchema = (_b = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _b : false;
|
|
3696
3769
|
let include = openaiOptions == null ? void 0 : openaiOptions.include;
|
|
@@ -5143,7 +5216,7 @@ var OpenAITranscriptionModel = class {
|
|
|
5143
5216
|
};
|
|
5144
5217
|
|
|
5145
5218
|
// src/version.ts
|
|
5146
|
-
var VERSION = true ? "2.0.
|
|
5219
|
+
var VERSION = true ? "2.0.130" : "0.0.0-test";
|
|
5147
5220
|
|
|
5148
5221
|
// src/openai-provider.ts
|
|
5149
5222
|
function createOpenAI(options = {}) {
|