@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/index.js
CHANGED
|
@@ -2377,11 +2377,24 @@ var import_provider_utils25 = require("@ai-sdk/provider-utils");
|
|
|
2377
2377
|
// src/responses/convert-to-openai-responses-input.ts
|
|
2378
2378
|
var import_provider6 = require("@ai-sdk/provider");
|
|
2379
2379
|
var import_provider_utils22 = require("@ai-sdk/provider-utils");
|
|
2380
|
-
var
|
|
2380
|
+
var import_v418 = require("zod/v4");
|
|
2381
|
+
|
|
2382
|
+
// src/responses/openai-responses-text-format.ts
|
|
2383
|
+
var import_v416 = require("zod/v4");
|
|
2384
|
+
var openaiResponsesTextFormatSchema = () => import_v416.z.discriminatedUnion("type", [
|
|
2385
|
+
import_v416.z.object({ type: import_v416.z.literal("text") }),
|
|
2386
|
+
import_v416.z.object({
|
|
2387
|
+
type: import_v416.z.literal("json_schema"),
|
|
2388
|
+
name: import_v416.z.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/),
|
|
2389
|
+
schema: import_v416.z.record(import_v416.z.string(), import_v416.z.json()),
|
|
2390
|
+
description: import_v416.z.string().optional(),
|
|
2391
|
+
strict: import_v416.z.boolean().optional()
|
|
2392
|
+
})
|
|
2393
|
+
]);
|
|
2381
2394
|
|
|
2382
2395
|
// src/responses/openai-responses-options.ts
|
|
2383
2396
|
var import_provider_utils21 = require("@ai-sdk/provider-utils");
|
|
2384
|
-
var
|
|
2397
|
+
var import_v417 = require("zod/v4");
|
|
2385
2398
|
var TOP_LOGPROBS_MAX = 20;
|
|
2386
2399
|
var openaiResponsesReasoningModelIds = [
|
|
2387
2400
|
"o1",
|
|
@@ -2473,17 +2486,17 @@ var openaiResponsesModelIds = [
|
|
|
2473
2486
|
];
|
|
2474
2487
|
var openaiResponsesProviderOptionsSchema = (0, import_provider_utils21.lazyValidator)(
|
|
2475
2488
|
() => (0, import_provider_utils21.zodSchema)(
|
|
2476
|
-
|
|
2477
|
-
conversation:
|
|
2478
|
-
include:
|
|
2479
|
-
|
|
2489
|
+
import_v417.z.object({
|
|
2490
|
+
conversation: import_v417.z.string().nullish(),
|
|
2491
|
+
include: import_v417.z.array(
|
|
2492
|
+
import_v417.z.enum([
|
|
2480
2493
|
"reasoning.encrypted_content",
|
|
2481
2494
|
// handled internally by default, only needed for unknown reasoning models
|
|
2482
2495
|
"file_search_call.results",
|
|
2483
2496
|
"message.output_text.logprobs"
|
|
2484
2497
|
])
|
|
2485
2498
|
).nullish(),
|
|
2486
|
-
instructions:
|
|
2499
|
+
instructions: import_v417.z.string().nullish(),
|
|
2487
2500
|
/**
|
|
2488
2501
|
* Return the log probabilities of the tokens.
|
|
2489
2502
|
*
|
|
@@ -2496,25 +2509,26 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils21.lazyValid
|
|
|
2496
2509
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
2497
2510
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
2498
2511
|
*/
|
|
2499
|
-
logprobs:
|
|
2512
|
+
logprobs: import_v417.z.union([import_v417.z.boolean(), import_v417.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
2500
2513
|
/**
|
|
2501
2514
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
2502
2515
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
2503
2516
|
* Any further attempts to call a tool by the model will be ignored.
|
|
2504
2517
|
*/
|
|
2505
|
-
maxToolCalls:
|
|
2506
|
-
metadata:
|
|
2507
|
-
parallelToolCalls:
|
|
2508
|
-
previousResponseId:
|
|
2509
|
-
promptCacheKey:
|
|
2518
|
+
maxToolCalls: import_v417.z.number().nullish(),
|
|
2519
|
+
metadata: import_v417.z.any().nullish(),
|
|
2520
|
+
parallelToolCalls: import_v417.z.boolean().nullish(),
|
|
2521
|
+
previousResponseId: import_v417.z.string().nullish(),
|
|
2522
|
+
promptCacheKey: import_v417.z.string().nullish(),
|
|
2510
2523
|
/**
|
|
2511
2524
|
* Prompt cache behavior for GPT-5.6 and later models.
|
|
2512
2525
|
* `mode` controls whether OpenAI also places an implicit breakpoint.
|
|
2513
2526
|
* `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
|
|
2514
2527
|
*/
|
|
2515
|
-
promptCacheOptions:
|
|
2516
|
-
|
|
2517
|
-
|
|
2528
|
+
promptCacheOptions: import_v417.z.object({
|
|
2529
|
+
comparisonResponseId: import_v417.z.string().optional(),
|
|
2530
|
+
mode: import_v417.z.enum(["implicit", "explicit"]).optional(),
|
|
2531
|
+
ttl: import_v417.z.literal("30m").optional()
|
|
2518
2532
|
}).optional(),
|
|
2519
2533
|
/**
|
|
2520
2534
|
* The retention policy for the prompt cache.
|
|
@@ -2526,14 +2540,14 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils21.lazyValid
|
|
|
2526
2540
|
*
|
|
2527
2541
|
* @default 'in_memory'
|
|
2528
2542
|
*/
|
|
2529
|
-
promptCacheRetention:
|
|
2543
|
+
promptCacheRetention: import_v417.z.enum(["in_memory", "24h"]).nullish(),
|
|
2530
2544
|
/**
|
|
2531
2545
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
2532
2546
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
2533
2547
|
* GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
2534
2548
|
* Supported values vary by model.
|
|
2535
2549
|
*/
|
|
2536
|
-
reasoningEffort:
|
|
2550
|
+
reasoningEffort: import_v417.z.string().nullish(),
|
|
2537
2551
|
/**
|
|
2538
2552
|
* Updates the reasoning effort for GPT-6 and later models starting with this response
|
|
2539
2553
|
* without changing the request-level reasoning effort. This preserves the
|
|
@@ -2542,32 +2556,36 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils21.lazyValid
|
|
|
2542
2556
|
* Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be
|
|
2543
2557
|
* combined with automatic truncation.
|
|
2544
2558
|
*/
|
|
2545
|
-
reasoningEffortUpdate:
|
|
2559
|
+
reasoningEffortUpdate: import_v417.z.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
2546
2560
|
/**
|
|
2547
2561
|
* Controls how much model work GPT-5.6 performs before returning a final answer.
|
|
2548
2562
|
* `standard` is the default. `pro` increases quality, latency, and token usage.
|
|
2549
2563
|
*/
|
|
2550
|
-
reasoningMode:
|
|
2564
|
+
reasoningMode: import_v417.z.enum(["standard", "pro"]).optional(),
|
|
2551
2565
|
/**
|
|
2552
2566
|
* Controls which available reasoning items GPT-5.6 can use.
|
|
2553
2567
|
* `auto` uses the model default, `current_turn` excludes reasoning from earlier
|
|
2554
2568
|
* turns, and `all_turns` makes compatible earlier reasoning available.
|
|
2555
2569
|
*/
|
|
2556
|
-
reasoningContext:
|
|
2557
|
-
reasoningSummary:
|
|
2558
|
-
safetyIdentifier:
|
|
2559
|
-
serviceTier:
|
|
2560
|
-
store:
|
|
2561
|
-
strictJsonSchema:
|
|
2562
|
-
textVerbosity:
|
|
2563
|
-
|
|
2564
|
-
|
|
2570
|
+
reasoningContext: import_v417.z.enum(["auto", "current_turn", "all_turns"]).optional(),
|
|
2571
|
+
reasoningSummary: import_v417.z.string().nullish(),
|
|
2572
|
+
safetyIdentifier: import_v417.z.string().nullish(),
|
|
2573
|
+
serviceTier: import_v417.z.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
2574
|
+
store: import_v417.z.boolean().nullish(),
|
|
2575
|
+
strictJsonSchema: import_v417.z.boolean().nullish(),
|
|
2576
|
+
textVerbosity: import_v417.z.enum(["low", "medium", "high"]).nullish(),
|
|
2577
|
+
/** Keep the initial wire format stable while Output validates the current schema. */
|
|
2578
|
+
textFormat: openaiResponsesTextFormatSchema().optional(),
|
|
2579
|
+
truncation: import_v417.z.enum(["auto", "disabled"]).nullish(),
|
|
2580
|
+
user: import_v417.z.string().nullish()
|
|
2565
2581
|
})
|
|
2566
2582
|
)
|
|
2567
2583
|
);
|
|
2568
2584
|
var openaiResponsesSystemMessageOptionsSchema = (0, import_provider_utils21.lazyValidator)(
|
|
2569
2585
|
() => (0, import_provider_utils21.zodSchema)(
|
|
2570
|
-
|
|
2586
|
+
import_v417.z.object({
|
|
2587
|
+
/** Replace the format at this position; requires empty system content. */
|
|
2588
|
+
textFormatUpdate: openaiResponsesTextFormatSchema().optional(),
|
|
2571
2589
|
/**
|
|
2572
2590
|
* Emit a configuration update at this position in Responses history.
|
|
2573
2591
|
* Requires empty system message content and the same supported
|
|
@@ -2576,7 +2594,7 @@ var openaiResponsesSystemMessageOptionsSchema = (0, import_provider_utils21.lazy
|
|
|
2576
2594
|
*
|
|
2577
2595
|
* @see https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation
|
|
2578
2596
|
*/
|
|
2579
|
-
reasoningEffortUpdate:
|
|
2597
|
+
reasoningEffortUpdate: import_v417.z.enum(["low", "medium", "high", "xhigh", "max"]).optional()
|
|
2580
2598
|
})
|
|
2581
2599
|
)
|
|
2582
2600
|
);
|
|
@@ -2671,17 +2689,24 @@ async function convertToOpenAIResponsesInput({
|
|
|
2671
2689
|
});
|
|
2672
2690
|
}
|
|
2673
2691
|
const effort = options == null ? void 0 : options.reasoningEffortUpdate;
|
|
2674
|
-
|
|
2675
|
-
|
|
2692
|
+
const textFormat = options == null ? void 0 : options.textFormatUpdate;
|
|
2693
|
+
if (effort != null || textFormat != null) {
|
|
2694
|
+
const feature = effort != null ? "reasoningEffortUpdate" : "textFormatUpdate";
|
|
2695
|
+
const unsupportedReason = content !== "" ? `Message-level ${feature} requires empty system message content.` : configurationUpdateUnsupportedReason;
|
|
2676
2696
|
if (unsupportedReason != null) {
|
|
2677
2697
|
throw new import_provider6.UnsupportedFunctionalityError({
|
|
2678
|
-
functionality:
|
|
2698
|
+
functionality: `Message-level ${feature}`,
|
|
2679
2699
|
message: unsupportedReason
|
|
2680
2700
|
});
|
|
2681
2701
|
}
|
|
2682
2702
|
input.push({
|
|
2683
2703
|
type: "configuration_update",
|
|
2684
|
-
reasoning: { effort }
|
|
2704
|
+
...effort != null && { reasoning: { effort } },
|
|
2705
|
+
...textFormat != null && {
|
|
2706
|
+
text: {
|
|
2707
|
+
format: textFormat
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2685
2710
|
});
|
|
2686
2711
|
break;
|
|
2687
2712
|
}
|
|
@@ -3051,9 +3076,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
3051
3076
|
}
|
|
3052
3077
|
var openaiResponsesReasoningProviderOptionsSchema = (0, import_provider_utils22.lazySchema)(
|
|
3053
3078
|
() => (0, import_provider_utils22.zodSchema)(
|
|
3054
|
-
|
|
3055
|
-
itemId:
|
|
3056
|
-
reasoningEncryptedContent:
|
|
3079
|
+
import_v418.z.object({
|
|
3080
|
+
itemId: import_v418.z.string().nullish(),
|
|
3081
|
+
reasoningEncryptedContent: import_v418.z.string().nullish()
|
|
3057
3082
|
})
|
|
3058
3083
|
)
|
|
3059
3084
|
);
|
|
@@ -3091,301 +3116,308 @@ function mapOpenAIResponseFinishReason({
|
|
|
3091
3116
|
|
|
3092
3117
|
// src/responses/openai-responses-api.ts
|
|
3093
3118
|
var import_provider_utils23 = require("@ai-sdk/provider-utils");
|
|
3094
|
-
var
|
|
3119
|
+
var import_v419 = require("zod/v4");
|
|
3120
|
+
var openaiResponsesPromptCacheDiagnosticsSchema = () => import_v419.z.object({
|
|
3121
|
+
type: import_v419.z.string(),
|
|
3122
|
+
reason: import_v419.z.string().nullish(),
|
|
3123
|
+
cache_missed_tokens: import_v419.z.number().nullish(),
|
|
3124
|
+
comparison_reusable_tokens: import_v419.z.number().nullish()
|
|
3125
|
+
});
|
|
3095
3126
|
var openaiResponsesChunkSchema = (0, import_provider_utils23.lazyValidator)(
|
|
3096
3127
|
() => (0, import_provider_utils23.zodSchema)(
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
type:
|
|
3100
|
-
item_id:
|
|
3101
|
-
delta:
|
|
3102
|
-
logprobs:
|
|
3103
|
-
|
|
3104
|
-
token:
|
|
3105
|
-
logprob:
|
|
3106
|
-
top_logprobs:
|
|
3107
|
-
|
|
3108
|
-
token:
|
|
3109
|
-
logprob:
|
|
3128
|
+
import_v419.z.union([
|
|
3129
|
+
import_v419.z.object({
|
|
3130
|
+
type: import_v419.z.literal("response.output_text.delta"),
|
|
3131
|
+
item_id: import_v419.z.string(),
|
|
3132
|
+
delta: import_v419.z.string(),
|
|
3133
|
+
logprobs: import_v419.z.array(
|
|
3134
|
+
import_v419.z.object({
|
|
3135
|
+
token: import_v419.z.string(),
|
|
3136
|
+
logprob: import_v419.z.number(),
|
|
3137
|
+
top_logprobs: import_v419.z.array(
|
|
3138
|
+
import_v419.z.object({
|
|
3139
|
+
token: import_v419.z.string(),
|
|
3140
|
+
logprob: import_v419.z.number()
|
|
3110
3141
|
})
|
|
3111
3142
|
)
|
|
3112
3143
|
})
|
|
3113
3144
|
).nullish()
|
|
3114
3145
|
}),
|
|
3115
|
-
|
|
3116
|
-
type:
|
|
3117
|
-
item_id:
|
|
3118
|
-
output_index:
|
|
3119
|
-
content_index:
|
|
3120
|
-
delta:
|
|
3146
|
+
import_v419.z.object({
|
|
3147
|
+
type: import_v419.z.literal("response.refusal.delta"),
|
|
3148
|
+
item_id: import_v419.z.string(),
|
|
3149
|
+
output_index: import_v419.z.number().nullish(),
|
|
3150
|
+
content_index: import_v419.z.number().nullish(),
|
|
3151
|
+
delta: import_v419.z.string()
|
|
3121
3152
|
}),
|
|
3122
|
-
|
|
3123
|
-
type:
|
|
3124
|
-
item_id:
|
|
3125
|
-
output_index:
|
|
3126
|
-
content_index:
|
|
3127
|
-
refusal:
|
|
3153
|
+
import_v419.z.object({
|
|
3154
|
+
type: import_v419.z.literal("response.refusal.done"),
|
|
3155
|
+
item_id: import_v419.z.string(),
|
|
3156
|
+
output_index: import_v419.z.number().nullish(),
|
|
3157
|
+
content_index: import_v419.z.number().nullish(),
|
|
3158
|
+
refusal: import_v419.z.string()
|
|
3128
3159
|
}),
|
|
3129
|
-
|
|
3130
|
-
type:
|
|
3131
|
-
response:
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3160
|
+
import_v419.z.object({
|
|
3161
|
+
type: import_v419.z.enum(["response.completed", "response.incomplete"]),
|
|
3162
|
+
response: import_v419.z.object({
|
|
3163
|
+
prompt_cache_diagnostics: openaiResponsesPromptCacheDiagnosticsSchema().nullish(),
|
|
3164
|
+
incomplete_details: import_v419.z.object({ reason: import_v419.z.string() }).nullish(),
|
|
3165
|
+
usage: import_v419.z.object({
|
|
3166
|
+
input_tokens: import_v419.z.number(),
|
|
3167
|
+
input_tokens_details: import_v419.z.object({
|
|
3168
|
+
cached_tokens: import_v419.z.number().nullish(),
|
|
3169
|
+
cache_write_tokens: import_v419.z.number().nullish(),
|
|
3170
|
+
orchestration_input_tokens: import_v419.z.number().nullish(),
|
|
3171
|
+
orchestration_input_cached_tokens: import_v419.z.number().nullish()
|
|
3140
3172
|
}).nullish(),
|
|
3141
|
-
output_tokens:
|
|
3142
|
-
output_tokens_details:
|
|
3143
|
-
reasoning_tokens:
|
|
3144
|
-
orchestration_output_tokens:
|
|
3173
|
+
output_tokens: import_v419.z.number(),
|
|
3174
|
+
output_tokens_details: import_v419.z.object({
|
|
3175
|
+
reasoning_tokens: import_v419.z.number().nullish(),
|
|
3176
|
+
orchestration_output_tokens: import_v419.z.number().nullish()
|
|
3145
3177
|
}).nullish()
|
|
3146
3178
|
}),
|
|
3147
|
-
reasoning:
|
|
3148
|
-
context:
|
|
3179
|
+
reasoning: import_v419.z.object({
|
|
3180
|
+
context: import_v419.z.string().nullish()
|
|
3149
3181
|
}).nullish(),
|
|
3150
|
-
service_tier:
|
|
3182
|
+
service_tier: import_v419.z.string().nullish()
|
|
3151
3183
|
})
|
|
3152
3184
|
}),
|
|
3153
|
-
|
|
3154
|
-
type:
|
|
3155
|
-
response:
|
|
3156
|
-
id:
|
|
3157
|
-
created_at:
|
|
3158
|
-
model:
|
|
3159
|
-
service_tier:
|
|
3185
|
+
import_v419.z.object({
|
|
3186
|
+
type: import_v419.z.literal("response.created"),
|
|
3187
|
+
response: import_v419.z.object({
|
|
3188
|
+
id: import_v419.z.string(),
|
|
3189
|
+
created_at: import_v419.z.number(),
|
|
3190
|
+
model: import_v419.z.string(),
|
|
3191
|
+
service_tier: import_v419.z.string().nullish()
|
|
3160
3192
|
})
|
|
3161
3193
|
}),
|
|
3162
|
-
|
|
3163
|
-
type:
|
|
3164
|
-
output_index:
|
|
3165
|
-
item:
|
|
3166
|
-
|
|
3167
|
-
type:
|
|
3168
|
-
id:
|
|
3169
|
-
phase:
|
|
3194
|
+
import_v419.z.object({
|
|
3195
|
+
type: import_v419.z.literal("response.output_item.added"),
|
|
3196
|
+
output_index: import_v419.z.number(),
|
|
3197
|
+
item: import_v419.z.discriminatedUnion("type", [
|
|
3198
|
+
import_v419.z.object({
|
|
3199
|
+
type: import_v419.z.literal("message"),
|
|
3200
|
+
id: import_v419.z.string(),
|
|
3201
|
+
phase: import_v419.z.enum(["commentary", "final_answer"]).nullish()
|
|
3170
3202
|
}),
|
|
3171
|
-
|
|
3172
|
-
type:
|
|
3173
|
-
id:
|
|
3174
|
-
encrypted_content:
|
|
3203
|
+
import_v419.z.object({
|
|
3204
|
+
type: import_v419.z.literal("reasoning"),
|
|
3205
|
+
id: import_v419.z.string(),
|
|
3206
|
+
encrypted_content: import_v419.z.string().nullish()
|
|
3175
3207
|
}),
|
|
3176
|
-
|
|
3177
|
-
type:
|
|
3178
|
-
id:
|
|
3179
|
-
call_id:
|
|
3180
|
-
name:
|
|
3181
|
-
arguments:
|
|
3182
|
-
async:
|
|
3208
|
+
import_v419.z.object({
|
|
3209
|
+
type: import_v419.z.literal("function_call"),
|
|
3210
|
+
id: import_v419.z.string(),
|
|
3211
|
+
call_id: import_v419.z.string(),
|
|
3212
|
+
name: import_v419.z.string(),
|
|
3213
|
+
arguments: import_v419.z.string(),
|
|
3214
|
+
async: import_v419.z.boolean().nullish()
|
|
3183
3215
|
}),
|
|
3184
|
-
|
|
3185
|
-
type:
|
|
3186
|
-
id:
|
|
3187
|
-
status:
|
|
3216
|
+
import_v419.z.object({
|
|
3217
|
+
type: import_v419.z.literal("web_search_call"),
|
|
3218
|
+
id: import_v419.z.string(),
|
|
3219
|
+
status: import_v419.z.string()
|
|
3188
3220
|
}),
|
|
3189
|
-
|
|
3190
|
-
type:
|
|
3191
|
-
id:
|
|
3192
|
-
status:
|
|
3221
|
+
import_v419.z.object({
|
|
3222
|
+
type: import_v419.z.literal("computer_call"),
|
|
3223
|
+
id: import_v419.z.string(),
|
|
3224
|
+
status: import_v419.z.string()
|
|
3193
3225
|
}),
|
|
3194
|
-
|
|
3195
|
-
type:
|
|
3196
|
-
id:
|
|
3226
|
+
import_v419.z.object({
|
|
3227
|
+
type: import_v419.z.literal("file_search_call"),
|
|
3228
|
+
id: import_v419.z.string()
|
|
3197
3229
|
}),
|
|
3198
|
-
|
|
3199
|
-
type:
|
|
3200
|
-
id:
|
|
3230
|
+
import_v419.z.object({
|
|
3231
|
+
type: import_v419.z.literal("image_generation_call"),
|
|
3232
|
+
id: import_v419.z.string()
|
|
3201
3233
|
}),
|
|
3202
|
-
|
|
3203
|
-
type:
|
|
3204
|
-
id:
|
|
3205
|
-
container_id:
|
|
3206
|
-
code:
|
|
3207
|
-
outputs:
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3234
|
+
import_v419.z.object({
|
|
3235
|
+
type: import_v419.z.literal("code_interpreter_call"),
|
|
3236
|
+
id: import_v419.z.string(),
|
|
3237
|
+
container_id: import_v419.z.string(),
|
|
3238
|
+
code: import_v419.z.string().nullable(),
|
|
3239
|
+
outputs: import_v419.z.array(
|
|
3240
|
+
import_v419.z.discriminatedUnion("type", [
|
|
3241
|
+
import_v419.z.object({ type: import_v419.z.literal("logs"), logs: import_v419.z.string() }),
|
|
3242
|
+
import_v419.z.object({ type: import_v419.z.literal("image"), url: import_v419.z.string() })
|
|
3211
3243
|
])
|
|
3212
3244
|
).nullable(),
|
|
3213
|
-
status:
|
|
3245
|
+
status: import_v419.z.string()
|
|
3214
3246
|
})
|
|
3215
3247
|
])
|
|
3216
3248
|
}),
|
|
3217
|
-
|
|
3218
|
-
type:
|
|
3219
|
-
output_index:
|
|
3220
|
-
item:
|
|
3221
|
-
|
|
3222
|
-
type:
|
|
3223
|
-
id:
|
|
3224
|
-
phase:
|
|
3249
|
+
import_v419.z.object({
|
|
3250
|
+
type: import_v419.z.literal("response.output_item.done"),
|
|
3251
|
+
output_index: import_v419.z.number(),
|
|
3252
|
+
item: import_v419.z.discriminatedUnion("type", [
|
|
3253
|
+
import_v419.z.object({
|
|
3254
|
+
type: import_v419.z.literal("message"),
|
|
3255
|
+
id: import_v419.z.string(),
|
|
3256
|
+
phase: import_v419.z.enum(["commentary", "final_answer"]).nullish()
|
|
3225
3257
|
}),
|
|
3226
|
-
|
|
3227
|
-
type:
|
|
3228
|
-
id:
|
|
3229
|
-
encrypted_content:
|
|
3258
|
+
import_v419.z.object({
|
|
3259
|
+
type: import_v419.z.literal("reasoning"),
|
|
3260
|
+
id: import_v419.z.string(),
|
|
3261
|
+
encrypted_content: import_v419.z.string().nullish()
|
|
3230
3262
|
}),
|
|
3231
|
-
|
|
3232
|
-
type:
|
|
3233
|
-
id:
|
|
3234
|
-
call_id:
|
|
3235
|
-
name:
|
|
3236
|
-
arguments:
|
|
3237
|
-
async:
|
|
3238
|
-
status:
|
|
3263
|
+
import_v419.z.object({
|
|
3264
|
+
type: import_v419.z.literal("function_call"),
|
|
3265
|
+
id: import_v419.z.string(),
|
|
3266
|
+
call_id: import_v419.z.string(),
|
|
3267
|
+
name: import_v419.z.string(),
|
|
3268
|
+
arguments: import_v419.z.string(),
|
|
3269
|
+
async: import_v419.z.boolean().nullish(),
|
|
3270
|
+
status: import_v419.z.enum(["in_progress", "completed", "incomplete"])
|
|
3239
3271
|
}),
|
|
3240
|
-
|
|
3241
|
-
type:
|
|
3242
|
-
id:
|
|
3243
|
-
code:
|
|
3244
|
-
container_id:
|
|
3245
|
-
outputs:
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3272
|
+
import_v419.z.object({
|
|
3273
|
+
type: import_v419.z.literal("code_interpreter_call"),
|
|
3274
|
+
id: import_v419.z.string(),
|
|
3275
|
+
code: import_v419.z.string().nullable(),
|
|
3276
|
+
container_id: import_v419.z.string(),
|
|
3277
|
+
outputs: import_v419.z.array(
|
|
3278
|
+
import_v419.z.discriminatedUnion("type", [
|
|
3279
|
+
import_v419.z.object({ type: import_v419.z.literal("logs"), logs: import_v419.z.string() }),
|
|
3280
|
+
import_v419.z.object({ type: import_v419.z.literal("image"), url: import_v419.z.string() })
|
|
3249
3281
|
])
|
|
3250
3282
|
).nullable()
|
|
3251
3283
|
}),
|
|
3252
|
-
|
|
3253
|
-
type:
|
|
3254
|
-
id:
|
|
3255
|
-
result:
|
|
3284
|
+
import_v419.z.object({
|
|
3285
|
+
type: import_v419.z.literal("image_generation_call"),
|
|
3286
|
+
id: import_v419.z.string(),
|
|
3287
|
+
result: import_v419.z.string()
|
|
3256
3288
|
}),
|
|
3257
|
-
|
|
3258
|
-
type:
|
|
3259
|
-
id:
|
|
3260
|
-
status:
|
|
3261
|
-
action:
|
|
3262
|
-
|
|
3263
|
-
type:
|
|
3264
|
-
query:
|
|
3265
|
-
sources:
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3289
|
+
import_v419.z.object({
|
|
3290
|
+
type: import_v419.z.literal("web_search_call"),
|
|
3291
|
+
id: import_v419.z.string(),
|
|
3292
|
+
status: import_v419.z.string(),
|
|
3293
|
+
action: import_v419.z.discriminatedUnion("type", [
|
|
3294
|
+
import_v419.z.object({
|
|
3295
|
+
type: import_v419.z.literal("search"),
|
|
3296
|
+
query: import_v419.z.string().nullish(),
|
|
3297
|
+
sources: import_v419.z.array(
|
|
3298
|
+
import_v419.z.discriminatedUnion("type", [
|
|
3299
|
+
import_v419.z.object({ type: import_v419.z.literal("url"), url: import_v419.z.string() }),
|
|
3300
|
+
import_v419.z.object({ type: import_v419.z.literal("api"), name: import_v419.z.string() })
|
|
3269
3301
|
])
|
|
3270
3302
|
).nullish()
|
|
3271
3303
|
}),
|
|
3272
|
-
|
|
3273
|
-
type:
|
|
3274
|
-
url:
|
|
3304
|
+
import_v419.z.object({
|
|
3305
|
+
type: import_v419.z.literal("open_page"),
|
|
3306
|
+
url: import_v419.z.string().nullish()
|
|
3275
3307
|
}),
|
|
3276
|
-
|
|
3277
|
-
type:
|
|
3278
|
-
url:
|
|
3279
|
-
pattern:
|
|
3308
|
+
import_v419.z.object({
|
|
3309
|
+
type: import_v419.z.literal("find_in_page"),
|
|
3310
|
+
url: import_v419.z.string().nullish(),
|
|
3311
|
+
pattern: import_v419.z.string().nullish()
|
|
3280
3312
|
})
|
|
3281
3313
|
]).nullish()
|
|
3282
3314
|
}),
|
|
3283
|
-
|
|
3284
|
-
type:
|
|
3285
|
-
id:
|
|
3286
|
-
queries:
|
|
3287
|
-
results:
|
|
3288
|
-
|
|
3289
|
-
attributes:
|
|
3290
|
-
file_id:
|
|
3291
|
-
filename:
|
|
3292
|
-
score:
|
|
3293
|
-
text:
|
|
3315
|
+
import_v419.z.object({
|
|
3316
|
+
type: import_v419.z.literal("file_search_call"),
|
|
3317
|
+
id: import_v419.z.string(),
|
|
3318
|
+
queries: import_v419.z.array(import_v419.z.string()),
|
|
3319
|
+
results: import_v419.z.array(
|
|
3320
|
+
import_v419.z.object({
|
|
3321
|
+
attributes: import_v419.z.record(import_v419.z.string(), import_v419.z.unknown()),
|
|
3322
|
+
file_id: import_v419.z.string(),
|
|
3323
|
+
filename: import_v419.z.string(),
|
|
3324
|
+
score: import_v419.z.number(),
|
|
3325
|
+
text: import_v419.z.string()
|
|
3294
3326
|
})
|
|
3295
3327
|
).nullish()
|
|
3296
3328
|
}),
|
|
3297
|
-
|
|
3298
|
-
type:
|
|
3299
|
-
id:
|
|
3300
|
-
call_id:
|
|
3301
|
-
action:
|
|
3302
|
-
type:
|
|
3303
|
-
command:
|
|
3304
|
-
timeout_ms:
|
|
3305
|
-
user:
|
|
3306
|
-
working_directory:
|
|
3307
|
-
env:
|
|
3329
|
+
import_v419.z.object({
|
|
3330
|
+
type: import_v419.z.literal("local_shell_call"),
|
|
3331
|
+
id: import_v419.z.string(),
|
|
3332
|
+
call_id: import_v419.z.string(),
|
|
3333
|
+
action: import_v419.z.object({
|
|
3334
|
+
type: import_v419.z.literal("exec"),
|
|
3335
|
+
command: import_v419.z.array(import_v419.z.string()),
|
|
3336
|
+
timeout_ms: import_v419.z.number().optional(),
|
|
3337
|
+
user: import_v419.z.string().optional(),
|
|
3338
|
+
working_directory: import_v419.z.string().optional(),
|
|
3339
|
+
env: import_v419.z.record(import_v419.z.string(), import_v419.z.string()).optional()
|
|
3308
3340
|
})
|
|
3309
3341
|
}),
|
|
3310
|
-
|
|
3311
|
-
type:
|
|
3312
|
-
id:
|
|
3313
|
-
status:
|
|
3342
|
+
import_v419.z.object({
|
|
3343
|
+
type: import_v419.z.literal("computer_call"),
|
|
3344
|
+
id: import_v419.z.string(),
|
|
3345
|
+
status: import_v419.z.literal("completed")
|
|
3314
3346
|
})
|
|
3315
3347
|
])
|
|
3316
3348
|
}),
|
|
3317
|
-
|
|
3318
|
-
type:
|
|
3319
|
-
item_id:
|
|
3320
|
-
output_index:
|
|
3321
|
-
delta:
|
|
3349
|
+
import_v419.z.object({
|
|
3350
|
+
type: import_v419.z.literal("response.function_call_arguments.delta"),
|
|
3351
|
+
item_id: import_v419.z.string(),
|
|
3352
|
+
output_index: import_v419.z.number(),
|
|
3353
|
+
delta: import_v419.z.string()
|
|
3322
3354
|
}),
|
|
3323
|
-
|
|
3324
|
-
type:
|
|
3325
|
-
item_id:
|
|
3326
|
-
output_index:
|
|
3327
|
-
partial_image_b64:
|
|
3355
|
+
import_v419.z.object({
|
|
3356
|
+
type: import_v419.z.literal("response.image_generation_call.partial_image"),
|
|
3357
|
+
item_id: import_v419.z.string(),
|
|
3358
|
+
output_index: import_v419.z.number(),
|
|
3359
|
+
partial_image_b64: import_v419.z.string()
|
|
3328
3360
|
}),
|
|
3329
|
-
|
|
3330
|
-
type:
|
|
3331
|
-
item_id:
|
|
3332
|
-
output_index:
|
|
3333
|
-
delta:
|
|
3361
|
+
import_v419.z.object({
|
|
3362
|
+
type: import_v419.z.literal("response.code_interpreter_call_code.delta"),
|
|
3363
|
+
item_id: import_v419.z.string(),
|
|
3364
|
+
output_index: import_v419.z.number(),
|
|
3365
|
+
delta: import_v419.z.string()
|
|
3334
3366
|
}),
|
|
3335
|
-
|
|
3336
|
-
type:
|
|
3337
|
-
item_id:
|
|
3338
|
-
output_index:
|
|
3339
|
-
code:
|
|
3367
|
+
import_v419.z.object({
|
|
3368
|
+
type: import_v419.z.literal("response.code_interpreter_call_code.done"),
|
|
3369
|
+
item_id: import_v419.z.string(),
|
|
3370
|
+
output_index: import_v419.z.number(),
|
|
3371
|
+
code: import_v419.z.string()
|
|
3340
3372
|
}),
|
|
3341
|
-
|
|
3342
|
-
type:
|
|
3343
|
-
annotation:
|
|
3344
|
-
|
|
3345
|
-
type:
|
|
3346
|
-
start_index:
|
|
3347
|
-
end_index:
|
|
3348
|
-
url:
|
|
3349
|
-
title:
|
|
3373
|
+
import_v419.z.object({
|
|
3374
|
+
type: import_v419.z.literal("response.output_text.annotation.added"),
|
|
3375
|
+
annotation: import_v419.z.discriminatedUnion("type", [
|
|
3376
|
+
import_v419.z.object({
|
|
3377
|
+
type: import_v419.z.literal("url_citation"),
|
|
3378
|
+
start_index: import_v419.z.number(),
|
|
3379
|
+
end_index: import_v419.z.number(),
|
|
3380
|
+
url: import_v419.z.string(),
|
|
3381
|
+
title: import_v419.z.string()
|
|
3350
3382
|
}),
|
|
3351
|
-
|
|
3352
|
-
type:
|
|
3353
|
-
file_id:
|
|
3354
|
-
filename:
|
|
3355
|
-
index:
|
|
3356
|
-
start_index:
|
|
3357
|
-
end_index:
|
|
3358
|
-
quote:
|
|
3383
|
+
import_v419.z.object({
|
|
3384
|
+
type: import_v419.z.literal("file_citation"),
|
|
3385
|
+
file_id: import_v419.z.string(),
|
|
3386
|
+
filename: import_v419.z.string().nullish(),
|
|
3387
|
+
index: import_v419.z.number().nullish(),
|
|
3388
|
+
start_index: import_v419.z.number().nullish(),
|
|
3389
|
+
end_index: import_v419.z.number().nullish(),
|
|
3390
|
+
quote: import_v419.z.string().nullish()
|
|
3359
3391
|
})
|
|
3360
3392
|
])
|
|
3361
3393
|
}),
|
|
3362
|
-
|
|
3363
|
-
type:
|
|
3364
|
-
item_id:
|
|
3365
|
-
summary_index:
|
|
3394
|
+
import_v419.z.object({
|
|
3395
|
+
type: import_v419.z.literal("response.reasoning_summary_part.added"),
|
|
3396
|
+
item_id: import_v419.z.string(),
|
|
3397
|
+
summary_index: import_v419.z.number()
|
|
3366
3398
|
}),
|
|
3367
|
-
|
|
3368
|
-
type:
|
|
3369
|
-
item_id:
|
|
3370
|
-
summary_index:
|
|
3371
|
-
delta:
|
|
3399
|
+
import_v419.z.object({
|
|
3400
|
+
type: import_v419.z.literal("response.reasoning_summary_text.delta"),
|
|
3401
|
+
item_id: import_v419.z.string(),
|
|
3402
|
+
summary_index: import_v419.z.number(),
|
|
3403
|
+
delta: import_v419.z.string()
|
|
3372
3404
|
}),
|
|
3373
|
-
|
|
3374
|
-
type:
|
|
3375
|
-
item_id:
|
|
3376
|
-
summary_index:
|
|
3405
|
+
import_v419.z.object({
|
|
3406
|
+
type: import_v419.z.literal("response.reasoning_summary_part.done"),
|
|
3407
|
+
item_id: import_v419.z.string(),
|
|
3408
|
+
summary_index: import_v419.z.number()
|
|
3377
3409
|
}),
|
|
3378
|
-
|
|
3379
|
-
type:
|
|
3380
|
-
sequence_number:
|
|
3381
|
-
error:
|
|
3382
|
-
type:
|
|
3383
|
-
code:
|
|
3384
|
-
message:
|
|
3385
|
-
param:
|
|
3410
|
+
import_v419.z.object({
|
|
3411
|
+
type: import_v419.z.literal("error"),
|
|
3412
|
+
sequence_number: import_v419.z.number(),
|
|
3413
|
+
error: import_v419.z.object({
|
|
3414
|
+
type: import_v419.z.string(),
|
|
3415
|
+
code: import_v419.z.string(),
|
|
3416
|
+
message: import_v419.z.string(),
|
|
3417
|
+
param: import_v419.z.string().nullish()
|
|
3386
3418
|
})
|
|
3387
3419
|
}),
|
|
3388
|
-
|
|
3420
|
+
import_v419.z.object({ type: import_v419.z.string() }).loose().transform((value) => ({
|
|
3389
3421
|
type: "unknown_chunk",
|
|
3390
3422
|
message: value.type
|
|
3391
3423
|
}))
|
|
@@ -3395,202 +3427,203 @@ var openaiResponsesChunkSchema = (0, import_provider_utils23.lazyValidator)(
|
|
|
3395
3427
|
);
|
|
3396
3428
|
var openaiResponsesResponseSchema = (0, import_provider_utils23.lazyValidator)(
|
|
3397
3429
|
() => (0, import_provider_utils23.zodSchema)(
|
|
3398
|
-
|
|
3399
|
-
id:
|
|
3400
|
-
created_at:
|
|
3401
|
-
error:
|
|
3402
|
-
message:
|
|
3403
|
-
type:
|
|
3404
|
-
param:
|
|
3405
|
-
code:
|
|
3430
|
+
import_v419.z.object({
|
|
3431
|
+
id: import_v419.z.string().optional(),
|
|
3432
|
+
created_at: import_v419.z.number().optional(),
|
|
3433
|
+
error: import_v419.z.object({
|
|
3434
|
+
message: import_v419.z.string(),
|
|
3435
|
+
type: import_v419.z.string(),
|
|
3436
|
+
param: import_v419.z.string().nullish(),
|
|
3437
|
+
code: import_v419.z.string()
|
|
3406
3438
|
}).nullish(),
|
|
3407
|
-
model:
|
|
3408
|
-
output:
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
type:
|
|
3412
|
-
role:
|
|
3413
|
-
id:
|
|
3414
|
-
phase:
|
|
3439
|
+
model: import_v419.z.string().optional(),
|
|
3440
|
+
output: import_v419.z.array(
|
|
3441
|
+
import_v419.z.discriminatedUnion("type", [
|
|
3442
|
+
import_v419.z.object({
|
|
3443
|
+
type: import_v419.z.literal("message"),
|
|
3444
|
+
role: import_v419.z.literal("assistant"),
|
|
3445
|
+
id: import_v419.z.string(),
|
|
3446
|
+
phase: import_v419.z.enum(["commentary", "final_answer"]).nullish(),
|
|
3415
3447
|
// the API returns either text or a refusal as content parts:
|
|
3416
|
-
content:
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
type:
|
|
3420
|
-
text:
|
|
3421
|
-
logprobs:
|
|
3422
|
-
|
|
3423
|
-
token:
|
|
3424
|
-
logprob:
|
|
3425
|
-
top_logprobs:
|
|
3426
|
-
|
|
3427
|
-
token:
|
|
3428
|
-
logprob:
|
|
3448
|
+
content: import_v419.z.array(
|
|
3449
|
+
import_v419.z.discriminatedUnion("type", [
|
|
3450
|
+
import_v419.z.object({
|
|
3451
|
+
type: import_v419.z.literal("output_text"),
|
|
3452
|
+
text: import_v419.z.string(),
|
|
3453
|
+
logprobs: import_v419.z.array(
|
|
3454
|
+
import_v419.z.object({
|
|
3455
|
+
token: import_v419.z.string(),
|
|
3456
|
+
logprob: import_v419.z.number(),
|
|
3457
|
+
top_logprobs: import_v419.z.array(
|
|
3458
|
+
import_v419.z.object({
|
|
3459
|
+
token: import_v419.z.string(),
|
|
3460
|
+
logprob: import_v419.z.number()
|
|
3429
3461
|
})
|
|
3430
3462
|
)
|
|
3431
3463
|
})
|
|
3432
3464
|
).nullish(),
|
|
3433
|
-
annotations:
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
type:
|
|
3437
|
-
start_index:
|
|
3438
|
-
end_index:
|
|
3439
|
-
url:
|
|
3440
|
-
title:
|
|
3465
|
+
annotations: import_v419.z.array(
|
|
3466
|
+
import_v419.z.discriminatedUnion("type", [
|
|
3467
|
+
import_v419.z.object({
|
|
3468
|
+
type: import_v419.z.literal("url_citation"),
|
|
3469
|
+
start_index: import_v419.z.number(),
|
|
3470
|
+
end_index: import_v419.z.number(),
|
|
3471
|
+
url: import_v419.z.string(),
|
|
3472
|
+
title: import_v419.z.string()
|
|
3441
3473
|
}),
|
|
3442
|
-
|
|
3443
|
-
type:
|
|
3444
|
-
file_id:
|
|
3445
|
-
filename:
|
|
3446
|
-
index:
|
|
3447
|
-
start_index:
|
|
3448
|
-
end_index:
|
|
3449
|
-
quote:
|
|
3474
|
+
import_v419.z.object({
|
|
3475
|
+
type: import_v419.z.literal("file_citation"),
|
|
3476
|
+
file_id: import_v419.z.string(),
|
|
3477
|
+
filename: import_v419.z.string().nullish(),
|
|
3478
|
+
index: import_v419.z.number().nullish(),
|
|
3479
|
+
start_index: import_v419.z.number().nullish(),
|
|
3480
|
+
end_index: import_v419.z.number().nullish(),
|
|
3481
|
+
quote: import_v419.z.string().nullish()
|
|
3450
3482
|
}),
|
|
3451
|
-
|
|
3452
|
-
type:
|
|
3453
|
-
container_id:
|
|
3454
|
-
file_id:
|
|
3455
|
-
filename:
|
|
3456
|
-
start_index:
|
|
3457
|
-
end_index:
|
|
3458
|
-
index:
|
|
3483
|
+
import_v419.z.object({
|
|
3484
|
+
type: import_v419.z.literal("container_file_citation"),
|
|
3485
|
+
container_id: import_v419.z.string(),
|
|
3486
|
+
file_id: import_v419.z.string(),
|
|
3487
|
+
filename: import_v419.z.string().nullish(),
|
|
3488
|
+
start_index: import_v419.z.number().nullish(),
|
|
3489
|
+
end_index: import_v419.z.number().nullish(),
|
|
3490
|
+
index: import_v419.z.number().nullish()
|
|
3459
3491
|
}),
|
|
3460
|
-
|
|
3461
|
-
type:
|
|
3462
|
-
file_id:
|
|
3463
|
-
index:
|
|
3492
|
+
import_v419.z.object({
|
|
3493
|
+
type: import_v419.z.literal("file_path"),
|
|
3494
|
+
file_id: import_v419.z.string(),
|
|
3495
|
+
index: import_v419.z.number().nullish()
|
|
3464
3496
|
})
|
|
3465
3497
|
])
|
|
3466
3498
|
)
|
|
3467
3499
|
}),
|
|
3468
|
-
|
|
3469
|
-
type:
|
|
3470
|
-
refusal:
|
|
3500
|
+
import_v419.z.object({
|
|
3501
|
+
type: import_v419.z.literal("refusal"),
|
|
3502
|
+
refusal: import_v419.z.string()
|
|
3471
3503
|
})
|
|
3472
3504
|
])
|
|
3473
3505
|
)
|
|
3474
3506
|
}),
|
|
3475
|
-
|
|
3476
|
-
type:
|
|
3477
|
-
id:
|
|
3478
|
-
status:
|
|
3479
|
-
action:
|
|
3480
|
-
|
|
3481
|
-
type:
|
|
3482
|
-
query:
|
|
3483
|
-
sources:
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
type:
|
|
3488
|
-
name:
|
|
3507
|
+
import_v419.z.object({
|
|
3508
|
+
type: import_v419.z.literal("web_search_call"),
|
|
3509
|
+
id: import_v419.z.string(),
|
|
3510
|
+
status: import_v419.z.string(),
|
|
3511
|
+
action: import_v419.z.discriminatedUnion("type", [
|
|
3512
|
+
import_v419.z.object({
|
|
3513
|
+
type: import_v419.z.literal("search"),
|
|
3514
|
+
query: import_v419.z.string().nullish(),
|
|
3515
|
+
sources: import_v419.z.array(
|
|
3516
|
+
import_v419.z.discriminatedUnion("type", [
|
|
3517
|
+
import_v419.z.object({ type: import_v419.z.literal("url"), url: import_v419.z.string() }),
|
|
3518
|
+
import_v419.z.object({
|
|
3519
|
+
type: import_v419.z.literal("api"),
|
|
3520
|
+
name: import_v419.z.string()
|
|
3489
3521
|
})
|
|
3490
3522
|
])
|
|
3491
3523
|
).nullish()
|
|
3492
3524
|
}),
|
|
3493
|
-
|
|
3494
|
-
type:
|
|
3495
|
-
url:
|
|
3525
|
+
import_v419.z.object({
|
|
3526
|
+
type: import_v419.z.literal("open_page"),
|
|
3527
|
+
url: import_v419.z.string().nullish()
|
|
3496
3528
|
}),
|
|
3497
|
-
|
|
3498
|
-
type:
|
|
3499
|
-
url:
|
|
3500
|
-
pattern:
|
|
3529
|
+
import_v419.z.object({
|
|
3530
|
+
type: import_v419.z.literal("find_in_page"),
|
|
3531
|
+
url: import_v419.z.string().nullish(),
|
|
3532
|
+
pattern: import_v419.z.string().nullish()
|
|
3501
3533
|
})
|
|
3502
3534
|
]).nullish()
|
|
3503
3535
|
}),
|
|
3504
|
-
|
|
3505
|
-
type:
|
|
3506
|
-
id:
|
|
3507
|
-
queries:
|
|
3508
|
-
results:
|
|
3509
|
-
|
|
3510
|
-
attributes:
|
|
3511
|
-
|
|
3512
|
-
|
|
3536
|
+
import_v419.z.object({
|
|
3537
|
+
type: import_v419.z.literal("file_search_call"),
|
|
3538
|
+
id: import_v419.z.string(),
|
|
3539
|
+
queries: import_v419.z.array(import_v419.z.string()),
|
|
3540
|
+
results: import_v419.z.array(
|
|
3541
|
+
import_v419.z.object({
|
|
3542
|
+
attributes: import_v419.z.record(
|
|
3543
|
+
import_v419.z.string(),
|
|
3544
|
+
import_v419.z.union([import_v419.z.string(), import_v419.z.number(), import_v419.z.boolean()])
|
|
3513
3545
|
),
|
|
3514
|
-
file_id:
|
|
3515
|
-
filename:
|
|
3516
|
-
score:
|
|
3517
|
-
text:
|
|
3546
|
+
file_id: import_v419.z.string(),
|
|
3547
|
+
filename: import_v419.z.string(),
|
|
3548
|
+
score: import_v419.z.number(),
|
|
3549
|
+
text: import_v419.z.string()
|
|
3518
3550
|
})
|
|
3519
3551
|
).nullish()
|
|
3520
3552
|
}),
|
|
3521
|
-
|
|
3522
|
-
type:
|
|
3523
|
-
id:
|
|
3524
|
-
code:
|
|
3525
|
-
container_id:
|
|
3526
|
-
outputs:
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3553
|
+
import_v419.z.object({
|
|
3554
|
+
type: import_v419.z.literal("code_interpreter_call"),
|
|
3555
|
+
id: import_v419.z.string(),
|
|
3556
|
+
code: import_v419.z.string().nullable(),
|
|
3557
|
+
container_id: import_v419.z.string(),
|
|
3558
|
+
outputs: import_v419.z.array(
|
|
3559
|
+
import_v419.z.discriminatedUnion("type", [
|
|
3560
|
+
import_v419.z.object({ type: import_v419.z.literal("logs"), logs: import_v419.z.string() }),
|
|
3561
|
+
import_v419.z.object({ type: import_v419.z.literal("image"), url: import_v419.z.string() })
|
|
3530
3562
|
])
|
|
3531
3563
|
).nullable()
|
|
3532
3564
|
}),
|
|
3533
|
-
|
|
3534
|
-
type:
|
|
3535
|
-
id:
|
|
3536
|
-
result:
|
|
3565
|
+
import_v419.z.object({
|
|
3566
|
+
type: import_v419.z.literal("image_generation_call"),
|
|
3567
|
+
id: import_v419.z.string(),
|
|
3568
|
+
result: import_v419.z.string()
|
|
3537
3569
|
}),
|
|
3538
|
-
|
|
3539
|
-
type:
|
|
3540
|
-
id:
|
|
3541
|
-
call_id:
|
|
3542
|
-
action:
|
|
3543
|
-
type:
|
|
3544
|
-
command:
|
|
3545
|
-
timeout_ms:
|
|
3546
|
-
user:
|
|
3547
|
-
working_directory:
|
|
3548
|
-
env:
|
|
3570
|
+
import_v419.z.object({
|
|
3571
|
+
type: import_v419.z.literal("local_shell_call"),
|
|
3572
|
+
id: import_v419.z.string(),
|
|
3573
|
+
call_id: import_v419.z.string(),
|
|
3574
|
+
action: import_v419.z.object({
|
|
3575
|
+
type: import_v419.z.literal("exec"),
|
|
3576
|
+
command: import_v419.z.array(import_v419.z.string()),
|
|
3577
|
+
timeout_ms: import_v419.z.number().optional(),
|
|
3578
|
+
user: import_v419.z.string().optional(),
|
|
3579
|
+
working_directory: import_v419.z.string().optional(),
|
|
3580
|
+
env: import_v419.z.record(import_v419.z.string(), import_v419.z.string()).optional()
|
|
3549
3581
|
})
|
|
3550
3582
|
}),
|
|
3551
|
-
|
|
3552
|
-
type:
|
|
3553
|
-
call_id:
|
|
3554
|
-
name:
|
|
3555
|
-
arguments:
|
|
3556
|
-
id:
|
|
3557
|
-
async:
|
|
3583
|
+
import_v419.z.object({
|
|
3584
|
+
type: import_v419.z.literal("function_call"),
|
|
3585
|
+
call_id: import_v419.z.string(),
|
|
3586
|
+
name: import_v419.z.string(),
|
|
3587
|
+
arguments: import_v419.z.string(),
|
|
3588
|
+
id: import_v419.z.string(),
|
|
3589
|
+
async: import_v419.z.boolean().nullish()
|
|
3558
3590
|
}),
|
|
3559
|
-
|
|
3560
|
-
type:
|
|
3561
|
-
id:
|
|
3562
|
-
status:
|
|
3591
|
+
import_v419.z.object({
|
|
3592
|
+
type: import_v419.z.literal("computer_call"),
|
|
3593
|
+
id: import_v419.z.string(),
|
|
3594
|
+
status: import_v419.z.string().optional()
|
|
3563
3595
|
}),
|
|
3564
|
-
|
|
3565
|
-
type:
|
|
3566
|
-
id:
|
|
3567
|
-
encrypted_content:
|
|
3568
|
-
summary:
|
|
3569
|
-
|
|
3570
|
-
type:
|
|
3571
|
-
text:
|
|
3596
|
+
import_v419.z.object({
|
|
3597
|
+
type: import_v419.z.literal("reasoning"),
|
|
3598
|
+
id: import_v419.z.string(),
|
|
3599
|
+
encrypted_content: import_v419.z.string().nullish(),
|
|
3600
|
+
summary: import_v419.z.array(
|
|
3601
|
+
import_v419.z.object({
|
|
3602
|
+
type: import_v419.z.literal("summary_text"),
|
|
3603
|
+
text: import_v419.z.string()
|
|
3572
3604
|
})
|
|
3573
3605
|
)
|
|
3574
3606
|
})
|
|
3575
3607
|
])
|
|
3576
3608
|
).optional(),
|
|
3577
|
-
service_tier:
|
|
3578
|
-
|
|
3579
|
-
|
|
3609
|
+
service_tier: import_v419.z.string().nullish(),
|
|
3610
|
+
prompt_cache_diagnostics: openaiResponsesPromptCacheDiagnosticsSchema().nullish(),
|
|
3611
|
+
reasoning: import_v419.z.object({
|
|
3612
|
+
context: import_v419.z.string().nullish()
|
|
3580
3613
|
}).nullish(),
|
|
3581
|
-
incomplete_details:
|
|
3582
|
-
usage:
|
|
3583
|
-
input_tokens:
|
|
3584
|
-
input_tokens_details:
|
|
3585
|
-
cached_tokens:
|
|
3586
|
-
cache_write_tokens:
|
|
3587
|
-
orchestration_input_tokens:
|
|
3588
|
-
orchestration_input_cached_tokens:
|
|
3614
|
+
incomplete_details: import_v419.z.object({ reason: import_v419.z.string() }).nullish(),
|
|
3615
|
+
usage: import_v419.z.object({
|
|
3616
|
+
input_tokens: import_v419.z.number(),
|
|
3617
|
+
input_tokens_details: import_v419.z.object({
|
|
3618
|
+
cached_tokens: import_v419.z.number().nullish(),
|
|
3619
|
+
cache_write_tokens: import_v419.z.number().nullish(),
|
|
3620
|
+
orchestration_input_tokens: import_v419.z.number().nullish(),
|
|
3621
|
+
orchestration_input_cached_tokens: import_v419.z.number().nullish()
|
|
3589
3622
|
}).nullish(),
|
|
3590
|
-
output_tokens:
|
|
3591
|
-
output_tokens_details:
|
|
3592
|
-
reasoning_tokens:
|
|
3593
|
-
orchestration_output_tokens:
|
|
3623
|
+
output_tokens: import_v419.z.number(),
|
|
3624
|
+
output_tokens_details: import_v419.z.object({
|
|
3625
|
+
reasoning_tokens: import_v419.z.number().nullish(),
|
|
3626
|
+
orchestration_output_tokens: import_v419.z.number().nullish()
|
|
3594
3627
|
}).nullish()
|
|
3595
3628
|
}).optional()
|
|
3596
3629
|
})
|
|
@@ -3774,10 +3807,10 @@ function getConfigurationUpdateUnsupportedReason({
|
|
|
3774
3807
|
options
|
|
3775
3808
|
}) {
|
|
3776
3809
|
if (!modelCapabilities.supportsConfigurationUpdate) {
|
|
3777
|
-
return "
|
|
3810
|
+
return "Configuration updates are only supported by GPT-6 and later models";
|
|
3778
3811
|
}
|
|
3779
3812
|
if ((options == null ? void 0 : options.reasoningMode) === "pro" || (options == null ? void 0 : options.truncation) === "auto") {
|
|
3780
|
-
return "
|
|
3813
|
+
return "Configuration updates require standard reasoning mode without automatic truncation";
|
|
3781
3814
|
}
|
|
3782
3815
|
return void 0;
|
|
3783
3816
|
}
|
|
@@ -3809,7 +3842,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3809
3842
|
toolChoice,
|
|
3810
3843
|
responseFormat
|
|
3811
3844
|
}) {
|
|
3812
|
-
var _a2, _b, _c, _d, _e, _f;
|
|
3845
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
|
3813
3846
|
const warnings = [];
|
|
3814
3847
|
const modelCapabilities = getOpenAILanguageModelCapabilities(this.modelId);
|
|
3815
3848
|
if (topK != null) {
|
|
@@ -3885,7 +3918,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3885
3918
|
});
|
|
3886
3919
|
} else if (reasoningEffortUpdate != null) {
|
|
3887
3920
|
const firstItem = input[0];
|
|
3888
|
-
if ((firstItem == null ? void 0 : firstItem.type) !== "configuration_update" || firstItem.reasoning.effort !== reasoningEffortUpdate) {
|
|
3921
|
+
if ((firstItem == null ? void 0 : firstItem.type) !== "configuration_update" || ((_c = firstItem.reasoning) == null ? void 0 : _c.effort) !== reasoningEffortUpdate) {
|
|
3889
3922
|
input.unshift({
|
|
3890
3923
|
type: "configuration_update",
|
|
3891
3924
|
reasoning: { effort: reasoningEffortUpdate }
|
|
@@ -3895,11 +3928,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3895
3928
|
for (let i = 1; i < input.length; i++) {
|
|
3896
3929
|
if (input[i - 1].type === "configuration_update" && input[i].type === "configuration_update") {
|
|
3897
3930
|
throw new import_provider8.UnsupportedFunctionalityError({
|
|
3898
|
-
functionality: "Adjacent
|
|
3931
|
+
functionality: "Adjacent configuration updates",
|
|
3932
|
+
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."
|
|
3899
3933
|
});
|
|
3900
3934
|
}
|
|
3901
3935
|
}
|
|
3902
|
-
const strictJsonSchema = (
|
|
3936
|
+
const strictJsonSchema = (_d = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _d : false;
|
|
3937
|
+
const requestTextFormat = openaiOptions == null ? void 0 : openaiOptions.textFormat;
|
|
3903
3938
|
let include = openaiOptions == null ? void 0 : openaiOptions.include;
|
|
3904
3939
|
function addInclude(key) {
|
|
3905
3940
|
if (include == null) {
|
|
@@ -3933,13 +3968,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3933
3968
|
temperature,
|
|
3934
3969
|
top_p: topP,
|
|
3935
3970
|
max_output_tokens: maxOutputTokens,
|
|
3936
|
-
...((responseFormat == null ? void 0 : responseFormat.type) === "json" || (openaiOptions == null ? void 0 : openaiOptions.textVerbosity)) && {
|
|
3971
|
+
...((responseFormat == null ? void 0 : responseFormat.type) === "json" || requestTextFormat != null || (openaiOptions == null ? void 0 : openaiOptions.textVerbosity)) && {
|
|
3937
3972
|
text: {
|
|
3938
|
-
...(responseFormat == null ? void 0 : responseFormat.type) === "json" && {
|
|
3973
|
+
...requestTextFormat != null ? { format: requestTextFormat } : (responseFormat == null ? void 0 : responseFormat.type) === "json" && {
|
|
3939
3974
|
format: responseFormat.schema != null ? {
|
|
3940
3975
|
type: "json_schema",
|
|
3941
3976
|
strict: strictJsonSchema,
|
|
3942
|
-
name: (
|
|
3977
|
+
name: (_e = responseFormat.name) != null ? _e : "response",
|
|
3943
3978
|
description: responseFormat.description,
|
|
3944
3979
|
schema: responseFormat.schema
|
|
3945
3980
|
} : { type: "json_object" }
|
|
@@ -3961,7 +3996,11 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3961
3996
|
service_tier: openaiOptions == null ? void 0 : openaiOptions.serviceTier,
|
|
3962
3997
|
include,
|
|
3963
3998
|
prompt_cache_key: openaiOptions == null ? void 0 : openaiOptions.promptCacheKey,
|
|
3964
|
-
prompt_cache_options: openaiOptions == null ? void 0 : openaiOptions.promptCacheOptions
|
|
3999
|
+
prompt_cache_options: (openaiOptions == null ? void 0 : openaiOptions.promptCacheOptions) && {
|
|
4000
|
+
mode: openaiOptions.promptCacheOptions.mode,
|
|
4001
|
+
ttl: openaiOptions.promptCacheOptions.ttl,
|
|
4002
|
+
comparison_response_id: openaiOptions.promptCacheOptions.comparisonResponseId
|
|
4003
|
+
},
|
|
3965
4004
|
prompt_cache_retention: openaiOptions == null ? void 0 : openaiOptions.promptCacheRetention,
|
|
3966
4005
|
safety_identifier: openaiOptions == null ? void 0 : openaiOptions.safetyIdentifier,
|
|
3967
4006
|
top_logprobs: topLogprobs,
|
|
@@ -4010,9 +4049,9 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4010
4049
|
details: "topP is not supported for reasoning models"
|
|
4011
4050
|
});
|
|
4012
4051
|
}
|
|
4013
|
-
if (modelCapabilities.supportedReasoningEfforts != null && (baseArgs.top_logprobs != null || ((
|
|
4052
|
+
if (modelCapabilities.supportedReasoningEfforts != null && (baseArgs.top_logprobs != null || ((_f = baseArgs.include) == null ? void 0 : _f.includes("message.output_text.logprobs")))) {
|
|
4014
4053
|
baseArgs.top_logprobs = void 0;
|
|
4015
|
-
const filteredInclude = (
|
|
4054
|
+
const filteredInclude = (_g = baseArgs.include) == null ? void 0 : _g.filter(
|
|
4016
4055
|
(value) => value !== "message.output_text.logprobs"
|
|
4017
4056
|
);
|
|
4018
4057
|
baseArgs.include = filteredInclude != null && filteredInclude.length > 0 ? filteredInclude : void 0;
|
|
@@ -4388,6 +4427,9 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4388
4427
|
if (logprobs.length > 0) {
|
|
4389
4428
|
providerMetadata[providerKey].logprobs = logprobs;
|
|
4390
4429
|
}
|
|
4430
|
+
if (response.prompt_cache_diagnostics != null) {
|
|
4431
|
+
providerMetadata[providerKey].promptCacheDiagnostics = response.prompt_cache_diagnostics;
|
|
4432
|
+
}
|
|
4391
4433
|
if (typeof response.service_tier === "string") {
|
|
4392
4434
|
providerMetadata[providerKey].serviceTier = response.service_tier;
|
|
4393
4435
|
}
|
|
@@ -4467,6 +4509,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4467
4509
|
const activeReasoning = {};
|
|
4468
4510
|
let serviceTier;
|
|
4469
4511
|
let reasoningContext;
|
|
4512
|
+
let promptCacheDiagnostics;
|
|
4470
4513
|
let responsesUsage;
|
|
4471
4514
|
return {
|
|
4472
4515
|
stream: response.pipeThrough(
|
|
@@ -4475,7 +4518,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4475
4518
|
controller.enqueue({ type: "stream-start", warnings });
|
|
4476
4519
|
},
|
|
4477
4520
|
transform(chunk, controller) {
|
|
4478
|
-
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;
|
|
4521
|
+
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;
|
|
4479
4522
|
if (options.includeRawChunks) {
|
|
4480
4523
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
4481
4524
|
}
|
|
@@ -4868,20 +4911,21 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4868
4911
|
activeReasoning[value.item_id].summaryParts[value.summary_index] = "can-conclude";
|
|
4869
4912
|
}
|
|
4870
4913
|
} else if (isResponseFinishedChunk(value)) {
|
|
4914
|
+
promptCacheDiagnostics = (_k = value.response.prompt_cache_diagnostics) != null ? _k : void 0;
|
|
4871
4915
|
finishReason = mapOpenAIResponseFinishReason({
|
|
4872
|
-
finishReason: (
|
|
4916
|
+
finishReason: (_l = value.response.incomplete_details) == null ? void 0 : _l.reason,
|
|
4873
4917
|
hasFunctionCall,
|
|
4874
4918
|
hasRefusal
|
|
4875
4919
|
});
|
|
4876
4920
|
usage.inputTokens = value.response.usage.input_tokens;
|
|
4877
4921
|
usage.outputTokens = value.response.usage.output_tokens;
|
|
4878
4922
|
usage.totalTokens = value.response.usage.input_tokens + value.response.usage.output_tokens;
|
|
4879
|
-
usage.reasoningTokens = (
|
|
4880
|
-
usage.cachedInputTokens = (
|
|
4923
|
+
usage.reasoningTokens = (_n = (_m = value.response.usage.output_tokens_details) == null ? void 0 : _m.reasoning_tokens) != null ? _n : void 0;
|
|
4924
|
+
usage.cachedInputTokens = (_p = (_o = value.response.usage.input_tokens_details) == null ? void 0 : _o.cached_tokens) != null ? _p : void 0;
|
|
4881
4925
|
if (typeof value.response.service_tier === "string") {
|
|
4882
4926
|
serviceTier = value.response.service_tier;
|
|
4883
4927
|
}
|
|
4884
|
-
if (((
|
|
4928
|
+
if (((_q = value.response.reasoning) == null ? void 0 : _q.context) != null) {
|
|
4885
4929
|
reasoningContext = value.response.reasoning.context;
|
|
4886
4930
|
}
|
|
4887
4931
|
responsesUsage = getResponsesUsageMetadata(value.response.usage);
|
|
@@ -4891,7 +4935,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4891
4935
|
controller.enqueue({
|
|
4892
4936
|
type: "source",
|
|
4893
4937
|
sourceType: "url",
|
|
4894
|
-
id: (
|
|
4938
|
+
id: (_t = (_s = (_r = self.config).generateId) == null ? void 0 : _s.call(_r)) != null ? _t : (0, import_provider_utils25.generateId)(),
|
|
4895
4939
|
url: value.annotation.url,
|
|
4896
4940
|
title: value.annotation.title
|
|
4897
4941
|
});
|
|
@@ -4899,10 +4943,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4899
4943
|
controller.enqueue({
|
|
4900
4944
|
type: "source",
|
|
4901
4945
|
sourceType: "document",
|
|
4902
|
-
id: (
|
|
4946
|
+
id: (_w = (_v = (_u = self.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : (0, import_provider_utils25.generateId)(),
|
|
4903
4947
|
mediaType: "text/plain",
|
|
4904
|
-
title: (
|
|
4905
|
-
filename: (
|
|
4948
|
+
title: (_y = (_x = value.annotation.quote) != null ? _x : value.annotation.filename) != null ? _y : "Document",
|
|
4949
|
+
filename: (_z = value.annotation.filename) != null ? _z : value.annotation.file_id,
|
|
4906
4950
|
...value.annotation.file_id ? {
|
|
4907
4951
|
providerMetadata: {
|
|
4908
4952
|
[providerKey]: {
|
|
@@ -4931,6 +4975,9 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4931
4975
|
if (reasoningContext !== void 0) {
|
|
4932
4976
|
providerMetadata[providerKey].reasoningContext = reasoningContext;
|
|
4933
4977
|
}
|
|
4978
|
+
if (promptCacheDiagnostics !== void 0) {
|
|
4979
|
+
providerMetadata[providerKey].promptCacheDiagnostics = promptCacheDiagnostics;
|
|
4980
|
+
}
|
|
4934
4981
|
if (responsesUsage != null) {
|
|
4935
4982
|
providerMetadata[providerKey].usage = responsesUsage;
|
|
4936
4983
|
}
|
|
@@ -5038,12 +5085,12 @@ var import_provider_utils27 = require("@ai-sdk/provider-utils");
|
|
|
5038
5085
|
|
|
5039
5086
|
// src/speech/openai-speech-options.ts
|
|
5040
5087
|
var import_provider_utils26 = require("@ai-sdk/provider-utils");
|
|
5041
|
-
var
|
|
5088
|
+
var import_v420 = require("zod/v4");
|
|
5042
5089
|
var openaiSpeechProviderOptionsSchema = (0, import_provider_utils26.lazyValidator)(
|
|
5043
5090
|
() => (0, import_provider_utils26.zodSchema)(
|
|
5044
|
-
|
|
5045
|
-
instructions:
|
|
5046
|
-
speed:
|
|
5091
|
+
import_v420.z.object({
|
|
5092
|
+
instructions: import_v420.z.string().nullish(),
|
|
5093
|
+
speed: import_v420.z.number().min(0.25).max(4).default(1).nullish()
|
|
5047
5094
|
})
|
|
5048
5095
|
)
|
|
5049
5096
|
);
|
|
@@ -5154,38 +5201,38 @@ var import_provider_utils30 = require("@ai-sdk/provider-utils");
|
|
|
5154
5201
|
|
|
5155
5202
|
// src/transcription/openai-transcription-api.ts
|
|
5156
5203
|
var import_provider_utils28 = require("@ai-sdk/provider-utils");
|
|
5157
|
-
var
|
|
5204
|
+
var import_v421 = require("zod/v4");
|
|
5158
5205
|
var openaiTranscriptionResponseSchema = (0, import_provider_utils28.lazyValidator)(
|
|
5159
5206
|
() => (0, import_provider_utils28.zodSchema)(
|
|
5160
|
-
|
|
5161
|
-
text:
|
|
5162
|
-
language:
|
|
5163
|
-
duration:
|
|
5164
|
-
words:
|
|
5165
|
-
|
|
5166
|
-
word:
|
|
5167
|
-
start:
|
|
5168
|
-
end:
|
|
5207
|
+
import_v421.z.object({
|
|
5208
|
+
text: import_v421.z.string(),
|
|
5209
|
+
language: import_v421.z.string().nullish(),
|
|
5210
|
+
duration: import_v421.z.number().nullish(),
|
|
5211
|
+
words: import_v421.z.array(
|
|
5212
|
+
import_v421.z.object({
|
|
5213
|
+
word: import_v421.z.string(),
|
|
5214
|
+
start: import_v421.z.number(),
|
|
5215
|
+
end: import_v421.z.number()
|
|
5169
5216
|
})
|
|
5170
5217
|
).nullish(),
|
|
5171
|
-
segments:
|
|
5172
|
-
|
|
5173
|
-
id:
|
|
5174
|
-
seek:
|
|
5175
|
-
start:
|
|
5176
|
-
end:
|
|
5177
|
-
text:
|
|
5178
|
-
tokens:
|
|
5179
|
-
temperature:
|
|
5180
|
-
avg_logprob:
|
|
5181
|
-
compression_ratio:
|
|
5182
|
-
no_speech_prob:
|
|
5218
|
+
segments: import_v421.z.array(
|
|
5219
|
+
import_v421.z.object({
|
|
5220
|
+
id: import_v421.z.number(),
|
|
5221
|
+
seek: import_v421.z.number(),
|
|
5222
|
+
start: import_v421.z.number(),
|
|
5223
|
+
end: import_v421.z.number(),
|
|
5224
|
+
text: import_v421.z.string(),
|
|
5225
|
+
tokens: import_v421.z.array(import_v421.z.number()),
|
|
5226
|
+
temperature: import_v421.z.number(),
|
|
5227
|
+
avg_logprob: import_v421.z.number(),
|
|
5228
|
+
compression_ratio: import_v421.z.number(),
|
|
5229
|
+
no_speech_prob: import_v421.z.number()
|
|
5183
5230
|
})
|
|
5184
5231
|
).nullish(),
|
|
5185
5232
|
// Lenient: an unexpected usage shape must not fail the transcription.
|
|
5186
|
-
usage:
|
|
5187
|
-
type:
|
|
5188
|
-
seconds:
|
|
5233
|
+
usage: import_v421.z.object({
|
|
5234
|
+
type: import_v421.z.string().nullish(),
|
|
5235
|
+
seconds: import_v421.z.number().nullish()
|
|
5189
5236
|
}).nullish().catch(void 0)
|
|
5190
5237
|
})
|
|
5191
5238
|
)
|
|
@@ -5193,42 +5240,42 @@ var openaiTranscriptionResponseSchema = (0, import_provider_utils28.lazyValidato
|
|
|
5193
5240
|
|
|
5194
5241
|
// src/transcription/openai-transcription-options.ts
|
|
5195
5242
|
var import_provider_utils29 = require("@ai-sdk/provider-utils");
|
|
5196
|
-
var
|
|
5243
|
+
var import_v422 = require("zod/v4");
|
|
5197
5244
|
var openAITranscriptionProviderOptions = (0, import_provider_utils29.lazyValidator)(
|
|
5198
5245
|
() => (0, import_provider_utils29.zodSchema)(
|
|
5199
|
-
|
|
5246
|
+
import_v422.z.object({
|
|
5200
5247
|
/**
|
|
5201
5248
|
* Additional information to include in the transcription response.
|
|
5202
5249
|
*/
|
|
5203
|
-
include:
|
|
5250
|
+
include: import_v422.z.array(import_v422.z.string()).optional(),
|
|
5204
5251
|
/**
|
|
5205
5252
|
* The language of the input audio in ISO-639-1 format.
|
|
5206
5253
|
*/
|
|
5207
|
-
language:
|
|
5254
|
+
language: import_v422.z.string().optional(),
|
|
5208
5255
|
/**
|
|
5209
5256
|
* Expected languages for REST transcription, e.g. with gpt-transcribe.
|
|
5210
5257
|
* Use this instead of language. The API validates model support.
|
|
5211
5258
|
*/
|
|
5212
|
-
languages:
|
|
5259
|
+
languages: import_v422.z.array(import_v422.z.string()).optional(),
|
|
5213
5260
|
/**
|
|
5214
5261
|
* Vocabulary hints for REST transcription, e.g. names or technical terms.
|
|
5215
5262
|
* The API validates model support.
|
|
5216
5263
|
*/
|
|
5217
|
-
keywords:
|
|
5264
|
+
keywords: import_v422.z.array(import_v422.z.string()).optional(),
|
|
5218
5265
|
/**
|
|
5219
5266
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
5220
5267
|
*/
|
|
5221
|
-
prompt:
|
|
5268
|
+
prompt: import_v422.z.string().optional(),
|
|
5222
5269
|
/**
|
|
5223
5270
|
* The sampling temperature, between 0 and 1.
|
|
5224
5271
|
* @default 0
|
|
5225
5272
|
*/
|
|
5226
|
-
temperature:
|
|
5273
|
+
temperature: import_v422.z.number().min(0).max(1).default(0).optional(),
|
|
5227
5274
|
/**
|
|
5228
5275
|
* The timestamp granularities to populate for this transcription.
|
|
5229
5276
|
* @default ['segment']
|
|
5230
5277
|
*/
|
|
5231
|
-
timestampGranularities:
|
|
5278
|
+
timestampGranularities: import_v422.z.array(import_v422.z.enum(["word", "segment"])).default(["segment"]).optional()
|
|
5232
5279
|
})
|
|
5233
5280
|
)
|
|
5234
5281
|
);
|
|
@@ -5404,7 +5451,7 @@ var OpenAITranscriptionModel = class {
|
|
|
5404
5451
|
};
|
|
5405
5452
|
|
|
5406
5453
|
// src/version.ts
|
|
5407
|
-
var VERSION = true ? "2.0.
|
|
5454
|
+
var VERSION = true ? "2.0.143" : "0.0.0-test";
|
|
5408
5455
|
|
|
5409
5456
|
// src/openai-provider.ts
|
|
5410
5457
|
function createOpenAI(options = {}) {
|