@ai-sdk/openai 3.0.116 → 3.0.118
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 +18 -0
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +1398 -1325
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1386 -1312
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1196 -1123
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1179 -1105
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +83 -34
- package/package.json +2 -2
- package/src/chat/openai-chat-api.ts +5 -0
- package/src/chat/openai-chat-language-model.ts +4 -1
- package/src/index.ts +1 -0
- package/src/openai-stream-error.ts +4 -0
- package/src/responses/convert-to-openai-responses-input.ts +39 -0
- package/src/responses/openai-responses-language-model.ts +64 -15
- package/src/responses/openai-responses-options.ts +22 -0
package/dist/index.js
CHANGED
|
@@ -167,7 +167,8 @@ function createOpenAIStreamError({
|
|
|
167
167
|
statusCode: streamError == null ? 500 : getStatusCode(streamError),
|
|
168
168
|
responseHeaders,
|
|
169
169
|
responseBody: JSON.stringify(frame),
|
|
170
|
-
data: frame
|
|
170
|
+
data: frame,
|
|
171
|
+
isRetryable: streamError == null ? true : isRetryableStreamError(streamError, getStatusCode(streamError))
|
|
171
172
|
});
|
|
172
173
|
}
|
|
173
174
|
function parseStreamError(frame) {
|
|
@@ -581,6 +582,9 @@ var openaiChatResponseSchema = (0, import_provider_utils3.lazySchema)(
|
|
|
581
582
|
message: import_v42.z.object({
|
|
582
583
|
role: import_v42.z.literal("assistant").nullish(),
|
|
583
584
|
content: import_v42.z.string().nullish(),
|
|
585
|
+
audio: import_v42.z.object({
|
|
586
|
+
transcript: import_v42.z.string().nullish()
|
|
587
|
+
}).nullish(),
|
|
584
588
|
tool_calls: import_v42.z.array(
|
|
585
589
|
import_v42.z.object({
|
|
586
590
|
id: import_v42.z.string().nullish(),
|
|
@@ -1120,7 +1124,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
1120
1124
|
};
|
|
1121
1125
|
}
|
|
1122
1126
|
async doGenerate(options) {
|
|
1123
|
-
var _a2, _b, _c, _d, _e, _f, _g;
|
|
1127
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
1124
1128
|
const { args: body, warnings } = await this.getArgs(options);
|
|
1125
1129
|
const {
|
|
1126
1130
|
responseHeaders,
|
|
@@ -1148,19 +1152,19 @@ var OpenAIChatLanguageModel = class {
|
|
|
1148
1152
|
});
|
|
1149
1153
|
}
|
|
1150
1154
|
const content = [];
|
|
1151
|
-
const text = choice.message.content;
|
|
1155
|
+
const text = choice.message.content != null && choice.message.content.length > 0 ? choice.message.content : (_a2 = choice.message.audio) == null ? void 0 : _a2.transcript;
|
|
1152
1156
|
if (text != null && text.length > 0) {
|
|
1153
1157
|
content.push({ type: "text", text });
|
|
1154
1158
|
}
|
|
1155
|
-
for (const toolCall of (
|
|
1159
|
+
for (const toolCall of (_b = choice.message.tool_calls) != null ? _b : []) {
|
|
1156
1160
|
content.push({
|
|
1157
1161
|
type: "tool-call",
|
|
1158
|
-
toolCallId: (
|
|
1162
|
+
toolCallId: (_c = toolCall.id) != null ? _c : (0, import_provider_utils5.generateId)(),
|
|
1159
1163
|
toolName: toolCall.function.name,
|
|
1160
1164
|
input: toolCall.function.arguments
|
|
1161
1165
|
});
|
|
1162
1166
|
}
|
|
1163
|
-
for (const annotation of (
|
|
1167
|
+
for (const annotation of (_d = choice.message.annotations) != null ? _d : []) {
|
|
1164
1168
|
content.push({
|
|
1165
1169
|
type: "source",
|
|
1166
1170
|
sourceType: "url",
|
|
@@ -1169,8 +1173,8 @@ var OpenAIChatLanguageModel = class {
|
|
|
1169
1173
|
title: annotation.url_citation.title
|
|
1170
1174
|
});
|
|
1171
1175
|
}
|
|
1172
|
-
const completionTokenDetails = (
|
|
1173
|
-
const promptTokenDetails = (
|
|
1176
|
+
const completionTokenDetails = (_e = response.usage) == null ? void 0 : _e.completion_tokens_details;
|
|
1177
|
+
const promptTokenDetails = (_f = response.usage) == null ? void 0 : _f.prompt_tokens_details;
|
|
1174
1178
|
const providerMetadata = { openai: {} };
|
|
1175
1179
|
if ((completionTokenDetails == null ? void 0 : completionTokenDetails.accepted_prediction_tokens) != null) {
|
|
1176
1180
|
providerMetadata.openai.acceptedPredictionTokens = completionTokenDetails == null ? void 0 : completionTokenDetails.accepted_prediction_tokens;
|
|
@@ -1178,14 +1182,14 @@ var OpenAIChatLanguageModel = class {
|
|
|
1178
1182
|
if ((completionTokenDetails == null ? void 0 : completionTokenDetails.rejected_prediction_tokens) != null) {
|
|
1179
1183
|
providerMetadata.openai.rejectedPredictionTokens = completionTokenDetails == null ? void 0 : completionTokenDetails.rejected_prediction_tokens;
|
|
1180
1184
|
}
|
|
1181
|
-
if (((
|
|
1185
|
+
if (((_g = choice.logprobs) == null ? void 0 : _g.content) != null) {
|
|
1182
1186
|
providerMetadata.openai.logprobs = choice.logprobs.content;
|
|
1183
1187
|
}
|
|
1184
1188
|
return {
|
|
1185
1189
|
content,
|
|
1186
1190
|
finishReason: {
|
|
1187
1191
|
unified: mapOpenAIFinishReason(choice.finish_reason),
|
|
1188
|
-
raw: (
|
|
1192
|
+
raw: (_h = choice.finish_reason) != null ? _h : void 0
|
|
1189
1193
|
},
|
|
1190
1194
|
usage: convertOpenAIChatUsage(response.usage),
|
|
1191
1195
|
request: { body },
|
|
@@ -3043,261 +3047,559 @@ function convertOpenAIResponsesUsage(usage) {
|
|
|
3043
3047
|
|
|
3044
3048
|
// src/responses/convert-to-openai-responses-input.ts
|
|
3045
3049
|
var import_provider8 = require("@ai-sdk/provider");
|
|
3046
|
-
var
|
|
3047
|
-
var
|
|
3050
|
+
var import_provider_utils28 = require("@ai-sdk/provider-utils");
|
|
3051
|
+
var import_v422 = require("zod/v4");
|
|
3048
3052
|
|
|
3049
|
-
// src/responses/
|
|
3050
|
-
var import_provider7 = require("@ai-sdk/provider");
|
|
3053
|
+
// src/responses/openai-responses-options.ts
|
|
3051
3054
|
var import_provider_utils26 = require("@ai-sdk/provider-utils");
|
|
3052
|
-
var
|
|
3053
|
-
var
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3055
|
+
var import_v421 = require("zod/v4");
|
|
3056
|
+
var TOP_LOGPROBS_MAX = 20;
|
|
3057
|
+
var openaiResponsesReasoningModelIds = [
|
|
3058
|
+
"o1",
|
|
3059
|
+
"o1-2024-12-17",
|
|
3060
|
+
"o3",
|
|
3061
|
+
"o3-2025-04-16",
|
|
3062
|
+
"o3-mini",
|
|
3063
|
+
"o3-mini-2025-01-31",
|
|
3064
|
+
"o4-mini",
|
|
3065
|
+
"o4-mini-2025-04-16",
|
|
3066
|
+
"gpt-5",
|
|
3067
|
+
"gpt-5-2025-08-07",
|
|
3068
|
+
"gpt-5-codex",
|
|
3069
|
+
"gpt-5-mini",
|
|
3070
|
+
"gpt-5-mini-2025-08-07",
|
|
3071
|
+
"gpt-5-nano",
|
|
3072
|
+
"gpt-5-nano-2025-08-07",
|
|
3073
|
+
"gpt-5-pro",
|
|
3074
|
+
"gpt-5-pro-2025-10-06",
|
|
3075
|
+
"gpt-5.1",
|
|
3076
|
+
"gpt-5.1-chat-latest",
|
|
3077
|
+
"gpt-5.1-codex-mini",
|
|
3078
|
+
"gpt-5.1-codex",
|
|
3079
|
+
"gpt-5.1-codex-max",
|
|
3080
|
+
"gpt-5.2",
|
|
3081
|
+
"gpt-5.2-chat-latest",
|
|
3082
|
+
"gpt-5.2-pro",
|
|
3083
|
+
"gpt-5.2-codex",
|
|
3084
|
+
"gpt-5.3-chat-latest",
|
|
3085
|
+
"gpt-5.3-codex",
|
|
3086
|
+
"gpt-5.4",
|
|
3087
|
+
"gpt-5.4-2026-03-05",
|
|
3088
|
+
"gpt-5.4-mini",
|
|
3089
|
+
"gpt-5.4-mini-2026-03-17",
|
|
3090
|
+
"gpt-5.4-nano",
|
|
3091
|
+
"gpt-5.4-nano-2026-03-17",
|
|
3092
|
+
"gpt-5.4-pro",
|
|
3093
|
+
"gpt-5.4-pro-2026-03-05",
|
|
3094
|
+
"gpt-5.5",
|
|
3095
|
+
"gpt-5.5-2026-04-23",
|
|
3096
|
+
"gpt-5.6",
|
|
3097
|
+
"gpt-5.6-luna",
|
|
3098
|
+
"gpt-5.6-sol",
|
|
3099
|
+
"gpt-5.6-terra",
|
|
3100
|
+
"gpt-6-astra",
|
|
3101
|
+
"gpt-6-luna",
|
|
3102
|
+
"gpt-6-sol"
|
|
3103
|
+
];
|
|
3104
|
+
var openaiResponsesModelIds = [
|
|
3105
|
+
"gpt-4.1",
|
|
3106
|
+
"gpt-4.1-2025-04-14",
|
|
3107
|
+
"gpt-4.1-mini",
|
|
3108
|
+
"gpt-4.1-mini-2025-04-14",
|
|
3109
|
+
"gpt-4.1-nano",
|
|
3110
|
+
"gpt-4.1-nano-2025-04-14",
|
|
3111
|
+
"gpt-4o",
|
|
3112
|
+
"gpt-4o-2024-05-13",
|
|
3113
|
+
"gpt-4o-2024-08-06",
|
|
3114
|
+
"gpt-4o-2024-11-20",
|
|
3115
|
+
"gpt-4o-audio-preview",
|
|
3116
|
+
"gpt-4o-audio-preview-2024-12-17",
|
|
3117
|
+
"gpt-4o-search-preview",
|
|
3118
|
+
"gpt-4o-search-preview-2025-03-11",
|
|
3119
|
+
"gpt-4o-mini-search-preview",
|
|
3120
|
+
"gpt-4o-mini-search-preview-2025-03-11",
|
|
3121
|
+
"gpt-4o-mini",
|
|
3122
|
+
"gpt-4o-mini-2024-07-18",
|
|
3123
|
+
"gpt-3.5-turbo-0125",
|
|
3124
|
+
"gpt-3.5-turbo",
|
|
3125
|
+
"gpt-3.5-turbo-1106",
|
|
3126
|
+
"gpt-5-chat-latest",
|
|
3127
|
+
...openaiResponsesReasoningModelIds
|
|
3128
|
+
];
|
|
3129
|
+
var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils26.lazySchema)(
|
|
3130
|
+
() => (0, import_provider_utils26.zodSchema)(
|
|
3131
|
+
import_v421.z.object({
|
|
3132
|
+
/**
|
|
3133
|
+
* The ID of the OpenAI Conversation to continue.
|
|
3134
|
+
* You must create a conversation first via the OpenAI API.
|
|
3135
|
+
* Cannot be used in conjunction with `previousResponseId`.
|
|
3136
|
+
* Defaults to `undefined`.
|
|
3137
|
+
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
3138
|
+
*/
|
|
3139
|
+
conversation: import_v421.z.string().nullish(),
|
|
3140
|
+
/**
|
|
3141
|
+
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
3142
|
+
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'web_search_call.results', 'message.output_text.logprobs'.
|
|
3143
|
+
*/
|
|
3144
|
+
include: import_v421.z.array(
|
|
3145
|
+
import_v421.z.enum([
|
|
3146
|
+
"reasoning.encrypted_content",
|
|
3147
|
+
// handled internally by default, only needed for unknown reasoning models
|
|
3148
|
+
"file_search_call.results",
|
|
3149
|
+
"web_search_call.results",
|
|
3150
|
+
"message.output_text.logprobs"
|
|
3151
|
+
])
|
|
3152
|
+
).nullish(),
|
|
3153
|
+
/**
|
|
3154
|
+
* Instructions for the model.
|
|
3155
|
+
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
3156
|
+
* Defaults to `undefined`.
|
|
3157
|
+
*/
|
|
3158
|
+
instructions: import_v421.z.string().nullish(),
|
|
3159
|
+
/**
|
|
3160
|
+
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
3161
|
+
* the response size and can slow down response times. However, it can
|
|
3162
|
+
* be useful to better understand how the model is behaving.
|
|
3163
|
+
*
|
|
3164
|
+
* Setting to true will return the log probabilities of the tokens that
|
|
3165
|
+
* were generated.
|
|
3166
|
+
*
|
|
3167
|
+
* Setting to a number will return the log probabilities of the top n
|
|
3168
|
+
* tokens that were generated.
|
|
3169
|
+
*
|
|
3170
|
+
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
3171
|
+
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
3172
|
+
*/
|
|
3173
|
+
logprobs: import_v421.z.union([import_v421.z.boolean(), import_v421.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
3174
|
+
/**
|
|
3175
|
+
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
3176
|
+
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
3177
|
+
* Any further attempts to call a tool by the model will be ignored.
|
|
3178
|
+
*/
|
|
3179
|
+
maxToolCalls: import_v421.z.number().nullish(),
|
|
3180
|
+
/**
|
|
3181
|
+
* Additional metadata to store with the generation.
|
|
3182
|
+
*/
|
|
3183
|
+
metadata: import_v421.z.any().nullish(),
|
|
3184
|
+
/**
|
|
3185
|
+
* Whether to use parallel tool calls. Defaults to `true`.
|
|
3186
|
+
*/
|
|
3187
|
+
parallelToolCalls: import_v421.z.boolean().nullish(),
|
|
3188
|
+
/**
|
|
3189
|
+
* The ID of the previous response. You can use it to continue a conversation.
|
|
3190
|
+
* Defaults to `undefined`.
|
|
3191
|
+
*/
|
|
3192
|
+
previousResponseId: import_v421.z.string().nullish(),
|
|
3193
|
+
/**
|
|
3194
|
+
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
3195
|
+
*/
|
|
3196
|
+
promptCacheKey: import_v421.z.string().nullish(),
|
|
3197
|
+
/**
|
|
3198
|
+
* Prompt cache behavior for GPT-5.6 and later models.
|
|
3199
|
+
* `mode` controls whether OpenAI also places an implicit breakpoint.
|
|
3200
|
+
* `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
|
|
3201
|
+
*/
|
|
3202
|
+
promptCacheOptions: import_v421.z.object({
|
|
3203
|
+
mode: import_v421.z.enum(["implicit", "explicit"]).optional(),
|
|
3204
|
+
ttl: import_v421.z.literal("30m").optional()
|
|
3205
|
+
}).optional(),
|
|
3206
|
+
/**
|
|
3207
|
+
* The retention policy for the prompt cache.
|
|
3208
|
+
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
3209
|
+
* - '24h': Extended prompt caching that keeps cached prefixes active for up to 24 hours.
|
|
3210
|
+
* Available for models before GPT-5.6 that support extended caching.
|
|
3211
|
+
*
|
|
3212
|
+
* @deprecated For GPT-5.6 and later models, use `promptCacheOptions.ttl`.
|
|
3213
|
+
*
|
|
3214
|
+
* @default 'in_memory'
|
|
3215
|
+
*/
|
|
3216
|
+
promptCacheRetention: import_v421.z.enum(["in_memory", "24h"]).nullish(),
|
|
3217
|
+
/**
|
|
3218
|
+
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
3219
|
+
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
3220
|
+
* GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
3221
|
+
* GPT-6 and later models support 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
3222
|
+
* Supported values vary by model.
|
|
3223
|
+
*/
|
|
3224
|
+
reasoningEffort: import_v421.z.string().nullish(),
|
|
3225
|
+
/**
|
|
3226
|
+
* Updates the reasoning effort for GPT-6 and later models starting with this response
|
|
3227
|
+
* without changing the request-level reasoning effort. This preserves the
|
|
3228
|
+
* request prefix for prompt caching.
|
|
3229
|
+
*
|
|
3230
|
+
* Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be
|
|
3231
|
+
* combined with automatic truncation.
|
|
3232
|
+
*/
|
|
3233
|
+
reasoningEffortUpdate: import_v421.z.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
3234
|
+
/**
|
|
3235
|
+
* Controls how much model work GPT-5.6 performs before returning a final answer.
|
|
3236
|
+
* `standard` is the default. `pro` increases quality, latency, and token usage.
|
|
3237
|
+
*/
|
|
3238
|
+
reasoningMode: import_v421.z.enum(["standard", "pro"]).optional(),
|
|
3239
|
+
/**
|
|
3240
|
+
* Controls which available reasoning items GPT-5.6 can use.
|
|
3241
|
+
* `auto` uses the model default, `current_turn` excludes reasoning from earlier
|
|
3242
|
+
* turns, and `all_turns` makes compatible earlier reasoning available.
|
|
3243
|
+
*/
|
|
3244
|
+
reasoningContext: import_v421.z.enum(["auto", "current_turn", "all_turns"]).optional(),
|
|
3245
|
+
/**
|
|
3246
|
+
* Controls reasoning summary output from the model.
|
|
3247
|
+
* Set to "auto" to automatically receive the richest level available,
|
|
3248
|
+
* or "detailed" for comprehensive summaries.
|
|
3249
|
+
*/
|
|
3250
|
+
reasoningSummary: import_v421.z.string().nullish(),
|
|
3251
|
+
/**
|
|
3252
|
+
* The identifier for safety monitoring and tracking.
|
|
3253
|
+
*/
|
|
3254
|
+
safetyIdentifier: import_v421.z.string().nullish(),
|
|
3255
|
+
/**
|
|
3256
|
+
* Service tier for the request.
|
|
3257
|
+
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
3258
|
+
* Set to 'priority' for faster processing with Enterprise access (available for gpt-4, gpt-5, gpt-5-mini, o3, o4-mini; gpt-5-nano is not supported).
|
|
3259
|
+
* Set to 'fast' for the same tier as 'priority' (OpenAI's newer name for it).
|
|
3260
|
+
*
|
|
3261
|
+
* Defaults to 'auto'.
|
|
3262
|
+
*/
|
|
3263
|
+
serviceTier: import_v421.z.enum(["auto", "flex", "priority", "fast", "default"]).nullish(),
|
|
3264
|
+
/**
|
|
3265
|
+
* Whether to store the generation. Defaults to `true`.
|
|
3266
|
+
*/
|
|
3267
|
+
store: import_v421.z.boolean().nullish(),
|
|
3268
|
+
/**
|
|
3269
|
+
* Whether to pass through non-image file types as generic input files.
|
|
3270
|
+
*
|
|
3271
|
+
* By default, inline file inputs are restricted to images and PDFs.
|
|
3272
|
+
* Enable this when the target OpenAI Responses model supports additional
|
|
3273
|
+
* file media types, such as text/csv.
|
|
3274
|
+
*/
|
|
3275
|
+
passThroughUnsupportedFiles: import_v421.z.boolean().optional(),
|
|
3276
|
+
/**
|
|
3277
|
+
* Whether to use strict JSON schema validation.
|
|
3278
|
+
* Defaults to `true`.
|
|
3279
|
+
*/
|
|
3280
|
+
strictJsonSchema: import_v421.z.boolean().nullish(),
|
|
3281
|
+
/**
|
|
3282
|
+
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
3283
|
+
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
3284
|
+
* Valid values: 'low', 'medium', 'high'.
|
|
3285
|
+
*/
|
|
3286
|
+
textVerbosity: import_v421.z.enum(["low", "medium", "high"]).nullish(),
|
|
3287
|
+
/**
|
|
3288
|
+
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
3289
|
+
* 'disabled' turns truncation off.
|
|
3290
|
+
*/
|
|
3291
|
+
truncation: import_v421.z.enum(["auto", "disabled"]).nullish(),
|
|
3292
|
+
/**
|
|
3293
|
+
* A unique identifier representing your end-user, which can help OpenAI to
|
|
3294
|
+
* monitor and detect abuse.
|
|
3295
|
+
* Defaults to `undefined`.
|
|
3296
|
+
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
3297
|
+
*/
|
|
3298
|
+
user: import_v421.z.string().nullish(),
|
|
3299
|
+
/**
|
|
3300
|
+
* Override the system message mode for this model.
|
|
3301
|
+
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
3302
|
+
* - 'developer': Use the 'developer' role for system messages (used by reasoning models)
|
|
3303
|
+
* - 'remove': Remove system messages entirely
|
|
3304
|
+
*
|
|
3305
|
+
* If not specified, the mode is automatically determined based on the model.
|
|
3306
|
+
*/
|
|
3307
|
+
systemMessageMode: import_v421.z.enum(["system", "developer", "remove"]).optional(),
|
|
3308
|
+
/**
|
|
3309
|
+
* Force treating this model as a reasoning model.
|
|
3310
|
+
*
|
|
3311
|
+
* This is useful for "stealth" reasoning models (e.g. via a custom baseURL)
|
|
3312
|
+
* where the model ID is not recognized by the SDK's allowlist.
|
|
3313
|
+
*
|
|
3314
|
+
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
3315
|
+
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
3316
|
+
*/
|
|
3317
|
+
forceReasoning: import_v421.z.boolean().optional(),
|
|
3318
|
+
/**
|
|
3319
|
+
* Restrict the callable tools to a subset while keeping the full tools
|
|
3320
|
+
* list intact, so prompt caching is preserved across requests with
|
|
3321
|
+
* different allowlists.
|
|
3322
|
+
*
|
|
3323
|
+
* When set, this overrides the request-level `toolChoice` and emits
|
|
3324
|
+
* `tool_choice: { type: "allowed_tools", mode, tools }` on the wire.
|
|
3325
|
+
*
|
|
3326
|
+
* @see https://developers.openai.com/api/reference/resources/responses/methods/create#(resource)%20responses%20%3E%20(model)%20tool_choice_allowed%20%3E%20(schema)
|
|
3327
|
+
*/
|
|
3328
|
+
allowedTools: import_v421.z.object({
|
|
3329
|
+
toolNames: import_v421.z.array(import_v421.z.string()).min(1),
|
|
3330
|
+
mode: import_v421.z.enum(["auto", "required"]).optional()
|
|
3331
|
+
}).optional()
|
|
3332
|
+
})
|
|
3333
|
+
)
|
|
3334
|
+
);
|
|
3335
|
+
var openaiResponsesSystemMessageOptionsSchema = (0, import_provider_utils26.lazySchema)(
|
|
3336
|
+
() => (0, import_provider_utils26.zodSchema)(
|
|
3337
|
+
import_v421.z.object({
|
|
3338
|
+
/**
|
|
3339
|
+
* Emit a configuration update at this position in Responses history.
|
|
3340
|
+
* Requires empty system message content and the same supported
|
|
3341
|
+
* configuration as the request-level reasoningEffortUpdate option.
|
|
3342
|
+
* Unsupported historical updates throw instead of being omitted.
|
|
3343
|
+
*
|
|
3344
|
+
* @see https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation
|
|
3345
|
+
*/
|
|
3346
|
+
reasoningEffortUpdate: import_v421.z.enum(["low", "medium", "high", "xhigh", "max"]).optional()
|
|
3347
|
+
})
|
|
3348
|
+
)
|
|
3349
|
+
);
|
|
3350
|
+
|
|
3351
|
+
// src/responses/expand-parallel-tool-call.ts
|
|
3352
|
+
var import_provider7 = require("@ai-sdk/provider");
|
|
3353
|
+
var import_provider_utils27 = require("@ai-sdk/provider-utils");
|
|
3354
|
+
var parallelToolName = "parallel";
|
|
3355
|
+
var recipientNamePrefix = "functions.";
|
|
3356
|
+
function getParallelToolCallMetadata({
|
|
3357
|
+
providerOptions,
|
|
3358
|
+
providerOptionsName
|
|
3359
|
+
}) {
|
|
3360
|
+
var _a2;
|
|
3361
|
+
const metadata = (_a2 = providerOptions == null ? void 0 : providerOptions[providerOptionsName]) == null ? void 0 : _a2.parallelToolCall;
|
|
3362
|
+
if (!(0, import_provider7.isJSONObject)(metadata) || typeof metadata.itemId !== "string" || typeof metadata.toolCallId !== "string" || typeof metadata.toolName !== "string" || typeof metadata.input !== "string" || typeof metadata.index !== "number" || !Number.isInteger(metadata.index) || typeof metadata.count !== "number" || !Number.isInteger(metadata.count) || metadata.index < 0 || metadata.count <= metadata.index) {
|
|
3363
|
+
return void 0;
|
|
3364
|
+
}
|
|
3365
|
+
return metadata;
|
|
3366
|
+
}
|
|
3367
|
+
function isUndeclaredParallelToolCall({
|
|
3368
|
+
toolName,
|
|
3369
|
+
tools
|
|
3370
|
+
}) {
|
|
3371
|
+
return toolName === parallelToolName && !tools.some((tool) => tool.name === parallelToolName);
|
|
3372
|
+
}
|
|
3373
|
+
async function expandParallelToolCall({
|
|
3374
|
+
toolCall,
|
|
3375
|
+
tools,
|
|
3376
|
+
providerOptionsName,
|
|
3377
|
+
itemId
|
|
3378
|
+
}) {
|
|
3379
|
+
if (!isUndeclaredParallelToolCall({ toolName: toolCall.toolName, tools })) {
|
|
3380
|
+
return void 0;
|
|
3381
|
+
}
|
|
3382
|
+
const parsedInput = await (0, import_provider_utils27.safeParseJSON)({ text: toolCall.input });
|
|
3383
|
+
if (!parsedInput.success || !(0, import_provider7.isJSONObject)(parsedInput.value)) {
|
|
3384
|
+
return void 0;
|
|
3385
|
+
}
|
|
3386
|
+
const toolUses = parsedInput.value.tool_uses;
|
|
3387
|
+
if (!Array.isArray(toolUses) || toolUses.length === 0) {
|
|
3388
|
+
return void 0;
|
|
3389
|
+
}
|
|
3390
|
+
const availableToolNames = new Set(tools.map((tool) => tool.name));
|
|
3391
|
+
const expandedToolCalls = [];
|
|
3392
|
+
for (const [index, toolUse] of toolUses.entries()) {
|
|
3393
|
+
if (!(0, import_provider7.isJSONObject)(toolUse)) {
|
|
3394
|
+
return void 0;
|
|
3395
|
+
}
|
|
3396
|
+
const recipientName = toolUse.recipient_name;
|
|
3397
|
+
const parameters = toolUse.parameters;
|
|
3398
|
+
if (typeof recipientName !== "string" || !recipientName.startsWith(recipientNamePrefix) || !(0, import_provider7.isJSONObject)(parameters)) {
|
|
3399
|
+
return void 0;
|
|
3400
|
+
}
|
|
3401
|
+
const toolName = recipientName.slice(recipientNamePrefix.length);
|
|
3402
|
+
if (toolName.length === 0 || !availableToolNames.has(toolName)) {
|
|
3403
|
+
return void 0;
|
|
3404
|
+
}
|
|
3405
|
+
expandedToolCalls.push({
|
|
3406
|
+
type: "tool-call",
|
|
3407
|
+
toolCallId: `${toolCall.toolCallId}_${index}`,
|
|
3408
|
+
toolName,
|
|
3409
|
+
input: JSON.stringify(parameters),
|
|
3410
|
+
providerMetadata: {
|
|
3411
|
+
[providerOptionsName]: {
|
|
3412
|
+
parallelToolCall: {
|
|
3413
|
+
itemId,
|
|
3414
|
+
toolCallId: toolCall.toolCallId,
|
|
3415
|
+
toolName: toolCall.toolName,
|
|
3416
|
+
input: toolCall.input,
|
|
3417
|
+
index,
|
|
3418
|
+
count: toolUses.length
|
|
3419
|
+
}
|
|
3420
|
+
}
|
|
3421
|
+
}
|
|
3422
|
+
});
|
|
3423
|
+
}
|
|
3424
|
+
return expandedToolCalls;
|
|
3425
|
+
}
|
|
3426
|
+
|
|
3427
|
+
// src/responses/convert-to-openai-responses-input.ts
|
|
3428
|
+
function serializeToolCallArguments2(input) {
|
|
3429
|
+
return JSON.stringify(input === void 0 ? {} : input);
|
|
3430
|
+
}
|
|
3431
|
+
async function convertFunctionToolResultOutput({
|
|
3432
|
+
output,
|
|
3433
|
+
promptCacheBreakpoint,
|
|
3434
|
+
providerOptionsName,
|
|
3435
|
+
warnings
|
|
3436
|
+
}) {
|
|
3437
|
+
var _a2;
|
|
3438
|
+
const convertScalarOutput = (value) => promptCacheBreakpoint == null ? value : [
|
|
3439
|
+
{
|
|
3440
|
+
type: "input_text",
|
|
3441
|
+
text: value,
|
|
3442
|
+
prompt_cache_breakpoint: promptCacheBreakpoint
|
|
3443
|
+
}
|
|
3444
|
+
];
|
|
3445
|
+
switch (output.type) {
|
|
3446
|
+
case "text":
|
|
3447
|
+
case "error-text":
|
|
3448
|
+
return convertScalarOutput(output.value);
|
|
3449
|
+
case "execution-denied": {
|
|
3450
|
+
return convertScalarOutput(
|
|
3451
|
+
(_a2 = output.reason) != null ? _a2 : "Tool call execution denied."
|
|
3452
|
+
);
|
|
3453
|
+
}
|
|
3454
|
+
case "json":
|
|
3455
|
+
case "error-json":
|
|
3456
|
+
return convertScalarOutput(JSON.stringify(output.value));
|
|
3457
|
+
case "content":
|
|
3458
|
+
return output.value.map((item) => {
|
|
3459
|
+
var _a3, _b, _c, _d, _e, _f, _g;
|
|
3460
|
+
const promptCacheBreakpoint2 = getPromptCacheBreakpoint2(
|
|
3461
|
+
item.providerOptions,
|
|
3462
|
+
providerOptionsName
|
|
3463
|
+
);
|
|
3464
|
+
switch (item.type) {
|
|
3465
|
+
case "text": {
|
|
3466
|
+
return {
|
|
3467
|
+
type: "input_text",
|
|
3468
|
+
text: item.text,
|
|
3469
|
+
...promptCacheBreakpoint2 != null && {
|
|
3470
|
+
prompt_cache_breakpoint: promptCacheBreakpoint2
|
|
3471
|
+
}
|
|
3472
|
+
};
|
|
3473
|
+
}
|
|
3474
|
+
case "image-data": {
|
|
3475
|
+
return {
|
|
3476
|
+
type: "input_image",
|
|
3477
|
+
image_url: `data:${item.mediaType};base64,${item.data}`,
|
|
3478
|
+
detail: (_b = (_a3 = item.providerOptions) == null ? void 0 : _a3[providerOptionsName]) == null ? void 0 : _b.imageDetail,
|
|
3479
|
+
...promptCacheBreakpoint2 != null && {
|
|
3480
|
+
prompt_cache_breakpoint: promptCacheBreakpoint2
|
|
3481
|
+
}
|
|
3482
|
+
};
|
|
3483
|
+
}
|
|
3484
|
+
case "image-url": {
|
|
3485
|
+
return {
|
|
3486
|
+
type: "input_image",
|
|
3487
|
+
image_url: item.url,
|
|
3488
|
+
detail: (_d = (_c = item.providerOptions) == null ? void 0 : _c[providerOptionsName]) == null ? void 0 : _d.imageDetail,
|
|
3489
|
+
...promptCacheBreakpoint2 != null && {
|
|
3490
|
+
prompt_cache_breakpoint: promptCacheBreakpoint2
|
|
3491
|
+
}
|
|
3492
|
+
};
|
|
3493
|
+
}
|
|
3494
|
+
case "file-id": {
|
|
3495
|
+
return {
|
|
3496
|
+
type: "input_file",
|
|
3497
|
+
file_id: typeof item.fileId === "string" ? item.fileId : item.fileId[providerOptionsName],
|
|
3498
|
+
...promptCacheBreakpoint2 != null && {
|
|
3499
|
+
prompt_cache_breakpoint: promptCacheBreakpoint2
|
|
3500
|
+
}
|
|
3501
|
+
};
|
|
3502
|
+
}
|
|
3503
|
+
case "image-file-id": {
|
|
3504
|
+
return {
|
|
3505
|
+
type: "input_image",
|
|
3506
|
+
file_id: typeof item.fileId === "string" ? item.fileId : item.fileId[providerOptionsName],
|
|
3507
|
+
detail: (_f = (_e = item.providerOptions) == null ? void 0 : _e[providerOptionsName]) == null ? void 0 : _f.imageDetail,
|
|
3508
|
+
...promptCacheBreakpoint2 != null && {
|
|
3509
|
+
prompt_cache_breakpoint: promptCacheBreakpoint2
|
|
3510
|
+
}
|
|
3511
|
+
};
|
|
3512
|
+
}
|
|
3513
|
+
case "file-data": {
|
|
3514
|
+
return {
|
|
3515
|
+
type: "input_file",
|
|
3516
|
+
filename: (_g = item.filename) != null ? _g : "data",
|
|
3517
|
+
file_data: `data:${item.mediaType};base64,${item.data}`,
|
|
3518
|
+
...promptCacheBreakpoint2 != null && {
|
|
3519
|
+
prompt_cache_breakpoint: promptCacheBreakpoint2
|
|
3520
|
+
}
|
|
3521
|
+
};
|
|
3522
|
+
}
|
|
3523
|
+
case "file-url": {
|
|
3524
|
+
return {
|
|
3525
|
+
type: "input_file",
|
|
3526
|
+
file_url: item.url,
|
|
3527
|
+
...promptCacheBreakpoint2 != null && {
|
|
3528
|
+
prompt_cache_breakpoint: promptCacheBreakpoint2
|
|
3529
|
+
}
|
|
3530
|
+
};
|
|
3531
|
+
}
|
|
3532
|
+
default: {
|
|
3533
|
+
warnings.push({
|
|
3534
|
+
type: "other",
|
|
3535
|
+
message: `unsupported tool content part type: ${item.type}`
|
|
3536
|
+
});
|
|
3537
|
+
return void 0;
|
|
3538
|
+
}
|
|
3539
|
+
}
|
|
3540
|
+
}).filter(import_provider_utils28.isNonNullable);
|
|
3541
|
+
}
|
|
3542
|
+
}
|
|
3543
|
+
function hasSameParallelToolCall(first, second) {
|
|
3544
|
+
return first.itemId === second.itemId && first.toolCallId === second.toolCallId && first.toolName === second.toolName && first.input === second.input && first.count === second.count;
|
|
3545
|
+
}
|
|
3546
|
+
function collectCompleteParallelToolResultGroups({
|
|
3547
|
+
prompt,
|
|
3548
|
+
providerOptionsName
|
|
3549
|
+
}) {
|
|
3550
|
+
const pendingGroups = /* @__PURE__ */ new Map();
|
|
3551
|
+
for (const message of prompt) {
|
|
3552
|
+
if (message.role !== "tool") {
|
|
3553
|
+
continue;
|
|
3554
|
+
}
|
|
3555
|
+
for (const part of message.content) {
|
|
3556
|
+
if (part.type !== "tool-result") {
|
|
3557
|
+
continue;
|
|
3558
|
+
}
|
|
3559
|
+
const metadata = getParallelToolCallMetadata({
|
|
3560
|
+
providerOptions: part.providerOptions,
|
|
3561
|
+
providerOptionsName
|
|
3562
|
+
});
|
|
3563
|
+
if (metadata == null) {
|
|
3564
|
+
continue;
|
|
3565
|
+
}
|
|
3566
|
+
const existing = pendingGroups.get(metadata.toolCallId);
|
|
3567
|
+
if (existing == null) {
|
|
3568
|
+
pendingGroups.set(metadata.toolCallId, {
|
|
3569
|
+
metadata,
|
|
3570
|
+
results: /* @__PURE__ */ new Map([[metadata.index, part]]),
|
|
3571
|
+
invalid: false
|
|
3572
|
+
});
|
|
3573
|
+
continue;
|
|
3574
|
+
}
|
|
3575
|
+
if (!hasSameParallelToolCall(existing.metadata, metadata) || existing.results.has(metadata.index)) {
|
|
3576
|
+
existing.invalid = true;
|
|
3577
|
+
continue;
|
|
3578
|
+
}
|
|
3579
|
+
existing.results.set(metadata.index, part);
|
|
3580
|
+
}
|
|
3581
|
+
}
|
|
3582
|
+
const completeGroups = /* @__PURE__ */ new Map();
|
|
3583
|
+
for (const [toolCallId, group] of pendingGroups) {
|
|
3584
|
+
if (group.invalid || group.results.size !== group.metadata.count) {
|
|
3585
|
+
continue;
|
|
3586
|
+
}
|
|
3587
|
+
const results = Array.from(
|
|
3588
|
+
{ length: group.metadata.count },
|
|
3589
|
+
(_, index) => group.results.get(index)
|
|
3590
|
+
);
|
|
3591
|
+
if (results.every(import_provider_utils28.isNonNullable)) {
|
|
3592
|
+
completeGroups.set(toolCallId, {
|
|
3593
|
+
metadata: group.metadata,
|
|
3594
|
+
results
|
|
3595
|
+
});
|
|
3596
|
+
}
|
|
3597
|
+
}
|
|
3598
|
+
return completeGroups;
|
|
3599
|
+
}
|
|
3600
|
+
function getPromptCacheBreakpoint2(providerOptions, providerOptionsName) {
|
|
3601
|
+
var _a2;
|
|
3602
|
+
return (_a2 = providerOptions == null ? void 0 : providerOptions[providerOptionsName]) == null ? void 0 : _a2.promptCacheBreakpoint;
|
|
3301
3603
|
}
|
|
3302
3604
|
function getScalarToolResultPromptCacheBreakpoint({
|
|
3303
3605
|
output,
|
|
@@ -3325,6 +3627,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3325
3627
|
store,
|
|
3326
3628
|
hasConversation = false,
|
|
3327
3629
|
hasPreviousResponseId = false,
|
|
3630
|
+
configurationUpdateUnsupportedReason,
|
|
3328
3631
|
hasLocalShellTool = false,
|
|
3329
3632
|
hasShellTool = false,
|
|
3330
3633
|
hasApplyPatchTool = false,
|
|
@@ -3344,6 +3647,33 @@ async function convertToOpenAIResponsesInput({
|
|
|
3344
3647
|
for (const { role, content, providerOptions } of prompt) {
|
|
3345
3648
|
switch (role) {
|
|
3346
3649
|
case "system": {
|
|
3650
|
+
let options = await (0, import_provider_utils28.parseProviderOptions)({
|
|
3651
|
+
provider: providerOptionsName,
|
|
3652
|
+
providerOptions,
|
|
3653
|
+
schema: openaiResponsesSystemMessageOptionsSchema
|
|
3654
|
+
});
|
|
3655
|
+
if (options == null && providerOptionsName !== "openai") {
|
|
3656
|
+
options = await (0, import_provider_utils28.parseProviderOptions)({
|
|
3657
|
+
provider: "openai",
|
|
3658
|
+
providerOptions,
|
|
3659
|
+
schema: openaiResponsesSystemMessageOptionsSchema
|
|
3660
|
+
});
|
|
3661
|
+
}
|
|
3662
|
+
const effort = options == null ? void 0 : options.reasoningEffortUpdate;
|
|
3663
|
+
if (effort != null) {
|
|
3664
|
+
const unsupportedReason = content !== "" ? "Message-level reasoningEffortUpdate requires empty system message content." : configurationUpdateUnsupportedReason;
|
|
3665
|
+
if (unsupportedReason != null) {
|
|
3666
|
+
throw new import_provider8.UnsupportedFunctionalityError({
|
|
3667
|
+
functionality: "Message-level reasoningEffortUpdate",
|
|
3668
|
+
message: unsupportedReason
|
|
3669
|
+
});
|
|
3670
|
+
}
|
|
3671
|
+
input.push({
|
|
3672
|
+
type: "configuration_update",
|
|
3673
|
+
reasoning: { effort }
|
|
3674
|
+
});
|
|
3675
|
+
break;
|
|
3676
|
+
}
|
|
3347
3677
|
switch (systemMessageMode) {
|
|
3348
3678
|
case "system": {
|
|
3349
3679
|
const promptCacheBreakpoint = getPromptCacheBreakpoint2(
|
|
@@ -3427,7 +3757,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3427
3757
|
return {
|
|
3428
3758
|
type: "input_image",
|
|
3429
3759
|
...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
3430
|
-
image_url: `data:${mediaType};base64,${(0,
|
|
3760
|
+
image_url: `data:${mediaType};base64,${(0, import_provider_utils28.convertToBase64)(part.data)}`
|
|
3431
3761
|
},
|
|
3432
3762
|
detail: (_b2 = (_a3 = part.providerOptions) == null ? void 0 : _a3[providerOptionsName]) == null ? void 0 : _b2.imageDetail,
|
|
3433
3763
|
...promptCacheBreakpoint != null && {
|
|
@@ -3453,7 +3783,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3453
3783
|
type: "input_file",
|
|
3454
3784
|
...typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
3455
3785
|
filename: (_c2 = part.filename) != null ? _c2 : mediaType === "application/pdf" ? `part-${index}.pdf` : `part-${index}`,
|
|
3456
|
-
file_data: `data:${mediaType};base64,${(0,
|
|
3786
|
+
file_data: `data:${mediaType};base64,${(0, import_provider_utils28.convertToBase64)(part.data)}`
|
|
3457
3787
|
},
|
|
3458
3788
|
...promptCacheBreakpoint != null && {
|
|
3459
3789
|
prompt_cache_breakpoint: promptCacheBreakpoint
|
|
@@ -3532,10 +3862,10 @@ async function convertToOpenAIResponsesInput({
|
|
|
3532
3862
|
input.push({ type: "item_reference", id });
|
|
3533
3863
|
break;
|
|
3534
3864
|
}
|
|
3535
|
-
const parsedInput = typeof part.input === "string" ? await (0,
|
|
3865
|
+
const parsedInput = typeof part.input === "string" ? await (0, import_provider_utils28.parseJSON)({
|
|
3536
3866
|
text: part.input,
|
|
3537
3867
|
schema: toolSearchInputSchema
|
|
3538
|
-
}) : await (0,
|
|
3868
|
+
}) : await (0, import_provider_utils28.validateTypes)({
|
|
3539
3869
|
value: part.input,
|
|
3540
3870
|
schema: toolSearchInputSchema
|
|
3541
3871
|
});
|
|
@@ -3567,7 +3897,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3567
3897
|
break;
|
|
3568
3898
|
}
|
|
3569
3899
|
if (hasLocalShellTool && resolvedToolName === "local_shell") {
|
|
3570
|
-
const parsedInput = await (0,
|
|
3900
|
+
const parsedInput = await (0, import_provider_utils28.validateTypes)({
|
|
3571
3901
|
value: part.input,
|
|
3572
3902
|
schema: localShellInputSchema
|
|
3573
3903
|
});
|
|
@@ -3587,7 +3917,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3587
3917
|
break;
|
|
3588
3918
|
}
|
|
3589
3919
|
if (hasShellTool && resolvedToolName === "shell") {
|
|
3590
|
-
const parsedInput = await (0,
|
|
3920
|
+
const parsedInput = await (0, import_provider_utils28.validateTypes)({
|
|
3591
3921
|
value: part.input,
|
|
3592
3922
|
schema: shellInputSchema
|
|
3593
3923
|
});
|
|
@@ -3605,7 +3935,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3605
3935
|
break;
|
|
3606
3936
|
}
|
|
3607
3937
|
if (hasApplyPatchTool && resolvedToolName === "apply_patch") {
|
|
3608
|
-
const parsedInput = await (0,
|
|
3938
|
+
const parsedInput = await (0, import_provider_utils28.validateTypes)({
|
|
3609
3939
|
value: part.input,
|
|
3610
3940
|
schema: applyPatchInputSchema
|
|
3611
3941
|
});
|
|
@@ -3655,7 +3985,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3655
3985
|
if (store) {
|
|
3656
3986
|
input.push({ type: "item_reference", id: itemId });
|
|
3657
3987
|
} else if (part.output.type === "json") {
|
|
3658
|
-
const parsedOutput = await (0,
|
|
3988
|
+
const parsedOutput = await (0, import_provider_utils28.validateTypes)({
|
|
3659
3989
|
value: part.output.value,
|
|
3660
3990
|
schema: toolSearchOutputSchema
|
|
3661
3991
|
});
|
|
@@ -3672,7 +4002,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3672
4002
|
}
|
|
3673
4003
|
if (hasShellTool && resolvedResultToolName === "shell") {
|
|
3674
4004
|
if (part.output.type === "json") {
|
|
3675
|
-
const parsedOutput = await (0,
|
|
4005
|
+
const parsedOutput = await (0, import_provider_utils28.validateTypes)({
|
|
3676
4006
|
value: part.output.value,
|
|
3677
4007
|
schema: shellOutputSchema
|
|
3678
4008
|
});
|
|
@@ -3703,7 +4033,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3703
4033
|
break;
|
|
3704
4034
|
}
|
|
3705
4035
|
case "reasoning": {
|
|
3706
|
-
const providerOptions2 = await (0,
|
|
4036
|
+
const providerOptions2 = await (0, import_provider_utils28.parseProviderOptions)({
|
|
3707
4037
|
provider: providerOptionsName,
|
|
3708
4038
|
providerOptions: part.providerOptions,
|
|
3709
4039
|
schema: openaiResponsesReasoningProviderOptionsSchema
|
|
@@ -3868,7 +4198,7 @@ ${text}`,
|
|
|
3868
4198
|
part.toolName
|
|
3869
4199
|
);
|
|
3870
4200
|
if (part.toolName === toolSearchToolName && output.type === "json") {
|
|
3871
|
-
const parsedOutput = await (0,
|
|
4201
|
+
const parsedOutput = await (0, import_provider_utils28.validateTypes)({
|
|
3872
4202
|
value: output.value,
|
|
3873
4203
|
schema: toolSearchOutputSchema
|
|
3874
4204
|
});
|
|
@@ -3882,7 +4212,7 @@ ${text}`,
|
|
|
3882
4212
|
continue;
|
|
3883
4213
|
}
|
|
3884
4214
|
if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
|
|
3885
|
-
const parsedOutput = await (0,
|
|
4215
|
+
const parsedOutput = await (0, import_provider_utils28.validateTypes)({
|
|
3886
4216
|
value: output.value,
|
|
3887
4217
|
schema: localShellOutputSchema
|
|
3888
4218
|
});
|
|
@@ -3894,7 +4224,7 @@ ${text}`,
|
|
|
3894
4224
|
continue;
|
|
3895
4225
|
}
|
|
3896
4226
|
if (hasShellTool && resolvedToolName === "shell" && output.type === "json") {
|
|
3897
|
-
const parsedOutput = await (0,
|
|
4227
|
+
const parsedOutput = await (0, import_provider_utils28.validateTypes)({
|
|
3898
4228
|
value: output.value,
|
|
3899
4229
|
schema: shellOutputSchema
|
|
3900
4230
|
});
|
|
@@ -3913,7 +4243,7 @@ ${text}`,
|
|
|
3913
4243
|
continue;
|
|
3914
4244
|
}
|
|
3915
4245
|
if (hasApplyPatchTool && part.toolName === "apply_patch" && output.type === "json") {
|
|
3916
|
-
const parsedOutput = await (0,
|
|
4246
|
+
const parsedOutput = await (0, import_provider_utils28.validateTypes)({
|
|
3917
4247
|
value: output.value,
|
|
3918
4248
|
schema: applyPatchOutputSchema
|
|
3919
4249
|
});
|
|
@@ -4011,7 +4341,7 @@ ${text}`,
|
|
|
4011
4341
|
});
|
|
4012
4342
|
return void 0;
|
|
4013
4343
|
}
|
|
4014
|
-
}).filter(
|
|
4344
|
+
}).filter(import_provider_utils28.isNonNullable);
|
|
4015
4345
|
break;
|
|
4016
4346
|
default:
|
|
4017
4347
|
outputValue = "";
|
|
@@ -4060,9 +4390,9 @@ ${text}`,
|
|
|
4060
4390
|
}
|
|
4061
4391
|
return { input, warnings };
|
|
4062
4392
|
}
|
|
4063
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
4064
|
-
itemId:
|
|
4065
|
-
reasoningEncryptedContent:
|
|
4393
|
+
var openaiResponsesReasoningProviderOptionsSchema = import_v422.z.object({
|
|
4394
|
+
itemId: import_v422.z.string().nullish(),
|
|
4395
|
+
reasoningEncryptedContent: import_v422.z.string().nullish()
|
|
4066
4396
|
});
|
|
4067
4397
|
|
|
4068
4398
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -4084,75 +4414,75 @@ function mapOpenAIResponseFinishReason({
|
|
|
4084
4414
|
}
|
|
4085
4415
|
|
|
4086
4416
|
// src/responses/openai-responses-api.ts
|
|
4087
|
-
var
|
|
4088
|
-
var
|
|
4089
|
-
var jsonValueSchema2 =
|
|
4090
|
-
() =>
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4417
|
+
var import_provider_utils29 = require("@ai-sdk/provider-utils");
|
|
4418
|
+
var import_v423 = require("zod/v4");
|
|
4419
|
+
var jsonValueSchema2 = import_v423.z.lazy(
|
|
4420
|
+
() => import_v423.z.union([
|
|
4421
|
+
import_v423.z.string(),
|
|
4422
|
+
import_v423.z.number(),
|
|
4423
|
+
import_v423.z.boolean(),
|
|
4424
|
+
import_v423.z.null(),
|
|
4425
|
+
import_v423.z.array(jsonValueSchema2),
|
|
4426
|
+
import_v423.z.record(import_v423.z.string(), jsonValueSchema2.optional())
|
|
4097
4427
|
])
|
|
4098
4428
|
);
|
|
4099
|
-
var jsonObjectSchema =
|
|
4100
|
-
var openaiResponsesUsageSchema =
|
|
4429
|
+
var jsonObjectSchema = import_v423.z.record(import_v423.z.string(), jsonValueSchema2.optional());
|
|
4430
|
+
var openaiResponsesUsageSchema = import_v423.z.intersection(
|
|
4101
4431
|
jsonObjectSchema,
|
|
4102
|
-
|
|
4103
|
-
input_tokens:
|
|
4104
|
-
input_tokens_details:
|
|
4432
|
+
import_v423.z.object({
|
|
4433
|
+
input_tokens: import_v423.z.number(),
|
|
4434
|
+
input_tokens_details: import_v423.z.intersection(
|
|
4105
4435
|
jsonObjectSchema,
|
|
4106
|
-
|
|
4107
|
-
cached_tokens:
|
|
4108
|
-
cache_write_tokens:
|
|
4109
|
-
orchestration_input_tokens:
|
|
4110
|
-
orchestration_input_cached_tokens:
|
|
4436
|
+
import_v423.z.object({
|
|
4437
|
+
cached_tokens: import_v423.z.number().nullish(),
|
|
4438
|
+
cache_write_tokens: import_v423.z.number().nullish(),
|
|
4439
|
+
orchestration_input_tokens: import_v423.z.number().nullish(),
|
|
4440
|
+
orchestration_input_cached_tokens: import_v423.z.number().nullish()
|
|
4111
4441
|
})
|
|
4112
4442
|
).nullish(),
|
|
4113
|
-
output_tokens:
|
|
4114
|
-
output_tokens_details:
|
|
4443
|
+
output_tokens: import_v423.z.number(),
|
|
4444
|
+
output_tokens_details: import_v423.z.intersection(
|
|
4115
4445
|
jsonObjectSchema,
|
|
4116
|
-
|
|
4117
|
-
reasoning_tokens:
|
|
4118
|
-
orchestration_output_tokens:
|
|
4446
|
+
import_v423.z.object({
|
|
4447
|
+
reasoning_tokens: import_v423.z.number().nullish(),
|
|
4448
|
+
orchestration_output_tokens: import_v423.z.number().nullish()
|
|
4119
4449
|
})
|
|
4120
4450
|
).nullish(),
|
|
4121
|
-
total_tokens:
|
|
4451
|
+
total_tokens: import_v423.z.number().optional()
|
|
4122
4452
|
})
|
|
4123
4453
|
);
|
|
4124
4454
|
function isRecord(value) {
|
|
4125
4455
|
return value != null && typeof value === "object" && !Array.isArray(value);
|
|
4126
4456
|
}
|
|
4127
|
-
var openaiResponsesLocalShellCallSchema =
|
|
4128
|
-
type:
|
|
4129
|
-
id:
|
|
4130
|
-
call_id:
|
|
4131
|
-
action:
|
|
4132
|
-
type:
|
|
4133
|
-
command:
|
|
4134
|
-
timeout_ms:
|
|
4135
|
-
user:
|
|
4136
|
-
working_directory:
|
|
4137
|
-
env:
|
|
4457
|
+
var openaiResponsesLocalShellCallSchema = import_v423.z.object({
|
|
4458
|
+
type: import_v423.z.literal("local_shell_call"),
|
|
4459
|
+
id: import_v423.z.string(),
|
|
4460
|
+
call_id: import_v423.z.string(),
|
|
4461
|
+
action: import_v423.z.object({
|
|
4462
|
+
type: import_v423.z.literal("exec"),
|
|
4463
|
+
command: import_v423.z.array(import_v423.z.string()),
|
|
4464
|
+
timeout_ms: import_v423.z.number().optional(),
|
|
4465
|
+
user: import_v423.z.string().optional(),
|
|
4466
|
+
working_directory: import_v423.z.string().optional(),
|
|
4467
|
+
env: import_v423.z.record(import_v423.z.string(), import_v423.z.string()).optional()
|
|
4138
4468
|
})
|
|
4139
4469
|
});
|
|
4140
|
-
var openaiResponsesNestedErrorChunkSchema =
|
|
4141
|
-
type:
|
|
4142
|
-
sequence_number:
|
|
4143
|
-
error:
|
|
4144
|
-
type:
|
|
4145
|
-
code:
|
|
4146
|
-
message:
|
|
4147
|
-
param:
|
|
4470
|
+
var openaiResponsesNestedErrorChunkSchema = import_v423.z.object({
|
|
4471
|
+
type: import_v423.z.literal("error"),
|
|
4472
|
+
sequence_number: import_v423.z.number(),
|
|
4473
|
+
error: import_v423.z.object({
|
|
4474
|
+
type: import_v423.z.string(),
|
|
4475
|
+
code: import_v423.z.string(),
|
|
4476
|
+
message: import_v423.z.string(),
|
|
4477
|
+
param: import_v423.z.string().nullish()
|
|
4148
4478
|
})
|
|
4149
4479
|
});
|
|
4150
|
-
var openaiResponsesErrorChunkSchema =
|
|
4151
|
-
type:
|
|
4152
|
-
sequence_number:
|
|
4153
|
-
code:
|
|
4154
|
-
message:
|
|
4155
|
-
param:
|
|
4480
|
+
var openaiResponsesErrorChunkSchema = import_v423.z.object({
|
|
4481
|
+
type: import_v423.z.literal("error"),
|
|
4482
|
+
sequence_number: import_v423.z.number(),
|
|
4483
|
+
code: import_v423.z.string().nullish(),
|
|
4484
|
+
message: import_v423.z.string(),
|
|
4485
|
+
param: import_v423.z.string().nullish()
|
|
4156
4486
|
});
|
|
4157
4487
|
var openaiResponsesModeledChunkTypes = /* @__PURE__ */ new Set([
|
|
4158
4488
|
"error",
|
|
@@ -4208,1102 +4538,819 @@ function isModeledOpenAIResponsesChunk(value) {
|
|
|
4208
4538
|
}
|
|
4209
4539
|
return openaiResponsesModeledOutputItemTypes.has(value.item.type);
|
|
4210
4540
|
}
|
|
4211
|
-
var openaiResponsesChunkSchema = (0,
|
|
4212
|
-
() => (0,
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
type:
|
|
4216
|
-
item_id:
|
|
4217
|
-
delta:
|
|
4218
|
-
logprobs:
|
|
4219
|
-
|
|
4220
|
-
token:
|
|
4221
|
-
logprob:
|
|
4222
|
-
top_logprobs:
|
|
4223
|
-
|
|
4224
|
-
token:
|
|
4225
|
-
logprob:
|
|
4541
|
+
var openaiResponsesChunkSchema = (0, import_provider_utils29.lazySchema)(
|
|
4542
|
+
() => (0, import_provider_utils29.zodSchema)(
|
|
4543
|
+
import_v423.z.union([
|
|
4544
|
+
import_v423.z.object({
|
|
4545
|
+
type: import_v423.z.literal("response.output_text.delta"),
|
|
4546
|
+
item_id: import_v423.z.string(),
|
|
4547
|
+
delta: import_v423.z.string(),
|
|
4548
|
+
logprobs: import_v423.z.array(
|
|
4549
|
+
import_v423.z.object({
|
|
4550
|
+
token: import_v423.z.string(),
|
|
4551
|
+
logprob: import_v423.z.number(),
|
|
4552
|
+
top_logprobs: import_v423.z.array(
|
|
4553
|
+
import_v423.z.object({
|
|
4554
|
+
token: import_v423.z.string(),
|
|
4555
|
+
logprob: import_v423.z.number()
|
|
4226
4556
|
})
|
|
4227
4557
|
)
|
|
4228
4558
|
})
|
|
4229
4559
|
).nullish()
|
|
4230
4560
|
}),
|
|
4231
|
-
|
|
4232
|
-
type:
|
|
4233
|
-
response:
|
|
4234
|
-
incomplete_details:
|
|
4561
|
+
import_v423.z.object({
|
|
4562
|
+
type: import_v423.z.enum(["response.completed", "response.incomplete"]),
|
|
4563
|
+
response: import_v423.z.object({
|
|
4564
|
+
incomplete_details: import_v423.z.object({ reason: import_v423.z.string() }).nullish(),
|
|
4235
4565
|
usage: openaiResponsesUsageSchema.nullish(),
|
|
4236
|
-
reasoning:
|
|
4237
|
-
context:
|
|
4566
|
+
reasoning: import_v423.z.object({
|
|
4567
|
+
context: import_v423.z.string().nullish()
|
|
4238
4568
|
}).nullish(),
|
|
4239
|
-
service_tier:
|
|
4569
|
+
service_tier: import_v423.z.string().nullish()
|
|
4240
4570
|
})
|
|
4241
4571
|
}),
|
|
4242
|
-
|
|
4243
|
-
type:
|
|
4244
|
-
sequence_number:
|
|
4245
|
-
response:
|
|
4246
|
-
error:
|
|
4247
|
-
code:
|
|
4248
|
-
message:
|
|
4572
|
+
import_v423.z.object({
|
|
4573
|
+
type: import_v423.z.literal("response.failed"),
|
|
4574
|
+
sequence_number: import_v423.z.number(),
|
|
4575
|
+
response: import_v423.z.object({
|
|
4576
|
+
error: import_v423.z.object({
|
|
4577
|
+
code: import_v423.z.string().nullish(),
|
|
4578
|
+
message: import_v423.z.string()
|
|
4249
4579
|
}).nullish(),
|
|
4250
|
-
incomplete_details:
|
|
4580
|
+
incomplete_details: import_v423.z.object({ reason: import_v423.z.string() }).nullish(),
|
|
4251
4581
|
usage: openaiResponsesUsageSchema.nullish(),
|
|
4252
|
-
reasoning:
|
|
4253
|
-
context:
|
|
4582
|
+
reasoning: import_v423.z.object({
|
|
4583
|
+
context: import_v423.z.string().nullish()
|
|
4254
4584
|
}).nullish(),
|
|
4255
|
-
service_tier:
|
|
4585
|
+
service_tier: import_v423.z.string().nullish()
|
|
4256
4586
|
})
|
|
4257
4587
|
}),
|
|
4258
|
-
|
|
4259
|
-
type:
|
|
4260
|
-
response:
|
|
4261
|
-
id:
|
|
4262
|
-
created_at:
|
|
4263
|
-
model:
|
|
4264
|
-
service_tier:
|
|
4588
|
+
import_v423.z.object({
|
|
4589
|
+
type: import_v423.z.literal("response.created"),
|
|
4590
|
+
response: import_v423.z.object({
|
|
4591
|
+
id: import_v423.z.string(),
|
|
4592
|
+
created_at: import_v423.z.number(),
|
|
4593
|
+
model: import_v423.z.string(),
|
|
4594
|
+
service_tier: import_v423.z.string().nullish()
|
|
4265
4595
|
})
|
|
4266
4596
|
}),
|
|
4267
|
-
|
|
4268
|
-
type:
|
|
4269
|
-
output_index:
|
|
4270
|
-
item:
|
|
4271
|
-
|
|
4272
|
-
type:
|
|
4273
|
-
id:
|
|
4274
|
-
phase:
|
|
4597
|
+
import_v423.z.object({
|
|
4598
|
+
type: import_v423.z.literal("response.output_item.added"),
|
|
4599
|
+
output_index: import_v423.z.number(),
|
|
4600
|
+
item: import_v423.z.discriminatedUnion("type", [
|
|
4601
|
+
import_v423.z.object({
|
|
4602
|
+
type: import_v423.z.literal("message"),
|
|
4603
|
+
id: import_v423.z.string(),
|
|
4604
|
+
phase: import_v423.z.enum(["commentary", "final_answer"]).nullish()
|
|
4275
4605
|
}),
|
|
4276
|
-
|
|
4277
|
-
type:
|
|
4278
|
-
id:
|
|
4279
|
-
encrypted_content:
|
|
4606
|
+
import_v423.z.object({
|
|
4607
|
+
type: import_v423.z.literal("reasoning"),
|
|
4608
|
+
id: import_v423.z.string(),
|
|
4609
|
+
encrypted_content: import_v423.z.string().nullish()
|
|
4280
4610
|
}),
|
|
4281
|
-
|
|
4282
|
-
type:
|
|
4283
|
-
id:
|
|
4284
|
-
call_id:
|
|
4285
|
-
name:
|
|
4286
|
-
arguments:
|
|
4287
|
-
async:
|
|
4288
|
-
namespace:
|
|
4611
|
+
import_v423.z.object({
|
|
4612
|
+
type: import_v423.z.literal("function_call"),
|
|
4613
|
+
id: import_v423.z.string(),
|
|
4614
|
+
call_id: import_v423.z.string(),
|
|
4615
|
+
name: import_v423.z.string(),
|
|
4616
|
+
arguments: import_v423.z.string(),
|
|
4617
|
+
async: import_v423.z.boolean().nullish(),
|
|
4618
|
+
namespace: import_v423.z.string().nullish()
|
|
4289
4619
|
}),
|
|
4290
|
-
|
|
4291
|
-
type:
|
|
4292
|
-
id:
|
|
4293
|
-
status:
|
|
4620
|
+
import_v423.z.object({
|
|
4621
|
+
type: import_v423.z.literal("web_search_call"),
|
|
4622
|
+
id: import_v423.z.string(),
|
|
4623
|
+
status: import_v423.z.string()
|
|
4294
4624
|
}),
|
|
4295
|
-
|
|
4296
|
-
type:
|
|
4297
|
-
id:
|
|
4298
|
-
status:
|
|
4625
|
+
import_v423.z.object({
|
|
4626
|
+
type: import_v423.z.literal("computer_call"),
|
|
4627
|
+
id: import_v423.z.string(),
|
|
4628
|
+
status: import_v423.z.string()
|
|
4299
4629
|
}),
|
|
4300
|
-
|
|
4301
|
-
type:
|
|
4302
|
-
id:
|
|
4630
|
+
import_v423.z.object({
|
|
4631
|
+
type: import_v423.z.literal("file_search_call"),
|
|
4632
|
+
id: import_v423.z.string()
|
|
4303
4633
|
}),
|
|
4304
4634
|
openaiResponsesLocalShellCallSchema,
|
|
4305
|
-
|
|
4306
|
-
type:
|
|
4307
|
-
id:
|
|
4635
|
+
import_v423.z.object({
|
|
4636
|
+
type: import_v423.z.literal("image_generation_call"),
|
|
4637
|
+
id: import_v423.z.string()
|
|
4308
4638
|
}),
|
|
4309
|
-
|
|
4310
|
-
type:
|
|
4311
|
-
id:
|
|
4312
|
-
container_id:
|
|
4313
|
-
code:
|
|
4314
|
-
outputs:
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4639
|
+
import_v423.z.object({
|
|
4640
|
+
type: import_v423.z.literal("code_interpreter_call"),
|
|
4641
|
+
id: import_v423.z.string(),
|
|
4642
|
+
container_id: import_v423.z.string(),
|
|
4643
|
+
code: import_v423.z.string().nullable(),
|
|
4644
|
+
outputs: import_v423.z.array(
|
|
4645
|
+
import_v423.z.discriminatedUnion("type", [
|
|
4646
|
+
import_v423.z.object({ type: import_v423.z.literal("logs"), logs: import_v423.z.string() }),
|
|
4647
|
+
import_v423.z.object({ type: import_v423.z.literal("image"), url: import_v423.z.string() })
|
|
4318
4648
|
])
|
|
4319
4649
|
).nullable(),
|
|
4320
|
-
status:
|
|
4650
|
+
status: import_v423.z.string()
|
|
4321
4651
|
}),
|
|
4322
|
-
|
|
4323
|
-
type:
|
|
4324
|
-
id:
|
|
4325
|
-
status:
|
|
4326
|
-
approval_request_id:
|
|
4652
|
+
import_v423.z.object({
|
|
4653
|
+
type: import_v423.z.literal("mcp_call"),
|
|
4654
|
+
id: import_v423.z.string(),
|
|
4655
|
+
status: import_v423.z.string(),
|
|
4656
|
+
approval_request_id: import_v423.z.string().nullish()
|
|
4327
4657
|
}),
|
|
4328
|
-
|
|
4329
|
-
type:
|
|
4330
|
-
id:
|
|
4658
|
+
import_v423.z.object({
|
|
4659
|
+
type: import_v423.z.literal("mcp_list_tools"),
|
|
4660
|
+
id: import_v423.z.string()
|
|
4331
4661
|
}),
|
|
4332
|
-
|
|
4333
|
-
type:
|
|
4334
|
-
id:
|
|
4662
|
+
import_v423.z.object({
|
|
4663
|
+
type: import_v423.z.literal("mcp_approval_request"),
|
|
4664
|
+
id: import_v423.z.string()
|
|
4335
4665
|
}),
|
|
4336
|
-
|
|
4337
|
-
type:
|
|
4338
|
-
id:
|
|
4339
|
-
call_id:
|
|
4340
|
-
status:
|
|
4341
|
-
operation:
|
|
4342
|
-
|
|
4343
|
-
type:
|
|
4344
|
-
path:
|
|
4345
|
-
diff:
|
|
4666
|
+
import_v423.z.object({
|
|
4667
|
+
type: import_v423.z.literal("apply_patch_call"),
|
|
4668
|
+
id: import_v423.z.string(),
|
|
4669
|
+
call_id: import_v423.z.string(),
|
|
4670
|
+
status: import_v423.z.enum(["in_progress", "completed"]),
|
|
4671
|
+
operation: import_v423.z.discriminatedUnion("type", [
|
|
4672
|
+
import_v423.z.object({
|
|
4673
|
+
type: import_v423.z.literal("create_file"),
|
|
4674
|
+
path: import_v423.z.string(),
|
|
4675
|
+
diff: import_v423.z.string()
|
|
4346
4676
|
}),
|
|
4347
|
-
|
|
4348
|
-
type:
|
|
4349
|
-
path:
|
|
4677
|
+
import_v423.z.object({
|
|
4678
|
+
type: import_v423.z.literal("delete_file"),
|
|
4679
|
+
path: import_v423.z.string()
|
|
4350
4680
|
}),
|
|
4351
|
-
|
|
4352
|
-
type:
|
|
4353
|
-
path:
|
|
4354
|
-
diff:
|
|
4681
|
+
import_v423.z.object({
|
|
4682
|
+
type: import_v423.z.literal("update_file"),
|
|
4683
|
+
path: import_v423.z.string(),
|
|
4684
|
+
diff: import_v423.z.string()
|
|
4355
4685
|
})
|
|
4356
4686
|
])
|
|
4357
4687
|
}),
|
|
4358
|
-
|
|
4359
|
-
type:
|
|
4360
|
-
id:
|
|
4361
|
-
call_id:
|
|
4362
|
-
name:
|
|
4363
|
-
input:
|
|
4364
|
-
async:
|
|
4688
|
+
import_v423.z.object({
|
|
4689
|
+
type: import_v423.z.literal("custom_tool_call"),
|
|
4690
|
+
id: import_v423.z.string(),
|
|
4691
|
+
call_id: import_v423.z.string(),
|
|
4692
|
+
name: import_v423.z.string(),
|
|
4693
|
+
input: import_v423.z.string(),
|
|
4694
|
+
async: import_v423.z.boolean().nullish()
|
|
4365
4695
|
}),
|
|
4366
|
-
|
|
4367
|
-
type:
|
|
4368
|
-
id:
|
|
4369
|
-
call_id:
|
|
4370
|
-
status:
|
|
4371
|
-
action:
|
|
4372
|
-
commands:
|
|
4696
|
+
import_v423.z.object({
|
|
4697
|
+
type: import_v423.z.literal("shell_call"),
|
|
4698
|
+
id: import_v423.z.string(),
|
|
4699
|
+
call_id: import_v423.z.string(),
|
|
4700
|
+
status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4701
|
+
action: import_v423.z.object({
|
|
4702
|
+
commands: import_v423.z.array(import_v423.z.string())
|
|
4373
4703
|
})
|
|
4374
4704
|
}),
|
|
4375
|
-
|
|
4376
|
-
type:
|
|
4377
|
-
id:
|
|
4378
|
-
call_id:
|
|
4379
|
-
status:
|
|
4380
|
-
output:
|
|
4381
|
-
|
|
4382
|
-
stdout:
|
|
4383
|
-
stderr:
|
|
4384
|
-
outcome:
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
type:
|
|
4388
|
-
exit_code:
|
|
4705
|
+
import_v423.z.object({
|
|
4706
|
+
type: import_v423.z.literal("shell_call_output"),
|
|
4707
|
+
id: import_v423.z.string(),
|
|
4708
|
+
call_id: import_v423.z.string(),
|
|
4709
|
+
status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4710
|
+
output: import_v423.z.array(
|
|
4711
|
+
import_v423.z.object({
|
|
4712
|
+
stdout: import_v423.z.string(),
|
|
4713
|
+
stderr: import_v423.z.string(),
|
|
4714
|
+
outcome: import_v423.z.discriminatedUnion("type", [
|
|
4715
|
+
import_v423.z.object({ type: import_v423.z.literal("timeout") }),
|
|
4716
|
+
import_v423.z.object({
|
|
4717
|
+
type: import_v423.z.literal("exit"),
|
|
4718
|
+
exit_code: import_v423.z.number()
|
|
4389
4719
|
})
|
|
4390
4720
|
])
|
|
4391
4721
|
})
|
|
4392
4722
|
)
|
|
4393
4723
|
}),
|
|
4394
|
-
|
|
4395
|
-
type:
|
|
4396
|
-
id:
|
|
4397
|
-
execution:
|
|
4398
|
-
call_id:
|
|
4399
|
-
status:
|
|
4400
|
-
arguments:
|
|
4724
|
+
import_v423.z.object({
|
|
4725
|
+
type: import_v423.z.literal("tool_search_call"),
|
|
4726
|
+
id: import_v423.z.string(),
|
|
4727
|
+
execution: import_v423.z.enum(["server", "client"]),
|
|
4728
|
+
call_id: import_v423.z.string().nullable(),
|
|
4729
|
+
status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4730
|
+
arguments: import_v423.z.unknown()
|
|
4401
4731
|
}),
|
|
4402
|
-
|
|
4403
|
-
type:
|
|
4404
|
-
id:
|
|
4405
|
-
execution:
|
|
4406
|
-
call_id:
|
|
4407
|
-
status:
|
|
4408
|
-
tools:
|
|
4732
|
+
import_v423.z.object({
|
|
4733
|
+
type: import_v423.z.literal("tool_search_output"),
|
|
4734
|
+
id: import_v423.z.string(),
|
|
4735
|
+
execution: import_v423.z.enum(["server", "client"]),
|
|
4736
|
+
call_id: import_v423.z.string().nullable(),
|
|
4737
|
+
status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4738
|
+
tools: import_v423.z.array(import_v423.z.record(import_v423.z.string(), jsonValueSchema2.optional()))
|
|
4409
4739
|
})
|
|
4410
4740
|
])
|
|
4411
4741
|
}),
|
|
4412
|
-
|
|
4413
|
-
type:
|
|
4414
|
-
output_index:
|
|
4415
|
-
item:
|
|
4416
|
-
|
|
4417
|
-
type:
|
|
4418
|
-
id:
|
|
4419
|
-
phase:
|
|
4742
|
+
import_v423.z.object({
|
|
4743
|
+
type: import_v423.z.literal("response.output_item.done"),
|
|
4744
|
+
output_index: import_v423.z.number(),
|
|
4745
|
+
item: import_v423.z.discriminatedUnion("type", [
|
|
4746
|
+
import_v423.z.object({
|
|
4747
|
+
type: import_v423.z.literal("message"),
|
|
4748
|
+
id: import_v423.z.string(),
|
|
4749
|
+
phase: import_v423.z.enum(["commentary", "final_answer"]).nullish()
|
|
4420
4750
|
}),
|
|
4421
|
-
|
|
4422
|
-
type:
|
|
4423
|
-
id:
|
|
4424
|
-
encrypted_content:
|
|
4751
|
+
import_v423.z.object({
|
|
4752
|
+
type: import_v423.z.literal("reasoning"),
|
|
4753
|
+
id: import_v423.z.string(),
|
|
4754
|
+
encrypted_content: import_v423.z.string().nullish()
|
|
4425
4755
|
}),
|
|
4426
|
-
|
|
4427
|
-
type:
|
|
4428
|
-
id:
|
|
4429
|
-
call_id:
|
|
4430
|
-
name:
|
|
4431
|
-
arguments:
|
|
4432
|
-
async:
|
|
4433
|
-
status:
|
|
4434
|
-
namespace:
|
|
4756
|
+
import_v423.z.object({
|
|
4757
|
+
type: import_v423.z.literal("function_call"),
|
|
4758
|
+
id: import_v423.z.string(),
|
|
4759
|
+
call_id: import_v423.z.string(),
|
|
4760
|
+
name: import_v423.z.string(),
|
|
4761
|
+
arguments: import_v423.z.string(),
|
|
4762
|
+
async: import_v423.z.boolean().nullish(),
|
|
4763
|
+
status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4764
|
+
namespace: import_v423.z.string().nullish()
|
|
4435
4765
|
}),
|
|
4436
|
-
|
|
4437
|
-
type:
|
|
4438
|
-
id:
|
|
4439
|
-
call_id:
|
|
4440
|
-
name:
|
|
4441
|
-
input:
|
|
4442
|
-
async:
|
|
4443
|
-
status:
|
|
4766
|
+
import_v423.z.object({
|
|
4767
|
+
type: import_v423.z.literal("custom_tool_call"),
|
|
4768
|
+
id: import_v423.z.string(),
|
|
4769
|
+
call_id: import_v423.z.string(),
|
|
4770
|
+
name: import_v423.z.string(),
|
|
4771
|
+
input: import_v423.z.string(),
|
|
4772
|
+
async: import_v423.z.boolean().nullish(),
|
|
4773
|
+
status: import_v423.z.enum(["in_progress", "completed", "incomplete"])
|
|
4444
4774
|
}),
|
|
4445
|
-
|
|
4446
|
-
type:
|
|
4447
|
-
id:
|
|
4448
|
-
code:
|
|
4449
|
-
container_id:
|
|
4450
|
-
outputs:
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4775
|
+
import_v423.z.object({
|
|
4776
|
+
type: import_v423.z.literal("code_interpreter_call"),
|
|
4777
|
+
id: import_v423.z.string(),
|
|
4778
|
+
code: import_v423.z.string().nullable(),
|
|
4779
|
+
container_id: import_v423.z.string(),
|
|
4780
|
+
outputs: import_v423.z.array(
|
|
4781
|
+
import_v423.z.discriminatedUnion("type", [
|
|
4782
|
+
import_v423.z.object({ type: import_v423.z.literal("logs"), logs: import_v423.z.string() }),
|
|
4783
|
+
import_v423.z.object({ type: import_v423.z.literal("image"), url: import_v423.z.string() })
|
|
4454
4784
|
])
|
|
4455
4785
|
).nullable()
|
|
4456
4786
|
}),
|
|
4457
|
-
|
|
4458
|
-
type:
|
|
4459
|
-
id:
|
|
4460
|
-
result:
|
|
4787
|
+
import_v423.z.object({
|
|
4788
|
+
type: import_v423.z.literal("image_generation_call"),
|
|
4789
|
+
id: import_v423.z.string(),
|
|
4790
|
+
result: import_v423.z.string()
|
|
4461
4791
|
}),
|
|
4462
|
-
|
|
4463
|
-
type:
|
|
4464
|
-
id:
|
|
4465
|
-
status:
|
|
4466
|
-
action:
|
|
4467
|
-
|
|
4468
|
-
type:
|
|
4469
|
-
query:
|
|
4470
|
-
queries:
|
|
4471
|
-
sources:
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4792
|
+
import_v423.z.object({
|
|
4793
|
+
type: import_v423.z.literal("web_search_call"),
|
|
4794
|
+
id: import_v423.z.string(),
|
|
4795
|
+
status: import_v423.z.string(),
|
|
4796
|
+
action: import_v423.z.discriminatedUnion("type", [
|
|
4797
|
+
import_v423.z.object({
|
|
4798
|
+
type: import_v423.z.literal("search"),
|
|
4799
|
+
query: import_v423.z.string().nullish(),
|
|
4800
|
+
queries: import_v423.z.array(import_v423.z.string()).nullish(),
|
|
4801
|
+
sources: import_v423.z.array(
|
|
4802
|
+
import_v423.z.discriminatedUnion("type", [
|
|
4803
|
+
import_v423.z.object({ type: import_v423.z.literal("url"), url: import_v423.z.string() }),
|
|
4804
|
+
import_v423.z.object({ type: import_v423.z.literal("api"), name: import_v423.z.string() })
|
|
4475
4805
|
])
|
|
4476
4806
|
).nullish()
|
|
4477
4807
|
}),
|
|
4478
|
-
|
|
4479
|
-
type:
|
|
4480
|
-
url:
|
|
4808
|
+
import_v423.z.object({
|
|
4809
|
+
type: import_v423.z.literal("open_page"),
|
|
4810
|
+
url: import_v423.z.string().nullish()
|
|
4481
4811
|
}),
|
|
4482
|
-
|
|
4483
|
-
type:
|
|
4484
|
-
url:
|
|
4485
|
-
pattern:
|
|
4812
|
+
import_v423.z.object({
|
|
4813
|
+
type: import_v423.z.literal("find_in_page"),
|
|
4814
|
+
url: import_v423.z.string().nullish(),
|
|
4815
|
+
pattern: import_v423.z.string().nullish()
|
|
4486
4816
|
})
|
|
4487
4817
|
]).nullish()
|
|
4488
4818
|
}),
|
|
4489
|
-
|
|
4490
|
-
type:
|
|
4491
|
-
id:
|
|
4492
|
-
queries:
|
|
4493
|
-
results:
|
|
4494
|
-
|
|
4495
|
-
attributes:
|
|
4496
|
-
|
|
4497
|
-
|
|
4819
|
+
import_v423.z.object({
|
|
4820
|
+
type: import_v423.z.literal("file_search_call"),
|
|
4821
|
+
id: import_v423.z.string(),
|
|
4822
|
+
queries: import_v423.z.array(import_v423.z.string()),
|
|
4823
|
+
results: import_v423.z.array(
|
|
4824
|
+
import_v423.z.object({
|
|
4825
|
+
attributes: import_v423.z.record(
|
|
4826
|
+
import_v423.z.string(),
|
|
4827
|
+
import_v423.z.union([import_v423.z.string(), import_v423.z.number(), import_v423.z.boolean()])
|
|
4498
4828
|
),
|
|
4499
|
-
file_id:
|
|
4500
|
-
filename:
|
|
4501
|
-
score:
|
|
4502
|
-
text:
|
|
4829
|
+
file_id: import_v423.z.string(),
|
|
4830
|
+
filename: import_v423.z.string(),
|
|
4831
|
+
score: import_v423.z.number(),
|
|
4832
|
+
text: import_v423.z.string()
|
|
4503
4833
|
})
|
|
4504
4834
|
).nullish()
|
|
4505
4835
|
}),
|
|
4506
4836
|
openaiResponsesLocalShellCallSchema,
|
|
4507
|
-
|
|
4508
|
-
type:
|
|
4509
|
-
id:
|
|
4510
|
-
status:
|
|
4837
|
+
import_v423.z.object({
|
|
4838
|
+
type: import_v423.z.literal("computer_call"),
|
|
4839
|
+
id: import_v423.z.string(),
|
|
4840
|
+
status: import_v423.z.literal("completed")
|
|
4511
4841
|
}),
|
|
4512
|
-
|
|
4513
|
-
type:
|
|
4514
|
-
id:
|
|
4515
|
-
status:
|
|
4516
|
-
arguments:
|
|
4517
|
-
name:
|
|
4518
|
-
server_label:
|
|
4519
|
-
output:
|
|
4520
|
-
error:
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
type:
|
|
4524
|
-
code:
|
|
4525
|
-
message:
|
|
4842
|
+
import_v423.z.object({
|
|
4843
|
+
type: import_v423.z.literal("mcp_call"),
|
|
4844
|
+
id: import_v423.z.string(),
|
|
4845
|
+
status: import_v423.z.string(),
|
|
4846
|
+
arguments: import_v423.z.string(),
|
|
4847
|
+
name: import_v423.z.string(),
|
|
4848
|
+
server_label: import_v423.z.string(),
|
|
4849
|
+
output: import_v423.z.string().nullish(),
|
|
4850
|
+
error: import_v423.z.union([
|
|
4851
|
+
import_v423.z.string(),
|
|
4852
|
+
import_v423.z.object({
|
|
4853
|
+
type: import_v423.z.string().optional(),
|
|
4854
|
+
code: import_v423.z.union([import_v423.z.number(), import_v423.z.string()]).optional(),
|
|
4855
|
+
message: import_v423.z.string().optional()
|
|
4526
4856
|
}).loose()
|
|
4527
4857
|
]).nullish(),
|
|
4528
|
-
approval_request_id:
|
|
4858
|
+
approval_request_id: import_v423.z.string().nullish()
|
|
4529
4859
|
}),
|
|
4530
|
-
|
|
4531
|
-
type:
|
|
4532
|
-
id:
|
|
4533
|
-
server_label:
|
|
4534
|
-
tools:
|
|
4535
|
-
|
|
4536
|
-
name:
|
|
4537
|
-
description:
|
|
4538
|
-
input_schema:
|
|
4539
|
-
annotations:
|
|
4860
|
+
import_v423.z.object({
|
|
4861
|
+
type: import_v423.z.literal("mcp_list_tools"),
|
|
4862
|
+
id: import_v423.z.string(),
|
|
4863
|
+
server_label: import_v423.z.string(),
|
|
4864
|
+
tools: import_v423.z.array(
|
|
4865
|
+
import_v423.z.object({
|
|
4866
|
+
name: import_v423.z.string(),
|
|
4867
|
+
description: import_v423.z.string().optional(),
|
|
4868
|
+
input_schema: import_v423.z.any(),
|
|
4869
|
+
annotations: import_v423.z.record(import_v423.z.string(), import_v423.z.unknown()).optional()
|
|
4540
4870
|
})
|
|
4541
4871
|
),
|
|
4542
|
-
error:
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
type:
|
|
4546
|
-
code:
|
|
4547
|
-
message:
|
|
4872
|
+
error: import_v423.z.union([
|
|
4873
|
+
import_v423.z.string(),
|
|
4874
|
+
import_v423.z.object({
|
|
4875
|
+
type: import_v423.z.string().optional(),
|
|
4876
|
+
code: import_v423.z.union([import_v423.z.number(), import_v423.z.string()]).optional(),
|
|
4877
|
+
message: import_v423.z.string().optional()
|
|
4548
4878
|
}).loose()
|
|
4549
4879
|
]).optional()
|
|
4550
4880
|
}),
|
|
4551
|
-
|
|
4552
|
-
type:
|
|
4553
|
-
id:
|
|
4554
|
-
server_label:
|
|
4555
|
-
name:
|
|
4556
|
-
arguments:
|
|
4557
|
-
approval_request_id:
|
|
4881
|
+
import_v423.z.object({
|
|
4882
|
+
type: import_v423.z.literal("mcp_approval_request"),
|
|
4883
|
+
id: import_v423.z.string(),
|
|
4884
|
+
server_label: import_v423.z.string(),
|
|
4885
|
+
name: import_v423.z.string(),
|
|
4886
|
+
arguments: import_v423.z.string(),
|
|
4887
|
+
approval_request_id: import_v423.z.string().optional()
|
|
4558
4888
|
}),
|
|
4559
|
-
|
|
4560
|
-
type:
|
|
4561
|
-
id:
|
|
4562
|
-
call_id:
|
|
4563
|
-
status:
|
|
4564
|
-
operation:
|
|
4565
|
-
|
|
4566
|
-
type:
|
|
4567
|
-
path:
|
|
4568
|
-
diff:
|
|
4889
|
+
import_v423.z.object({
|
|
4890
|
+
type: import_v423.z.literal("apply_patch_call"),
|
|
4891
|
+
id: import_v423.z.string(),
|
|
4892
|
+
call_id: import_v423.z.string(),
|
|
4893
|
+
status: import_v423.z.enum(["in_progress", "completed"]),
|
|
4894
|
+
operation: import_v423.z.discriminatedUnion("type", [
|
|
4895
|
+
import_v423.z.object({
|
|
4896
|
+
type: import_v423.z.literal("create_file"),
|
|
4897
|
+
path: import_v423.z.string(),
|
|
4898
|
+
diff: import_v423.z.string()
|
|
4569
4899
|
}),
|
|
4570
|
-
|
|
4571
|
-
type:
|
|
4572
|
-
path:
|
|
4900
|
+
import_v423.z.object({
|
|
4901
|
+
type: import_v423.z.literal("delete_file"),
|
|
4902
|
+
path: import_v423.z.string()
|
|
4573
4903
|
}),
|
|
4574
|
-
|
|
4575
|
-
type:
|
|
4576
|
-
path:
|
|
4577
|
-
diff:
|
|
4904
|
+
import_v423.z.object({
|
|
4905
|
+
type: import_v423.z.literal("update_file"),
|
|
4906
|
+
path: import_v423.z.string(),
|
|
4907
|
+
diff: import_v423.z.string()
|
|
4578
4908
|
})
|
|
4579
4909
|
])
|
|
4580
4910
|
}),
|
|
4581
|
-
|
|
4582
|
-
type:
|
|
4583
|
-
id:
|
|
4584
|
-
call_id:
|
|
4585
|
-
status:
|
|
4586
|
-
action:
|
|
4587
|
-
commands:
|
|
4911
|
+
import_v423.z.object({
|
|
4912
|
+
type: import_v423.z.literal("shell_call"),
|
|
4913
|
+
id: import_v423.z.string(),
|
|
4914
|
+
call_id: import_v423.z.string(),
|
|
4915
|
+
status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4916
|
+
action: import_v423.z.object({
|
|
4917
|
+
commands: import_v423.z.array(import_v423.z.string())
|
|
4588
4918
|
})
|
|
4589
4919
|
}),
|
|
4590
|
-
|
|
4591
|
-
type:
|
|
4592
|
-
id:
|
|
4593
|
-
call_id:
|
|
4594
|
-
status:
|
|
4595
|
-
output:
|
|
4596
|
-
|
|
4597
|
-
stdout:
|
|
4598
|
-
stderr:
|
|
4599
|
-
outcome:
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
type:
|
|
4603
|
-
exit_code:
|
|
4920
|
+
import_v423.z.object({
|
|
4921
|
+
type: import_v423.z.literal("shell_call_output"),
|
|
4922
|
+
id: import_v423.z.string(),
|
|
4923
|
+
call_id: import_v423.z.string(),
|
|
4924
|
+
status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4925
|
+
output: import_v423.z.array(
|
|
4926
|
+
import_v423.z.object({
|
|
4927
|
+
stdout: import_v423.z.string(),
|
|
4928
|
+
stderr: import_v423.z.string(),
|
|
4929
|
+
outcome: import_v423.z.discriminatedUnion("type", [
|
|
4930
|
+
import_v423.z.object({ type: import_v423.z.literal("timeout") }),
|
|
4931
|
+
import_v423.z.object({
|
|
4932
|
+
type: import_v423.z.literal("exit"),
|
|
4933
|
+
exit_code: import_v423.z.number()
|
|
4604
4934
|
})
|
|
4605
4935
|
])
|
|
4606
4936
|
})
|
|
4607
4937
|
)
|
|
4608
4938
|
}),
|
|
4609
|
-
|
|
4610
|
-
type:
|
|
4611
|
-
id:
|
|
4612
|
-
execution:
|
|
4613
|
-
call_id:
|
|
4614
|
-
status:
|
|
4615
|
-
arguments:
|
|
4939
|
+
import_v423.z.object({
|
|
4940
|
+
type: import_v423.z.literal("tool_search_call"),
|
|
4941
|
+
id: import_v423.z.string(),
|
|
4942
|
+
execution: import_v423.z.enum(["server", "client"]),
|
|
4943
|
+
call_id: import_v423.z.string().nullable(),
|
|
4944
|
+
status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4945
|
+
arguments: import_v423.z.unknown()
|
|
4616
4946
|
}),
|
|
4617
|
-
|
|
4618
|
-
type:
|
|
4619
|
-
id:
|
|
4620
|
-
execution:
|
|
4621
|
-
call_id:
|
|
4622
|
-
status:
|
|
4623
|
-
tools:
|
|
4947
|
+
import_v423.z.object({
|
|
4948
|
+
type: import_v423.z.literal("tool_search_output"),
|
|
4949
|
+
id: import_v423.z.string(),
|
|
4950
|
+
execution: import_v423.z.enum(["server", "client"]),
|
|
4951
|
+
call_id: import_v423.z.string().nullable(),
|
|
4952
|
+
status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4953
|
+
tools: import_v423.z.array(import_v423.z.record(import_v423.z.string(), jsonValueSchema2.optional()))
|
|
4624
4954
|
})
|
|
4625
4955
|
])
|
|
4626
4956
|
}),
|
|
4627
|
-
|
|
4628
|
-
type:
|
|
4629
|
-
item_id:
|
|
4630
|
-
output_index:
|
|
4631
|
-
delta:
|
|
4957
|
+
import_v423.z.object({
|
|
4958
|
+
type: import_v423.z.literal("response.function_call_arguments.delta"),
|
|
4959
|
+
item_id: import_v423.z.string(),
|
|
4960
|
+
output_index: import_v423.z.number(),
|
|
4961
|
+
delta: import_v423.z.string()
|
|
4632
4962
|
}),
|
|
4633
|
-
|
|
4963
|
+
import_v423.z.object({
|
|
4634
4964
|
// `name` is documented as required but omitted from live API events:
|
|
4635
4965
|
// https://github.com/openai/openai-openapi/issues/545
|
|
4636
|
-
type:
|
|
4637
|
-
item_id:
|
|
4638
|
-
output_index:
|
|
4639
|
-
arguments:
|
|
4966
|
+
type: import_v423.z.literal("response.function_call_arguments.done"),
|
|
4967
|
+
item_id: import_v423.z.string(),
|
|
4968
|
+
output_index: import_v423.z.number(),
|
|
4969
|
+
arguments: import_v423.z.string()
|
|
4640
4970
|
}),
|
|
4641
|
-
|
|
4642
|
-
type:
|
|
4643
|
-
item_id:
|
|
4644
|
-
output_index:
|
|
4645
|
-
delta:
|
|
4971
|
+
import_v423.z.object({
|
|
4972
|
+
type: import_v423.z.literal("response.custom_tool_call_input.delta"),
|
|
4973
|
+
item_id: import_v423.z.string(),
|
|
4974
|
+
output_index: import_v423.z.number(),
|
|
4975
|
+
delta: import_v423.z.string()
|
|
4646
4976
|
}),
|
|
4647
|
-
|
|
4648
|
-
type:
|
|
4649
|
-
item_id:
|
|
4650
|
-
output_index:
|
|
4651
|
-
partial_image_b64:
|
|
4977
|
+
import_v423.z.object({
|
|
4978
|
+
type: import_v423.z.literal("response.image_generation_call.partial_image"),
|
|
4979
|
+
item_id: import_v423.z.string(),
|
|
4980
|
+
output_index: import_v423.z.number(),
|
|
4981
|
+
partial_image_b64: import_v423.z.string()
|
|
4652
4982
|
}),
|
|
4653
|
-
|
|
4654
|
-
type:
|
|
4655
|
-
item_id:
|
|
4656
|
-
output_index:
|
|
4657
|
-
delta:
|
|
4983
|
+
import_v423.z.object({
|
|
4984
|
+
type: import_v423.z.literal("response.code_interpreter_call_code.delta"),
|
|
4985
|
+
item_id: import_v423.z.string(),
|
|
4986
|
+
output_index: import_v423.z.number(),
|
|
4987
|
+
delta: import_v423.z.string()
|
|
4658
4988
|
}),
|
|
4659
|
-
|
|
4660
|
-
type:
|
|
4661
|
-
item_id:
|
|
4662
|
-
output_index:
|
|
4663
|
-
code:
|
|
4989
|
+
import_v423.z.object({
|
|
4990
|
+
type: import_v423.z.literal("response.code_interpreter_call_code.done"),
|
|
4991
|
+
item_id: import_v423.z.string(),
|
|
4992
|
+
output_index: import_v423.z.number(),
|
|
4993
|
+
code: import_v423.z.string()
|
|
4664
4994
|
}),
|
|
4665
|
-
|
|
4666
|
-
type:
|
|
4667
|
-
annotation:
|
|
4668
|
-
|
|
4669
|
-
type:
|
|
4670
|
-
start_index:
|
|
4671
|
-
end_index:
|
|
4672
|
-
url:
|
|
4673
|
-
title:
|
|
4995
|
+
import_v423.z.object({
|
|
4996
|
+
type: import_v423.z.literal("response.output_text.annotation.added"),
|
|
4997
|
+
annotation: import_v423.z.discriminatedUnion("type", [
|
|
4998
|
+
import_v423.z.object({
|
|
4999
|
+
type: import_v423.z.literal("url_citation"),
|
|
5000
|
+
start_index: import_v423.z.number(),
|
|
5001
|
+
end_index: import_v423.z.number(),
|
|
5002
|
+
url: import_v423.z.string(),
|
|
5003
|
+
title: import_v423.z.string()
|
|
4674
5004
|
}),
|
|
4675
|
-
|
|
4676
|
-
type:
|
|
4677
|
-
file_id:
|
|
4678
|
-
filename:
|
|
4679
|
-
index:
|
|
5005
|
+
import_v423.z.object({
|
|
5006
|
+
type: import_v423.z.literal("file_citation"),
|
|
5007
|
+
file_id: import_v423.z.string(),
|
|
5008
|
+
filename: import_v423.z.string(),
|
|
5009
|
+
index: import_v423.z.number()
|
|
4680
5010
|
}),
|
|
4681
|
-
|
|
4682
|
-
type:
|
|
4683
|
-
container_id:
|
|
4684
|
-
file_id:
|
|
4685
|
-
filename:
|
|
4686
|
-
start_index:
|
|
4687
|
-
end_index:
|
|
5011
|
+
import_v423.z.object({
|
|
5012
|
+
type: import_v423.z.literal("container_file_citation"),
|
|
5013
|
+
container_id: import_v423.z.string(),
|
|
5014
|
+
file_id: import_v423.z.string(),
|
|
5015
|
+
filename: import_v423.z.string(),
|
|
5016
|
+
start_index: import_v423.z.number(),
|
|
5017
|
+
end_index: import_v423.z.number()
|
|
4688
5018
|
}),
|
|
4689
|
-
|
|
4690
|
-
type:
|
|
4691
|
-
file_id:
|
|
4692
|
-
index:
|
|
5019
|
+
import_v423.z.object({
|
|
5020
|
+
type: import_v423.z.literal("file_path"),
|
|
5021
|
+
file_id: import_v423.z.string(),
|
|
5022
|
+
index: import_v423.z.number()
|
|
4693
5023
|
})
|
|
4694
5024
|
])
|
|
4695
5025
|
}),
|
|
4696
|
-
|
|
4697
|
-
type:
|
|
4698
|
-
item_id:
|
|
4699
|
-
summary_index:
|
|
4700
|
-
}),
|
|
4701
|
-
import_v422.z.object({
|
|
4702
|
-
type: import_v422.z.literal("response.reasoning_summary_text.delta"),
|
|
4703
|
-
item_id: import_v422.z.string(),
|
|
4704
|
-
summary_index: import_v422.z.number(),
|
|
4705
|
-
delta: import_v422.z.string()
|
|
4706
|
-
}),
|
|
4707
|
-
import_v422.z.object({
|
|
4708
|
-
type: import_v422.z.literal("response.reasoning_summary_part.done"),
|
|
4709
|
-
item_id: import_v422.z.string(),
|
|
4710
|
-
summary_index: import_v422.z.number()
|
|
5026
|
+
import_v423.z.object({
|
|
5027
|
+
type: import_v423.z.literal("response.reasoning_summary_part.added"),
|
|
5028
|
+
item_id: import_v423.z.string(),
|
|
5029
|
+
summary_index: import_v423.z.number()
|
|
4711
5030
|
}),
|
|
4712
|
-
|
|
4713
|
-
type:
|
|
4714
|
-
item_id:
|
|
4715
|
-
|
|
4716
|
-
delta:
|
|
4717
|
-
obfuscation: import_v422.z.string().nullish()
|
|
5031
|
+
import_v423.z.object({
|
|
5032
|
+
type: import_v423.z.literal("response.reasoning_summary_text.delta"),
|
|
5033
|
+
item_id: import_v423.z.string(),
|
|
5034
|
+
summary_index: import_v423.z.number(),
|
|
5035
|
+
delta: import_v423.z.string()
|
|
4718
5036
|
}),
|
|
4719
|
-
|
|
4720
|
-
type:
|
|
4721
|
-
item_id:
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
)
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
message:
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
import_v422.z.discriminatedUnion("type", [
|
|
4751
|
-
import_v422.z.object({
|
|
4752
|
-
type: import_v422.z.literal("message"),
|
|
4753
|
-
role: import_v422.z.literal("assistant"),
|
|
4754
|
-
id: import_v422.z.string(),
|
|
4755
|
-
phase: import_v422.z.enum(["commentary", "final_answer"]).nullish(),
|
|
4756
|
-
content: import_v422.z.array(
|
|
4757
|
-
import_v422.z.object({
|
|
4758
|
-
type: import_v422.z.literal("output_text"),
|
|
4759
|
-
text: import_v422.z.string(),
|
|
4760
|
-
logprobs: import_v422.z.array(
|
|
4761
|
-
import_v422.z.object({
|
|
4762
|
-
token: import_v422.z.string(),
|
|
4763
|
-
logprob: import_v422.z.number(),
|
|
4764
|
-
top_logprobs: import_v422.z.array(
|
|
4765
|
-
import_v422.z.object({
|
|
4766
|
-
token: import_v422.z.string(),
|
|
4767
|
-
logprob: import_v422.z.number()
|
|
4768
|
-
})
|
|
4769
|
-
)
|
|
4770
|
-
})
|
|
4771
|
-
).nullish(),
|
|
4772
|
-
annotations: import_v422.z.array(
|
|
4773
|
-
import_v422.z.discriminatedUnion("type", [
|
|
4774
|
-
import_v422.z.object({
|
|
4775
|
-
type: import_v422.z.literal("url_citation"),
|
|
4776
|
-
start_index: import_v422.z.number(),
|
|
4777
|
-
end_index: import_v422.z.number(),
|
|
4778
|
-
url: import_v422.z.string(),
|
|
4779
|
-
title: import_v422.z.string()
|
|
4780
|
-
}),
|
|
4781
|
-
import_v422.z.object({
|
|
4782
|
-
type: import_v422.z.literal("file_citation"),
|
|
4783
|
-
file_id: import_v422.z.string(),
|
|
4784
|
-
filename: import_v422.z.string(),
|
|
4785
|
-
index: import_v422.z.number()
|
|
4786
|
-
}),
|
|
4787
|
-
import_v422.z.object({
|
|
4788
|
-
type: import_v422.z.literal("container_file_citation"),
|
|
4789
|
-
container_id: import_v422.z.string(),
|
|
4790
|
-
file_id: import_v422.z.string(),
|
|
4791
|
-
filename: import_v422.z.string(),
|
|
4792
|
-
start_index: import_v422.z.number(),
|
|
4793
|
-
end_index: import_v422.z.number()
|
|
4794
|
-
}),
|
|
4795
|
-
import_v422.z.object({
|
|
4796
|
-
type: import_v422.z.literal("file_path"),
|
|
4797
|
-
file_id: import_v422.z.string(),
|
|
4798
|
-
index: import_v422.z.number()
|
|
4799
|
-
})
|
|
4800
|
-
])
|
|
4801
|
-
)
|
|
4802
|
-
})
|
|
4803
|
-
)
|
|
4804
|
-
}),
|
|
4805
|
-
import_v422.z.object({
|
|
4806
|
-
type: import_v422.z.literal("web_search_call"),
|
|
4807
|
-
id: import_v422.z.string(),
|
|
4808
|
-
status: import_v422.z.string(),
|
|
4809
|
-
action: import_v422.z.discriminatedUnion("type", [
|
|
4810
|
-
import_v422.z.object({
|
|
4811
|
-
type: import_v422.z.literal("search"),
|
|
4812
|
-
query: import_v422.z.string().nullish(),
|
|
4813
|
-
queries: import_v422.z.array(import_v422.z.string()).nullish(),
|
|
4814
|
-
sources: import_v422.z.array(
|
|
4815
|
-
import_v422.z.discriminatedUnion("type", [
|
|
4816
|
-
import_v422.z.object({ type: import_v422.z.literal("url"), url: import_v422.z.string() }),
|
|
4817
|
-
import_v422.z.object({
|
|
4818
|
-
type: import_v422.z.literal("api"),
|
|
4819
|
-
name: import_v422.z.string()
|
|
4820
|
-
})
|
|
4821
|
-
])
|
|
4822
|
-
).nullish()
|
|
4823
|
-
}),
|
|
4824
|
-
import_v422.z.object({
|
|
4825
|
-
type: import_v422.z.literal("open_page"),
|
|
4826
|
-
url: import_v422.z.string().nullish()
|
|
4827
|
-
}),
|
|
4828
|
-
import_v422.z.object({
|
|
4829
|
-
type: import_v422.z.literal("find_in_page"),
|
|
4830
|
-
url: import_v422.z.string().nullish(),
|
|
4831
|
-
pattern: import_v422.z.string().nullish()
|
|
4832
|
-
})
|
|
4833
|
-
]).nullish()
|
|
4834
|
-
}),
|
|
4835
|
-
import_v422.z.object({
|
|
4836
|
-
type: import_v422.z.literal("file_search_call"),
|
|
4837
|
-
id: import_v422.z.string(),
|
|
4838
|
-
queries: import_v422.z.array(import_v422.z.string()),
|
|
4839
|
-
results: import_v422.z.array(
|
|
4840
|
-
import_v422.z.object({
|
|
4841
|
-
attributes: import_v422.z.record(
|
|
4842
|
-
import_v422.z.string(),
|
|
4843
|
-
import_v422.z.union([import_v422.z.string(), import_v422.z.number(), import_v422.z.boolean()])
|
|
4844
|
-
),
|
|
4845
|
-
file_id: import_v422.z.string(),
|
|
4846
|
-
filename: import_v422.z.string(),
|
|
4847
|
-
score: import_v422.z.number(),
|
|
4848
|
-
text: import_v422.z.string()
|
|
4849
|
-
})
|
|
4850
|
-
).nullish()
|
|
4851
|
-
}),
|
|
4852
|
-
import_v422.z.object({
|
|
4853
|
-
type: import_v422.z.literal("code_interpreter_call"),
|
|
4854
|
-
id: import_v422.z.string(),
|
|
4855
|
-
code: import_v422.z.string().nullable(),
|
|
4856
|
-
container_id: import_v422.z.string(),
|
|
4857
|
-
outputs: import_v422.z.array(
|
|
4858
|
-
import_v422.z.discriminatedUnion("type", [
|
|
4859
|
-
import_v422.z.object({ type: import_v422.z.literal("logs"), logs: import_v422.z.string() }),
|
|
4860
|
-
import_v422.z.object({ type: import_v422.z.literal("image"), url: import_v422.z.string() })
|
|
4861
|
-
])
|
|
4862
|
-
).nullable()
|
|
4863
|
-
}),
|
|
4864
|
-
import_v422.z.object({
|
|
4865
|
-
type: import_v422.z.literal("image_generation_call"),
|
|
4866
|
-
id: import_v422.z.string(),
|
|
4867
|
-
result: import_v422.z.string()
|
|
4868
|
-
}),
|
|
4869
|
-
openaiResponsesLocalShellCallSchema,
|
|
4870
|
-
import_v422.z.object({
|
|
4871
|
-
type: import_v422.z.literal("function_call"),
|
|
4872
|
-
call_id: import_v422.z.string(),
|
|
4873
|
-
name: import_v422.z.string(),
|
|
4874
|
-
arguments: import_v422.z.string(),
|
|
4875
|
-
id: import_v422.z.string(),
|
|
4876
|
-
async: import_v422.z.boolean().nullish(),
|
|
4877
|
-
namespace: import_v422.z.string().nullish()
|
|
4878
|
-
}),
|
|
4879
|
-
import_v422.z.object({
|
|
4880
|
-
type: import_v422.z.literal("custom_tool_call"),
|
|
4881
|
-
call_id: import_v422.z.string(),
|
|
4882
|
-
name: import_v422.z.string(),
|
|
4883
|
-
input: import_v422.z.string(),
|
|
4884
|
-
id: import_v422.z.string(),
|
|
4885
|
-
async: import_v422.z.boolean().nullish()
|
|
4886
|
-
}),
|
|
4887
|
-
import_v422.z.object({
|
|
4888
|
-
type: import_v422.z.literal("computer_call"),
|
|
4889
|
-
id: import_v422.z.string(),
|
|
4890
|
-
status: import_v422.z.string().optional()
|
|
4891
|
-
}),
|
|
4892
|
-
import_v422.z.object({
|
|
4893
|
-
type: import_v422.z.literal("reasoning"),
|
|
4894
|
-
id: import_v422.z.string(),
|
|
4895
|
-
encrypted_content: import_v422.z.string().nullish(),
|
|
4896
|
-
summary: import_v422.z.array(
|
|
4897
|
-
import_v422.z.object({
|
|
4898
|
-
type: import_v422.z.literal("summary_text"),
|
|
4899
|
-
text: import_v422.z.string()
|
|
4900
|
-
})
|
|
4901
|
-
)
|
|
4902
|
-
}),
|
|
4903
|
-
import_v422.z.object({
|
|
4904
|
-
type: import_v422.z.literal("mcp_call"),
|
|
4905
|
-
id: import_v422.z.string(),
|
|
4906
|
-
status: import_v422.z.string(),
|
|
4907
|
-
arguments: import_v422.z.string(),
|
|
4908
|
-
name: import_v422.z.string(),
|
|
4909
|
-
server_label: import_v422.z.string(),
|
|
4910
|
-
output: import_v422.z.string().nullish(),
|
|
4911
|
-
error: import_v422.z.union([
|
|
4912
|
-
import_v422.z.string(),
|
|
4913
|
-
import_v422.z.object({
|
|
4914
|
-
type: import_v422.z.string().optional(),
|
|
4915
|
-
code: import_v422.z.union([import_v422.z.number(), import_v422.z.string()]).optional(),
|
|
4916
|
-
message: import_v422.z.string().optional()
|
|
4917
|
-
}).loose()
|
|
4918
|
-
]).nullish(),
|
|
4919
|
-
approval_request_id: import_v422.z.string().nullish()
|
|
4920
|
-
}),
|
|
4921
|
-
import_v422.z.object({
|
|
4922
|
-
type: import_v422.z.literal("mcp_list_tools"),
|
|
4923
|
-
id: import_v422.z.string(),
|
|
4924
|
-
server_label: import_v422.z.string(),
|
|
4925
|
-
tools: import_v422.z.array(
|
|
4926
|
-
import_v422.z.object({
|
|
4927
|
-
name: import_v422.z.string(),
|
|
4928
|
-
description: import_v422.z.string().optional(),
|
|
4929
|
-
input_schema: import_v422.z.any(),
|
|
4930
|
-
annotations: import_v422.z.record(import_v422.z.string(), import_v422.z.unknown()).optional()
|
|
4931
|
-
})
|
|
4932
|
-
),
|
|
4933
|
-
error: import_v422.z.union([
|
|
4934
|
-
import_v422.z.string(),
|
|
4935
|
-
import_v422.z.object({
|
|
4936
|
-
type: import_v422.z.string().optional(),
|
|
4937
|
-
code: import_v422.z.union([import_v422.z.number(), import_v422.z.string()]).optional(),
|
|
4938
|
-
message: import_v422.z.string().optional()
|
|
4939
|
-
}).loose()
|
|
4940
|
-
]).optional()
|
|
4941
|
-
}),
|
|
4942
|
-
import_v422.z.object({
|
|
4943
|
-
type: import_v422.z.literal("mcp_approval_request"),
|
|
4944
|
-
id: import_v422.z.string(),
|
|
4945
|
-
server_label: import_v422.z.string(),
|
|
4946
|
-
name: import_v422.z.string(),
|
|
4947
|
-
arguments: import_v422.z.string(),
|
|
4948
|
-
approval_request_id: import_v422.z.string().optional()
|
|
4949
|
-
}),
|
|
4950
|
-
import_v422.z.object({
|
|
4951
|
-
type: import_v422.z.literal("apply_patch_call"),
|
|
4952
|
-
id: import_v422.z.string(),
|
|
4953
|
-
call_id: import_v422.z.string(),
|
|
4954
|
-
status: import_v422.z.enum(["in_progress", "completed"]),
|
|
4955
|
-
operation: import_v422.z.discriminatedUnion("type", [
|
|
4956
|
-
import_v422.z.object({
|
|
4957
|
-
type: import_v422.z.literal("create_file"),
|
|
4958
|
-
path: import_v422.z.string(),
|
|
4959
|
-
diff: import_v422.z.string()
|
|
4960
|
-
}),
|
|
4961
|
-
import_v422.z.object({
|
|
4962
|
-
type: import_v422.z.literal("delete_file"),
|
|
4963
|
-
path: import_v422.z.string()
|
|
4964
|
-
}),
|
|
4965
|
-
import_v422.z.object({
|
|
4966
|
-
type: import_v422.z.literal("update_file"),
|
|
4967
|
-
path: import_v422.z.string(),
|
|
4968
|
-
diff: import_v422.z.string()
|
|
4969
|
-
})
|
|
4970
|
-
])
|
|
4971
|
-
}),
|
|
4972
|
-
import_v422.z.object({
|
|
4973
|
-
type: import_v422.z.literal("shell_call"),
|
|
4974
|
-
id: import_v422.z.string(),
|
|
4975
|
-
call_id: import_v422.z.string(),
|
|
4976
|
-
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4977
|
-
action: import_v422.z.object({
|
|
4978
|
-
commands: import_v422.z.array(import_v422.z.string())
|
|
4979
|
-
})
|
|
4980
|
-
}),
|
|
4981
|
-
import_v422.z.object({
|
|
4982
|
-
type: import_v422.z.literal("shell_call_output"),
|
|
4983
|
-
id: import_v422.z.string(),
|
|
4984
|
-
call_id: import_v422.z.string(),
|
|
4985
|
-
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4986
|
-
output: import_v422.z.array(
|
|
4987
|
-
import_v422.z.object({
|
|
4988
|
-
stdout: import_v422.z.string(),
|
|
4989
|
-
stderr: import_v422.z.string(),
|
|
4990
|
-
outcome: import_v422.z.discriminatedUnion("type", [
|
|
4991
|
-
import_v422.z.object({ type: import_v422.z.literal("timeout") }),
|
|
4992
|
-
import_v422.z.object({
|
|
4993
|
-
type: import_v422.z.literal("exit"),
|
|
4994
|
-
exit_code: import_v422.z.number()
|
|
4995
|
-
})
|
|
4996
|
-
])
|
|
4997
|
-
})
|
|
4998
|
-
)
|
|
4999
|
-
}),
|
|
5000
|
-
import_v422.z.object({
|
|
5001
|
-
type: import_v422.z.literal("tool_search_call"),
|
|
5002
|
-
id: import_v422.z.string(),
|
|
5003
|
-
execution: import_v422.z.enum(["server", "client"]),
|
|
5004
|
-
call_id: import_v422.z.string().nullable(),
|
|
5005
|
-
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5006
|
-
arguments: import_v422.z.unknown()
|
|
5007
|
-
}),
|
|
5008
|
-
import_v422.z.object({
|
|
5009
|
-
type: import_v422.z.literal("tool_search_output"),
|
|
5010
|
-
id: import_v422.z.string(),
|
|
5011
|
-
execution: import_v422.z.enum(["server", "client"]),
|
|
5012
|
-
call_id: import_v422.z.string().nullable(),
|
|
5013
|
-
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5014
|
-
tools: import_v422.z.array(import_v422.z.record(import_v422.z.string(), jsonValueSchema2.optional()))
|
|
5015
|
-
})
|
|
5016
|
-
])
|
|
5017
|
-
).optional(),
|
|
5018
|
-
service_tier: import_v422.z.string().nullish(),
|
|
5019
|
-
reasoning: import_v422.z.object({
|
|
5020
|
-
context: import_v422.z.string().nullish()
|
|
5021
|
-
}).nullish(),
|
|
5022
|
-
incomplete_details: import_v422.z.object({ reason: import_v422.z.string() }).nullish(),
|
|
5023
|
-
usage: openaiResponsesUsageSchema.nullish()
|
|
5024
|
-
})
|
|
5025
|
-
)
|
|
5026
|
-
);
|
|
5027
|
-
|
|
5028
|
-
// src/responses/openai-responses-options.ts
|
|
5029
|
-
var import_provider_utils29 = require("@ai-sdk/provider-utils");
|
|
5030
|
-
var import_v423 = require("zod/v4");
|
|
5031
|
-
var TOP_LOGPROBS_MAX = 20;
|
|
5032
|
-
var openaiResponsesReasoningModelIds = [
|
|
5033
|
-
"o1",
|
|
5034
|
-
"o1-2024-12-17",
|
|
5035
|
-
"o3",
|
|
5036
|
-
"o3-2025-04-16",
|
|
5037
|
-
"o3-mini",
|
|
5038
|
-
"o3-mini-2025-01-31",
|
|
5039
|
-
"o4-mini",
|
|
5040
|
-
"o4-mini-2025-04-16",
|
|
5041
|
-
"gpt-5",
|
|
5042
|
-
"gpt-5-2025-08-07",
|
|
5043
|
-
"gpt-5-codex",
|
|
5044
|
-
"gpt-5-mini",
|
|
5045
|
-
"gpt-5-mini-2025-08-07",
|
|
5046
|
-
"gpt-5-nano",
|
|
5047
|
-
"gpt-5-nano-2025-08-07",
|
|
5048
|
-
"gpt-5-pro",
|
|
5049
|
-
"gpt-5-pro-2025-10-06",
|
|
5050
|
-
"gpt-5.1",
|
|
5051
|
-
"gpt-5.1-chat-latest",
|
|
5052
|
-
"gpt-5.1-codex-mini",
|
|
5053
|
-
"gpt-5.1-codex",
|
|
5054
|
-
"gpt-5.1-codex-max",
|
|
5055
|
-
"gpt-5.2",
|
|
5056
|
-
"gpt-5.2-chat-latest",
|
|
5057
|
-
"gpt-5.2-pro",
|
|
5058
|
-
"gpt-5.2-codex",
|
|
5059
|
-
"gpt-5.3-chat-latest",
|
|
5060
|
-
"gpt-5.3-codex",
|
|
5061
|
-
"gpt-5.4",
|
|
5062
|
-
"gpt-5.4-2026-03-05",
|
|
5063
|
-
"gpt-5.4-mini",
|
|
5064
|
-
"gpt-5.4-mini-2026-03-17",
|
|
5065
|
-
"gpt-5.4-nano",
|
|
5066
|
-
"gpt-5.4-nano-2026-03-17",
|
|
5067
|
-
"gpt-5.4-pro",
|
|
5068
|
-
"gpt-5.4-pro-2026-03-05",
|
|
5069
|
-
"gpt-5.5",
|
|
5070
|
-
"gpt-5.5-2026-04-23",
|
|
5071
|
-
"gpt-5.6",
|
|
5072
|
-
"gpt-5.6-luna",
|
|
5073
|
-
"gpt-5.6-sol",
|
|
5074
|
-
"gpt-5.6-terra",
|
|
5075
|
-
"gpt-6-astra",
|
|
5076
|
-
"gpt-6-luna",
|
|
5077
|
-
"gpt-6-sol"
|
|
5078
|
-
];
|
|
5079
|
-
var openaiResponsesModelIds = [
|
|
5080
|
-
"gpt-4.1",
|
|
5081
|
-
"gpt-4.1-2025-04-14",
|
|
5082
|
-
"gpt-4.1-mini",
|
|
5083
|
-
"gpt-4.1-mini-2025-04-14",
|
|
5084
|
-
"gpt-4.1-nano",
|
|
5085
|
-
"gpt-4.1-nano-2025-04-14",
|
|
5086
|
-
"gpt-4o",
|
|
5087
|
-
"gpt-4o-2024-05-13",
|
|
5088
|
-
"gpt-4o-2024-08-06",
|
|
5089
|
-
"gpt-4o-2024-11-20",
|
|
5090
|
-
"gpt-4o-audio-preview",
|
|
5091
|
-
"gpt-4o-audio-preview-2024-12-17",
|
|
5092
|
-
"gpt-4o-search-preview",
|
|
5093
|
-
"gpt-4o-search-preview-2025-03-11",
|
|
5094
|
-
"gpt-4o-mini-search-preview",
|
|
5095
|
-
"gpt-4o-mini-search-preview-2025-03-11",
|
|
5096
|
-
"gpt-4o-mini",
|
|
5097
|
-
"gpt-4o-mini-2024-07-18",
|
|
5098
|
-
"gpt-3.5-turbo-0125",
|
|
5099
|
-
"gpt-3.5-turbo",
|
|
5100
|
-
"gpt-3.5-turbo-1106",
|
|
5101
|
-
"gpt-5-chat-latest",
|
|
5102
|
-
...openaiResponsesReasoningModelIds
|
|
5103
|
-
];
|
|
5104
|
-
var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils29.lazySchema)(
|
|
5037
|
+
import_v423.z.object({
|
|
5038
|
+
type: import_v423.z.literal("response.reasoning_summary_part.done"),
|
|
5039
|
+
item_id: import_v423.z.string(),
|
|
5040
|
+
summary_index: import_v423.z.number()
|
|
5041
|
+
}),
|
|
5042
|
+
import_v423.z.object({
|
|
5043
|
+
type: import_v423.z.literal("response.apply_patch_call_operation_diff.delta"),
|
|
5044
|
+
item_id: import_v423.z.string(),
|
|
5045
|
+
output_index: import_v423.z.number(),
|
|
5046
|
+
delta: import_v423.z.string(),
|
|
5047
|
+
obfuscation: import_v423.z.string().nullish()
|
|
5048
|
+
}),
|
|
5049
|
+
import_v423.z.object({
|
|
5050
|
+
type: import_v423.z.literal("response.apply_patch_call_operation_diff.done"),
|
|
5051
|
+
item_id: import_v423.z.string(),
|
|
5052
|
+
output_index: import_v423.z.number(),
|
|
5053
|
+
diff: import_v423.z.string()
|
|
5054
|
+
}),
|
|
5055
|
+
openaiResponsesNestedErrorChunkSchema,
|
|
5056
|
+
openaiResponsesErrorChunkSchema,
|
|
5057
|
+
import_v423.z.object({ type: import_v423.z.string() }).loose().refine((value) => !isModeledOpenAIResponsesChunk(value), {
|
|
5058
|
+
message: "Known response chunk failed schema validation"
|
|
5059
|
+
}).transform((value) => ({
|
|
5060
|
+
type: "unknown_chunk",
|
|
5061
|
+
message: value.type
|
|
5062
|
+
}))
|
|
5063
|
+
// fallback for unknown chunks
|
|
5064
|
+
])
|
|
5065
|
+
)
|
|
5066
|
+
);
|
|
5067
|
+
var openaiResponsesResponseSchema = (0, import_provider_utils29.lazySchema)(
|
|
5105
5068
|
() => (0, import_provider_utils29.zodSchema)(
|
|
5106
5069
|
import_v423.z.object({
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5070
|
+
id: import_v423.z.string().optional(),
|
|
5071
|
+
created_at: import_v423.z.number().optional(),
|
|
5072
|
+
error: import_v423.z.object({
|
|
5073
|
+
message: import_v423.z.string(),
|
|
5074
|
+
type: import_v423.z.string(),
|
|
5075
|
+
param: import_v423.z.string().nullish(),
|
|
5076
|
+
code: import_v423.z.string()
|
|
5077
|
+
}).nullish(),
|
|
5078
|
+
model: import_v423.z.string().optional(),
|
|
5079
|
+
output: import_v423.z.array(
|
|
5080
|
+
import_v423.z.discriminatedUnion("type", [
|
|
5081
|
+
import_v423.z.object({
|
|
5082
|
+
type: import_v423.z.literal("message"),
|
|
5083
|
+
role: import_v423.z.literal("assistant"),
|
|
5084
|
+
id: import_v423.z.string(),
|
|
5085
|
+
phase: import_v423.z.enum(["commentary", "final_answer"]).nullish(),
|
|
5086
|
+
content: import_v423.z.array(
|
|
5087
|
+
import_v423.z.object({
|
|
5088
|
+
type: import_v423.z.literal("output_text"),
|
|
5089
|
+
text: import_v423.z.string(),
|
|
5090
|
+
logprobs: import_v423.z.array(
|
|
5091
|
+
import_v423.z.object({
|
|
5092
|
+
token: import_v423.z.string(),
|
|
5093
|
+
logprob: import_v423.z.number(),
|
|
5094
|
+
top_logprobs: import_v423.z.array(
|
|
5095
|
+
import_v423.z.object({
|
|
5096
|
+
token: import_v423.z.string(),
|
|
5097
|
+
logprob: import_v423.z.number()
|
|
5098
|
+
})
|
|
5099
|
+
)
|
|
5100
|
+
})
|
|
5101
|
+
).nullish(),
|
|
5102
|
+
annotations: import_v423.z.array(
|
|
5103
|
+
import_v423.z.discriminatedUnion("type", [
|
|
5104
|
+
import_v423.z.object({
|
|
5105
|
+
type: import_v423.z.literal("url_citation"),
|
|
5106
|
+
start_index: import_v423.z.number(),
|
|
5107
|
+
end_index: import_v423.z.number(),
|
|
5108
|
+
url: import_v423.z.string(),
|
|
5109
|
+
title: import_v423.z.string()
|
|
5110
|
+
}),
|
|
5111
|
+
import_v423.z.object({
|
|
5112
|
+
type: import_v423.z.literal("file_citation"),
|
|
5113
|
+
file_id: import_v423.z.string(),
|
|
5114
|
+
filename: import_v423.z.string(),
|
|
5115
|
+
index: import_v423.z.number()
|
|
5116
|
+
}),
|
|
5117
|
+
import_v423.z.object({
|
|
5118
|
+
type: import_v423.z.literal("container_file_citation"),
|
|
5119
|
+
container_id: import_v423.z.string(),
|
|
5120
|
+
file_id: import_v423.z.string(),
|
|
5121
|
+
filename: import_v423.z.string(),
|
|
5122
|
+
start_index: import_v423.z.number(),
|
|
5123
|
+
end_index: import_v423.z.number()
|
|
5124
|
+
}),
|
|
5125
|
+
import_v423.z.object({
|
|
5126
|
+
type: import_v423.z.literal("file_path"),
|
|
5127
|
+
file_id: import_v423.z.string(),
|
|
5128
|
+
index: import_v423.z.number()
|
|
5129
|
+
})
|
|
5130
|
+
])
|
|
5131
|
+
)
|
|
5132
|
+
})
|
|
5133
|
+
)
|
|
5134
|
+
}),
|
|
5135
|
+
import_v423.z.object({
|
|
5136
|
+
type: import_v423.z.literal("web_search_call"),
|
|
5137
|
+
id: import_v423.z.string(),
|
|
5138
|
+
status: import_v423.z.string(),
|
|
5139
|
+
action: import_v423.z.discriminatedUnion("type", [
|
|
5140
|
+
import_v423.z.object({
|
|
5141
|
+
type: import_v423.z.literal("search"),
|
|
5142
|
+
query: import_v423.z.string().nullish(),
|
|
5143
|
+
queries: import_v423.z.array(import_v423.z.string()).nullish(),
|
|
5144
|
+
sources: import_v423.z.array(
|
|
5145
|
+
import_v423.z.discriminatedUnion("type", [
|
|
5146
|
+
import_v423.z.object({ type: import_v423.z.literal("url"), url: import_v423.z.string() }),
|
|
5147
|
+
import_v423.z.object({
|
|
5148
|
+
type: import_v423.z.literal("api"),
|
|
5149
|
+
name: import_v423.z.string()
|
|
5150
|
+
})
|
|
5151
|
+
])
|
|
5152
|
+
).nullish()
|
|
5153
|
+
}),
|
|
5154
|
+
import_v423.z.object({
|
|
5155
|
+
type: import_v423.z.literal("open_page"),
|
|
5156
|
+
url: import_v423.z.string().nullish()
|
|
5157
|
+
}),
|
|
5158
|
+
import_v423.z.object({
|
|
5159
|
+
type: import_v423.z.literal("find_in_page"),
|
|
5160
|
+
url: import_v423.z.string().nullish(),
|
|
5161
|
+
pattern: import_v423.z.string().nullish()
|
|
5162
|
+
})
|
|
5163
|
+
]).nullish()
|
|
5164
|
+
}),
|
|
5165
|
+
import_v423.z.object({
|
|
5166
|
+
type: import_v423.z.literal("file_search_call"),
|
|
5167
|
+
id: import_v423.z.string(),
|
|
5168
|
+
queries: import_v423.z.array(import_v423.z.string()),
|
|
5169
|
+
results: import_v423.z.array(
|
|
5170
|
+
import_v423.z.object({
|
|
5171
|
+
attributes: import_v423.z.record(
|
|
5172
|
+
import_v423.z.string(),
|
|
5173
|
+
import_v423.z.union([import_v423.z.string(), import_v423.z.number(), import_v423.z.boolean()])
|
|
5174
|
+
),
|
|
5175
|
+
file_id: import_v423.z.string(),
|
|
5176
|
+
filename: import_v423.z.string(),
|
|
5177
|
+
score: import_v423.z.number(),
|
|
5178
|
+
text: import_v423.z.string()
|
|
5179
|
+
})
|
|
5180
|
+
).nullish()
|
|
5181
|
+
}),
|
|
5182
|
+
import_v423.z.object({
|
|
5183
|
+
type: import_v423.z.literal("code_interpreter_call"),
|
|
5184
|
+
id: import_v423.z.string(),
|
|
5185
|
+
code: import_v423.z.string().nullable(),
|
|
5186
|
+
container_id: import_v423.z.string(),
|
|
5187
|
+
outputs: import_v423.z.array(
|
|
5188
|
+
import_v423.z.discriminatedUnion("type", [
|
|
5189
|
+
import_v423.z.object({ type: import_v423.z.literal("logs"), logs: import_v423.z.string() }),
|
|
5190
|
+
import_v423.z.object({ type: import_v423.z.literal("image"), url: import_v423.z.string() })
|
|
5191
|
+
])
|
|
5192
|
+
).nullable()
|
|
5193
|
+
}),
|
|
5194
|
+
import_v423.z.object({
|
|
5195
|
+
type: import_v423.z.literal("image_generation_call"),
|
|
5196
|
+
id: import_v423.z.string(),
|
|
5197
|
+
result: import_v423.z.string()
|
|
5198
|
+
}),
|
|
5199
|
+
openaiResponsesLocalShellCallSchema,
|
|
5200
|
+
import_v423.z.object({
|
|
5201
|
+
type: import_v423.z.literal("function_call"),
|
|
5202
|
+
call_id: import_v423.z.string(),
|
|
5203
|
+
name: import_v423.z.string(),
|
|
5204
|
+
arguments: import_v423.z.string(),
|
|
5205
|
+
id: import_v423.z.string(),
|
|
5206
|
+
async: import_v423.z.boolean().nullish(),
|
|
5207
|
+
namespace: import_v423.z.string().nullish()
|
|
5208
|
+
}),
|
|
5209
|
+
import_v423.z.object({
|
|
5210
|
+
type: import_v423.z.literal("custom_tool_call"),
|
|
5211
|
+
call_id: import_v423.z.string(),
|
|
5212
|
+
name: import_v423.z.string(),
|
|
5213
|
+
input: import_v423.z.string(),
|
|
5214
|
+
id: import_v423.z.string(),
|
|
5215
|
+
async: import_v423.z.boolean().nullish()
|
|
5216
|
+
}),
|
|
5217
|
+
import_v423.z.object({
|
|
5218
|
+
type: import_v423.z.literal("computer_call"),
|
|
5219
|
+
id: import_v423.z.string(),
|
|
5220
|
+
status: import_v423.z.string().optional()
|
|
5221
|
+
}),
|
|
5222
|
+
import_v423.z.object({
|
|
5223
|
+
type: import_v423.z.literal("reasoning"),
|
|
5224
|
+
id: import_v423.z.string(),
|
|
5225
|
+
encrypted_content: import_v423.z.string().nullish(),
|
|
5226
|
+
summary: import_v423.z.array(
|
|
5227
|
+
import_v423.z.object({
|
|
5228
|
+
type: import_v423.z.literal("summary_text"),
|
|
5229
|
+
text: import_v423.z.string()
|
|
5230
|
+
})
|
|
5231
|
+
)
|
|
5232
|
+
}),
|
|
5233
|
+
import_v423.z.object({
|
|
5234
|
+
type: import_v423.z.literal("mcp_call"),
|
|
5235
|
+
id: import_v423.z.string(),
|
|
5236
|
+
status: import_v423.z.string(),
|
|
5237
|
+
arguments: import_v423.z.string(),
|
|
5238
|
+
name: import_v423.z.string(),
|
|
5239
|
+
server_label: import_v423.z.string(),
|
|
5240
|
+
output: import_v423.z.string().nullish(),
|
|
5241
|
+
error: import_v423.z.union([
|
|
5242
|
+
import_v423.z.string(),
|
|
5243
|
+
import_v423.z.object({
|
|
5244
|
+
type: import_v423.z.string().optional(),
|
|
5245
|
+
code: import_v423.z.union([import_v423.z.number(), import_v423.z.string()]).optional(),
|
|
5246
|
+
message: import_v423.z.string().optional()
|
|
5247
|
+
}).loose()
|
|
5248
|
+
]).nullish(),
|
|
5249
|
+
approval_request_id: import_v423.z.string().nullish()
|
|
5250
|
+
}),
|
|
5251
|
+
import_v423.z.object({
|
|
5252
|
+
type: import_v423.z.literal("mcp_list_tools"),
|
|
5253
|
+
id: import_v423.z.string(),
|
|
5254
|
+
server_label: import_v423.z.string(),
|
|
5255
|
+
tools: import_v423.z.array(
|
|
5256
|
+
import_v423.z.object({
|
|
5257
|
+
name: import_v423.z.string(),
|
|
5258
|
+
description: import_v423.z.string().optional(),
|
|
5259
|
+
input_schema: import_v423.z.any(),
|
|
5260
|
+
annotations: import_v423.z.record(import_v423.z.string(), import_v423.z.unknown()).optional()
|
|
5261
|
+
})
|
|
5262
|
+
),
|
|
5263
|
+
error: import_v423.z.union([
|
|
5264
|
+
import_v423.z.string(),
|
|
5265
|
+
import_v423.z.object({
|
|
5266
|
+
type: import_v423.z.string().optional(),
|
|
5267
|
+
code: import_v423.z.union([import_v423.z.number(), import_v423.z.string()]).optional(),
|
|
5268
|
+
message: import_v423.z.string().optional()
|
|
5269
|
+
}).loose()
|
|
5270
|
+
]).optional()
|
|
5271
|
+
}),
|
|
5272
|
+
import_v423.z.object({
|
|
5273
|
+
type: import_v423.z.literal("mcp_approval_request"),
|
|
5274
|
+
id: import_v423.z.string(),
|
|
5275
|
+
server_label: import_v423.z.string(),
|
|
5276
|
+
name: import_v423.z.string(),
|
|
5277
|
+
arguments: import_v423.z.string(),
|
|
5278
|
+
approval_request_id: import_v423.z.string().optional()
|
|
5279
|
+
}),
|
|
5280
|
+
import_v423.z.object({
|
|
5281
|
+
type: import_v423.z.literal("apply_patch_call"),
|
|
5282
|
+
id: import_v423.z.string(),
|
|
5283
|
+
call_id: import_v423.z.string(),
|
|
5284
|
+
status: import_v423.z.enum(["in_progress", "completed"]),
|
|
5285
|
+
operation: import_v423.z.discriminatedUnion("type", [
|
|
5286
|
+
import_v423.z.object({
|
|
5287
|
+
type: import_v423.z.literal("create_file"),
|
|
5288
|
+
path: import_v423.z.string(),
|
|
5289
|
+
diff: import_v423.z.string()
|
|
5290
|
+
}),
|
|
5291
|
+
import_v423.z.object({
|
|
5292
|
+
type: import_v423.z.literal("delete_file"),
|
|
5293
|
+
path: import_v423.z.string()
|
|
5294
|
+
}),
|
|
5295
|
+
import_v423.z.object({
|
|
5296
|
+
type: import_v423.z.literal("update_file"),
|
|
5297
|
+
path: import_v423.z.string(),
|
|
5298
|
+
diff: import_v423.z.string()
|
|
5299
|
+
})
|
|
5300
|
+
])
|
|
5301
|
+
}),
|
|
5302
|
+
import_v423.z.object({
|
|
5303
|
+
type: import_v423.z.literal("shell_call"),
|
|
5304
|
+
id: import_v423.z.string(),
|
|
5305
|
+
call_id: import_v423.z.string(),
|
|
5306
|
+
status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5307
|
+
action: import_v423.z.object({
|
|
5308
|
+
commands: import_v423.z.array(import_v423.z.string())
|
|
5309
|
+
})
|
|
5310
|
+
}),
|
|
5311
|
+
import_v423.z.object({
|
|
5312
|
+
type: import_v423.z.literal("shell_call_output"),
|
|
5313
|
+
id: import_v423.z.string(),
|
|
5314
|
+
call_id: import_v423.z.string(),
|
|
5315
|
+
status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5316
|
+
output: import_v423.z.array(
|
|
5317
|
+
import_v423.z.object({
|
|
5318
|
+
stdout: import_v423.z.string(),
|
|
5319
|
+
stderr: import_v423.z.string(),
|
|
5320
|
+
outcome: import_v423.z.discriminatedUnion("type", [
|
|
5321
|
+
import_v423.z.object({ type: import_v423.z.literal("timeout") }),
|
|
5322
|
+
import_v423.z.object({
|
|
5323
|
+
type: import_v423.z.literal("exit"),
|
|
5324
|
+
exit_code: import_v423.z.number()
|
|
5325
|
+
})
|
|
5326
|
+
])
|
|
5327
|
+
})
|
|
5328
|
+
)
|
|
5329
|
+
}),
|
|
5330
|
+
import_v423.z.object({
|
|
5331
|
+
type: import_v423.z.literal("tool_search_call"),
|
|
5332
|
+
id: import_v423.z.string(),
|
|
5333
|
+
execution: import_v423.z.enum(["server", "client"]),
|
|
5334
|
+
call_id: import_v423.z.string().nullable(),
|
|
5335
|
+
status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5336
|
+
arguments: import_v423.z.unknown()
|
|
5337
|
+
}),
|
|
5338
|
+
import_v423.z.object({
|
|
5339
|
+
type: import_v423.z.literal("tool_search_output"),
|
|
5340
|
+
id: import_v423.z.string(),
|
|
5341
|
+
execution: import_v423.z.enum(["server", "client"]),
|
|
5342
|
+
call_id: import_v423.z.string().nullable(),
|
|
5343
|
+
status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5344
|
+
tools: import_v423.z.array(import_v423.z.record(import_v423.z.string(), jsonValueSchema2.optional()))
|
|
5345
|
+
})
|
|
5126
5346
|
])
|
|
5127
|
-
).
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
/**
|
|
5135
|
-
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
5136
|
-
* the response size and can slow down response times. However, it can
|
|
5137
|
-
* be useful to better understand how the model is behaving.
|
|
5138
|
-
*
|
|
5139
|
-
* Setting to true will return the log probabilities of the tokens that
|
|
5140
|
-
* were generated.
|
|
5141
|
-
*
|
|
5142
|
-
* Setting to a number will return the log probabilities of the top n
|
|
5143
|
-
* tokens that were generated.
|
|
5144
|
-
*
|
|
5145
|
-
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
5146
|
-
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
5147
|
-
*/
|
|
5148
|
-
logprobs: import_v423.z.union([import_v423.z.boolean(), import_v423.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
5149
|
-
/**
|
|
5150
|
-
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
5151
|
-
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
5152
|
-
* Any further attempts to call a tool by the model will be ignored.
|
|
5153
|
-
*/
|
|
5154
|
-
maxToolCalls: import_v423.z.number().nullish(),
|
|
5155
|
-
/**
|
|
5156
|
-
* Additional metadata to store with the generation.
|
|
5157
|
-
*/
|
|
5158
|
-
metadata: import_v423.z.any().nullish(),
|
|
5159
|
-
/**
|
|
5160
|
-
* Whether to use parallel tool calls. Defaults to `true`.
|
|
5161
|
-
*/
|
|
5162
|
-
parallelToolCalls: import_v423.z.boolean().nullish(),
|
|
5163
|
-
/**
|
|
5164
|
-
* The ID of the previous response. You can use it to continue a conversation.
|
|
5165
|
-
* Defaults to `undefined`.
|
|
5166
|
-
*/
|
|
5167
|
-
previousResponseId: import_v423.z.string().nullish(),
|
|
5168
|
-
/**
|
|
5169
|
-
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
5170
|
-
*/
|
|
5171
|
-
promptCacheKey: import_v423.z.string().nullish(),
|
|
5172
|
-
/**
|
|
5173
|
-
* Prompt cache behavior for GPT-5.6 and later models.
|
|
5174
|
-
* `mode` controls whether OpenAI also places an implicit breakpoint.
|
|
5175
|
-
* `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
|
|
5176
|
-
*/
|
|
5177
|
-
promptCacheOptions: import_v423.z.object({
|
|
5178
|
-
mode: import_v423.z.enum(["implicit", "explicit"]).optional(),
|
|
5179
|
-
ttl: import_v423.z.literal("30m").optional()
|
|
5180
|
-
}).optional(),
|
|
5181
|
-
/**
|
|
5182
|
-
* The retention policy for the prompt cache.
|
|
5183
|
-
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
5184
|
-
* - '24h': Extended prompt caching that keeps cached prefixes active for up to 24 hours.
|
|
5185
|
-
* Available for models before GPT-5.6 that support extended caching.
|
|
5186
|
-
*
|
|
5187
|
-
* @deprecated For GPT-5.6 and later models, use `promptCacheOptions.ttl`.
|
|
5188
|
-
*
|
|
5189
|
-
* @default 'in_memory'
|
|
5190
|
-
*/
|
|
5191
|
-
promptCacheRetention: import_v423.z.enum(["in_memory", "24h"]).nullish(),
|
|
5192
|
-
/**
|
|
5193
|
-
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
5194
|
-
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
5195
|
-
* GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
5196
|
-
* GPT-6 and later models support 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
5197
|
-
* Supported values vary by model.
|
|
5198
|
-
*/
|
|
5199
|
-
reasoningEffort: import_v423.z.string().nullish(),
|
|
5200
|
-
/**
|
|
5201
|
-
* Updates the reasoning effort for GPT-6 and later models starting with this response
|
|
5202
|
-
* without changing the request-level reasoning effort. This preserves the
|
|
5203
|
-
* request prefix for prompt caching.
|
|
5204
|
-
*
|
|
5205
|
-
* Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be
|
|
5206
|
-
* combined with automatic truncation.
|
|
5207
|
-
*/
|
|
5208
|
-
reasoningEffortUpdate: import_v423.z.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
5209
|
-
/**
|
|
5210
|
-
* Controls how much model work GPT-5.6 performs before returning a final answer.
|
|
5211
|
-
* `standard` is the default. `pro` increases quality, latency, and token usage.
|
|
5212
|
-
*/
|
|
5213
|
-
reasoningMode: import_v423.z.enum(["standard", "pro"]).optional(),
|
|
5214
|
-
/**
|
|
5215
|
-
* Controls which available reasoning items GPT-5.6 can use.
|
|
5216
|
-
* `auto` uses the model default, `current_turn` excludes reasoning from earlier
|
|
5217
|
-
* turns, and `all_turns` makes compatible earlier reasoning available.
|
|
5218
|
-
*/
|
|
5219
|
-
reasoningContext: import_v423.z.enum(["auto", "current_turn", "all_turns"]).optional(),
|
|
5220
|
-
/**
|
|
5221
|
-
* Controls reasoning summary output from the model.
|
|
5222
|
-
* Set to "auto" to automatically receive the richest level available,
|
|
5223
|
-
* or "detailed" for comprehensive summaries.
|
|
5224
|
-
*/
|
|
5225
|
-
reasoningSummary: import_v423.z.string().nullish(),
|
|
5226
|
-
/**
|
|
5227
|
-
* The identifier for safety monitoring and tracking.
|
|
5228
|
-
*/
|
|
5229
|
-
safetyIdentifier: import_v423.z.string().nullish(),
|
|
5230
|
-
/**
|
|
5231
|
-
* Service tier for the request.
|
|
5232
|
-
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
5233
|
-
* Set to 'priority' for faster processing with Enterprise access (available for gpt-4, gpt-5, gpt-5-mini, o3, o4-mini; gpt-5-nano is not supported).
|
|
5234
|
-
* Set to 'fast' for the same tier as 'priority' (OpenAI's newer name for it).
|
|
5235
|
-
*
|
|
5236
|
-
* Defaults to 'auto'.
|
|
5237
|
-
*/
|
|
5238
|
-
serviceTier: import_v423.z.enum(["auto", "flex", "priority", "fast", "default"]).nullish(),
|
|
5239
|
-
/**
|
|
5240
|
-
* Whether to store the generation. Defaults to `true`.
|
|
5241
|
-
*/
|
|
5242
|
-
store: import_v423.z.boolean().nullish(),
|
|
5243
|
-
/**
|
|
5244
|
-
* Whether to pass through non-image file types as generic input files.
|
|
5245
|
-
*
|
|
5246
|
-
* By default, inline file inputs are restricted to images and PDFs.
|
|
5247
|
-
* Enable this when the target OpenAI Responses model supports additional
|
|
5248
|
-
* file media types, such as text/csv.
|
|
5249
|
-
*/
|
|
5250
|
-
passThroughUnsupportedFiles: import_v423.z.boolean().optional(),
|
|
5251
|
-
/**
|
|
5252
|
-
* Whether to use strict JSON schema validation.
|
|
5253
|
-
* Defaults to `true`.
|
|
5254
|
-
*/
|
|
5255
|
-
strictJsonSchema: import_v423.z.boolean().nullish(),
|
|
5256
|
-
/**
|
|
5257
|
-
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
5258
|
-
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
5259
|
-
* Valid values: 'low', 'medium', 'high'.
|
|
5260
|
-
*/
|
|
5261
|
-
textVerbosity: import_v423.z.enum(["low", "medium", "high"]).nullish(),
|
|
5262
|
-
/**
|
|
5263
|
-
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
5264
|
-
* 'disabled' turns truncation off.
|
|
5265
|
-
*/
|
|
5266
|
-
truncation: import_v423.z.enum(["auto", "disabled"]).nullish(),
|
|
5267
|
-
/**
|
|
5268
|
-
* A unique identifier representing your end-user, which can help OpenAI to
|
|
5269
|
-
* monitor and detect abuse.
|
|
5270
|
-
* Defaults to `undefined`.
|
|
5271
|
-
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
5272
|
-
*/
|
|
5273
|
-
user: import_v423.z.string().nullish(),
|
|
5274
|
-
/**
|
|
5275
|
-
* Override the system message mode for this model.
|
|
5276
|
-
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
5277
|
-
* - 'developer': Use the 'developer' role for system messages (used by reasoning models)
|
|
5278
|
-
* - 'remove': Remove system messages entirely
|
|
5279
|
-
*
|
|
5280
|
-
* If not specified, the mode is automatically determined based on the model.
|
|
5281
|
-
*/
|
|
5282
|
-
systemMessageMode: import_v423.z.enum(["system", "developer", "remove"]).optional(),
|
|
5283
|
-
/**
|
|
5284
|
-
* Force treating this model as a reasoning model.
|
|
5285
|
-
*
|
|
5286
|
-
* This is useful for "stealth" reasoning models (e.g. via a custom baseURL)
|
|
5287
|
-
* where the model ID is not recognized by the SDK's allowlist.
|
|
5288
|
-
*
|
|
5289
|
-
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
5290
|
-
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
5291
|
-
*/
|
|
5292
|
-
forceReasoning: import_v423.z.boolean().optional(),
|
|
5293
|
-
/**
|
|
5294
|
-
* Restrict the callable tools to a subset while keeping the full tools
|
|
5295
|
-
* list intact, so prompt caching is preserved across requests with
|
|
5296
|
-
* different allowlists.
|
|
5297
|
-
*
|
|
5298
|
-
* When set, this overrides the request-level `toolChoice` and emits
|
|
5299
|
-
* `tool_choice: { type: "allowed_tools", mode, tools }` on the wire.
|
|
5300
|
-
*
|
|
5301
|
-
* @see https://developers.openai.com/api/reference/resources/responses/methods/create#(resource)%20responses%20%3E%20(model)%20tool_choice_allowed%20%3E%20(schema)
|
|
5302
|
-
*/
|
|
5303
|
-
allowedTools: import_v423.z.object({
|
|
5304
|
-
toolNames: import_v423.z.array(import_v423.z.string()).min(1),
|
|
5305
|
-
mode: import_v423.z.enum(["auto", "required"]).optional()
|
|
5306
|
-
}).optional()
|
|
5347
|
+
).optional(),
|
|
5348
|
+
service_tier: import_v423.z.string().nullish(),
|
|
5349
|
+
reasoning: import_v423.z.object({
|
|
5350
|
+
context: import_v423.z.string().nullish()
|
|
5351
|
+
}).nullish(),
|
|
5352
|
+
incomplete_details: import_v423.z.object({ reason: import_v423.z.string() }).nullish(),
|
|
5353
|
+
usage: openaiResponsesUsageSchema.nullish()
|
|
5307
5354
|
})
|
|
5308
5355
|
)
|
|
5309
5356
|
);
|
|
@@ -5806,6 +5853,18 @@ function extractApprovalRequestIdToToolCallIdMapping(prompt) {
|
|
|
5806
5853
|
}
|
|
5807
5854
|
return mapping;
|
|
5808
5855
|
}
|
|
5856
|
+
function getConfigurationUpdateUnsupportedReason({
|
|
5857
|
+
modelCapabilities,
|
|
5858
|
+
options
|
|
5859
|
+
}) {
|
|
5860
|
+
if (!modelCapabilities.supportsConfigurationUpdate) {
|
|
5861
|
+
return "reasoningEffortUpdate is only supported by GPT-6 and later models";
|
|
5862
|
+
}
|
|
5863
|
+
if ((options == null ? void 0 : options.reasoningMode) === "pro" || (options == null ? void 0 : options.truncation) === "auto") {
|
|
5864
|
+
return "reasoningEffortUpdate requires standard reasoning mode without automatic truncation";
|
|
5865
|
+
}
|
|
5866
|
+
return void 0;
|
|
5867
|
+
}
|
|
5809
5868
|
var OpenAIResponsesLanguageModel = class {
|
|
5810
5869
|
constructor(modelId, config) {
|
|
5811
5870
|
this.specificationVersion = "v3";
|
|
@@ -5913,8 +5972,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5913
5972
|
customProviderToolNames,
|
|
5914
5973
|
supportsAsyncToolCalling: modelCapabilities.supportsAsyncToolCalling
|
|
5915
5974
|
});
|
|
5975
|
+
const configurationUpdateUnsupportedReason = getConfigurationUpdateUnsupportedReason({
|
|
5976
|
+
modelCapabilities,
|
|
5977
|
+
options: openaiOptions
|
|
5978
|
+
});
|
|
5916
5979
|
const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
|
|
5917
5980
|
prompt,
|
|
5981
|
+
configurationUpdateUnsupportedReason,
|
|
5918
5982
|
toolNameMapping,
|
|
5919
5983
|
systemMessageMode: (_c = openaiOptions == null ? void 0 : openaiOptions.systemMessageMode) != null ? _c : isReasoningModel ? "developer" : modelCapabilities.systemMessageMode,
|
|
5920
5984
|
providerOptionsName,
|
|
@@ -5932,18 +5996,27 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5932
5996
|
});
|
|
5933
5997
|
warnings.push(...inputWarnings);
|
|
5934
5998
|
const reasoningEffortUpdate = openaiOptions == null ? void 0 : openaiOptions.reasoningEffortUpdate;
|
|
5935
|
-
|
|
5936
|
-
if (reasoningEffortUpdate != null && !configurationUpdateIsSupported) {
|
|
5999
|
+
if (reasoningEffortUpdate != null && configurationUpdateUnsupportedReason != null) {
|
|
5937
6000
|
warnings.push({
|
|
5938
6001
|
type: "unsupported",
|
|
5939
6002
|
feature: "reasoningEffortUpdate",
|
|
5940
|
-
details:
|
|
6003
|
+
details: configurationUpdateUnsupportedReason
|
|
5941
6004
|
});
|
|
5942
6005
|
} else if (reasoningEffortUpdate != null) {
|
|
5943
|
-
input
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
6006
|
+
const firstItem = input[0];
|
|
6007
|
+
if ((firstItem == null ? void 0 : firstItem.type) !== "configuration_update" || firstItem.reasoning.effort !== reasoningEffortUpdate) {
|
|
6008
|
+
input.unshift({
|
|
6009
|
+
type: "configuration_update",
|
|
6010
|
+
reasoning: { effort: reasoningEffortUpdate }
|
|
6011
|
+
});
|
|
6012
|
+
}
|
|
6013
|
+
}
|
|
6014
|
+
for (let i = 1; i < input.length; i++) {
|
|
6015
|
+
if (input[i - 1].type === "configuration_update" && input[i].type === "configuration_update") {
|
|
6016
|
+
throw new import_provider10.UnsupportedFunctionalityError({
|
|
6017
|
+
functionality: "Adjacent reasoning effort configuration updates"
|
|
6018
|
+
});
|
|
6019
|
+
}
|
|
5947
6020
|
}
|
|
5948
6021
|
const strictJsonSchema = (_f = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _f : true;
|
|
5949
6022
|
let include = openaiOptions == null ? void 0 : openaiOptions.include;
|
|
@@ -6890,7 +6963,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6890
6963
|
};
|
|
6891
6964
|
} else if (value.item.type === "shell_call_output") {
|
|
6892
6965
|
} else if (value.item.type === "message") {
|
|
6893
|
-
ongoingAnnotations.splice(0
|
|
6966
|
+
ongoingAnnotations.splice(0);
|
|
6894
6967
|
activeMessagePhase = (_b2 = value.item.phase) != null ? _b2 : void 0;
|
|
6895
6968
|
controller.enqueue({
|
|
6896
6969
|
type: "text-start",
|
|
@@ -8132,7 +8205,7 @@ var OpenAITranscriptionModel = class {
|
|
|
8132
8205
|
};
|
|
8133
8206
|
|
|
8134
8207
|
// src/version.ts
|
|
8135
|
-
var VERSION = true ? "3.0.
|
|
8208
|
+
var VERSION = true ? "3.0.118" : "0.0.0-test";
|
|
8136
8209
|
|
|
8137
8210
|
// src/openai-provider.ts
|
|
8138
8211
|
function createOpenAI(options = {}) {
|