@ai-sdk/openai 2.0.44 → 2.0.45

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.
@@ -11,10 +11,9 @@ import {
11
11
  parseProviderOptions,
12
12
  postJsonToApi
13
13
  } from "@ai-sdk/provider-utils";
14
- import { z as z3 } from "zod/v4";
15
14
 
16
15
  // src/openai-error.ts
17
- import { z } from "zod/v4";
16
+ import * as z from "zod/v4";
18
17
  import { createJsonErrorResponseHandler } from "@ai-sdk/provider-utils";
19
18
  var openaiErrorDataSchema = z.object({
20
19
  error: z.object({
@@ -242,95 +241,244 @@ function mapOpenAIFinishReason(finishReason) {
242
241
  }
243
242
  }
244
243
 
244
+ // src/chat/openai-chat-api.ts
245
+ import {
246
+ lazyValidator,
247
+ zodSchema
248
+ } from "@ai-sdk/provider-utils";
249
+ import * as z2 from "zod/v4";
250
+ var openaiChatResponseSchema = lazyValidator(
251
+ () => zodSchema(
252
+ z2.object({
253
+ id: z2.string().nullish(),
254
+ created: z2.number().nullish(),
255
+ model: z2.string().nullish(),
256
+ choices: z2.array(
257
+ z2.object({
258
+ message: z2.object({
259
+ role: z2.literal("assistant").nullish(),
260
+ content: z2.string().nullish(),
261
+ tool_calls: z2.array(
262
+ z2.object({
263
+ id: z2.string().nullish(),
264
+ type: z2.literal("function"),
265
+ function: z2.object({
266
+ name: z2.string(),
267
+ arguments: z2.string()
268
+ })
269
+ })
270
+ ).nullish(),
271
+ annotations: z2.array(
272
+ z2.object({
273
+ type: z2.literal("url_citation"),
274
+ start_index: z2.number(),
275
+ end_index: z2.number(),
276
+ url: z2.string(),
277
+ title: z2.string()
278
+ })
279
+ ).nullish()
280
+ }),
281
+ index: z2.number(),
282
+ logprobs: z2.object({
283
+ content: z2.array(
284
+ z2.object({
285
+ token: z2.string(),
286
+ logprob: z2.number(),
287
+ top_logprobs: z2.array(
288
+ z2.object({
289
+ token: z2.string(),
290
+ logprob: z2.number()
291
+ })
292
+ )
293
+ })
294
+ ).nullish()
295
+ }).nullish(),
296
+ finish_reason: z2.string().nullish()
297
+ })
298
+ ),
299
+ usage: z2.object({
300
+ prompt_tokens: z2.number().nullish(),
301
+ completion_tokens: z2.number().nullish(),
302
+ total_tokens: z2.number().nullish(),
303
+ prompt_tokens_details: z2.object({
304
+ cached_tokens: z2.number().nullish()
305
+ }).nullish(),
306
+ completion_tokens_details: z2.object({
307
+ reasoning_tokens: z2.number().nullish(),
308
+ accepted_prediction_tokens: z2.number().nullish(),
309
+ rejected_prediction_tokens: z2.number().nullish()
310
+ }).nullish()
311
+ }).nullish()
312
+ })
313
+ )
314
+ );
315
+ var openaiChatChunkSchema = lazyValidator(
316
+ () => zodSchema(
317
+ z2.union([
318
+ z2.object({
319
+ id: z2.string().nullish(),
320
+ created: z2.number().nullish(),
321
+ model: z2.string().nullish(),
322
+ choices: z2.array(
323
+ z2.object({
324
+ delta: z2.object({
325
+ role: z2.enum(["assistant"]).nullish(),
326
+ content: z2.string().nullish(),
327
+ tool_calls: z2.array(
328
+ z2.object({
329
+ index: z2.number(),
330
+ id: z2.string().nullish(),
331
+ type: z2.literal("function").nullish(),
332
+ function: z2.object({
333
+ name: z2.string().nullish(),
334
+ arguments: z2.string().nullish()
335
+ })
336
+ })
337
+ ).nullish(),
338
+ annotations: z2.array(
339
+ z2.object({
340
+ type: z2.literal("url_citation"),
341
+ start_index: z2.number(),
342
+ end_index: z2.number(),
343
+ url: z2.string(),
344
+ title: z2.string()
345
+ })
346
+ ).nullish()
347
+ }).nullish(),
348
+ logprobs: z2.object({
349
+ content: z2.array(
350
+ z2.object({
351
+ token: z2.string(),
352
+ logprob: z2.number(),
353
+ top_logprobs: z2.array(
354
+ z2.object({
355
+ token: z2.string(),
356
+ logprob: z2.number()
357
+ })
358
+ )
359
+ })
360
+ ).nullish()
361
+ }).nullish(),
362
+ finish_reason: z2.string().nullish(),
363
+ index: z2.number()
364
+ })
365
+ ),
366
+ usage: z2.object({
367
+ prompt_tokens: z2.number().nullish(),
368
+ completion_tokens: z2.number().nullish(),
369
+ total_tokens: z2.number().nullish(),
370
+ prompt_tokens_details: z2.object({
371
+ cached_tokens: z2.number().nullish()
372
+ }).nullish(),
373
+ completion_tokens_details: z2.object({
374
+ reasoning_tokens: z2.number().nullish(),
375
+ accepted_prediction_tokens: z2.number().nullish(),
376
+ rejected_prediction_tokens: z2.number().nullish()
377
+ }).nullish()
378
+ }).nullish()
379
+ }),
380
+ openaiErrorDataSchema
381
+ ])
382
+ )
383
+ );
384
+
245
385
  // src/chat/openai-chat-options.ts
246
- import { z as z2 } from "zod/v4";
247
- var openaiChatLanguageModelOptions = z2.object({
248
- /**
249
- * Modify the likelihood of specified tokens appearing in the completion.
250
- *
251
- * Accepts a JSON object that maps tokens (specified by their token ID in
252
- * the GPT tokenizer) to an associated bias value from -100 to 100.
253
- */
254
- logitBias: z2.record(z2.coerce.number(), z2.number()).optional(),
255
- /**
256
- * Return the log probabilities of the tokens.
257
- *
258
- * Setting to true will return the log probabilities of the tokens that
259
- * were generated.
260
- *
261
- * Setting to a number will return the log probabilities of the top n
262
- * tokens that were generated.
263
- */
264
- logprobs: z2.union([z2.boolean(), z2.number()]).optional(),
265
- /**
266
- * Whether to enable parallel function calling during tool use. Default to true.
267
- */
268
- parallelToolCalls: z2.boolean().optional(),
269
- /**
270
- * A unique identifier representing your end-user, which can help OpenAI to
271
- * monitor and detect abuse.
272
- */
273
- user: z2.string().optional(),
274
- /**
275
- * Reasoning effort for reasoning models. Defaults to `medium`.
276
- */
277
- reasoningEffort: z2.enum(["minimal", "low", "medium", "high"]).optional(),
278
- /**
279
- * Maximum number of completion tokens to generate. Useful for reasoning models.
280
- */
281
- maxCompletionTokens: z2.number().optional(),
282
- /**
283
- * Whether to enable persistence in responses API.
284
- */
285
- store: z2.boolean().optional(),
286
- /**
287
- * Metadata to associate with the request.
288
- */
289
- metadata: z2.record(z2.string().max(64), z2.string().max(512)).optional(),
290
- /**
291
- * Parameters for prediction mode.
292
- */
293
- prediction: z2.record(z2.string(), z2.any()).optional(),
294
- /**
295
- * Whether to use structured outputs.
296
- *
297
- * @default true
298
- */
299
- structuredOutputs: z2.boolean().optional(),
300
- /**
301
- * Service tier for the request.
302
- * - 'auto': Default service tier
303
- * - 'flex': 50% cheaper processing at the cost of increased latency. Only available for o3 and o4-mini models.
304
- * - 'priority': Higher-speed processing with predictably low latency at premium cost. Available for Enterprise customers.
305
- *
306
- * @default 'auto'
307
- */
308
- serviceTier: z2.enum(["auto", "flex", "priority"]).optional(),
309
- /**
310
- * Whether to use strict JSON schema validation.
311
- *
312
- * @default false
313
- */
314
- strictJsonSchema: z2.boolean().optional(),
315
- /**
316
- * Controls the verbosity of the model's responses.
317
- * Lower values will result in more concise responses, while higher values will result in more verbose responses.
318
- */
319
- textVerbosity: z2.enum(["low", "medium", "high"]).optional(),
320
- /**
321
- * A cache key for prompt caching. Allows manual control over prompt caching behavior.
322
- * Useful for improving cache hit rates and working around automatic caching issues.
323
- */
324
- promptCacheKey: z2.string().optional(),
325
- /**
326
- * A stable identifier used to help detect users of your application
327
- * that may be violating OpenAI's usage policies. The IDs should be a
328
- * string that uniquely identifies each user. We recommend hashing their
329
- * username or email address, in order to avoid sending us any identifying
330
- * information.
331
- */
332
- safetyIdentifier: z2.string().optional()
333
- });
386
+ import {
387
+ lazyValidator as lazyValidator2,
388
+ zodSchema as zodSchema2
389
+ } from "@ai-sdk/provider-utils";
390
+ import * as z3 from "zod/v4";
391
+ var openaiChatLanguageModelOptions = lazyValidator2(
392
+ () => zodSchema2(
393
+ z3.object({
394
+ /**
395
+ * Modify the likelihood of specified tokens appearing in the completion.
396
+ *
397
+ * Accepts a JSON object that maps tokens (specified by their token ID in
398
+ * the GPT tokenizer) to an associated bias value from -100 to 100.
399
+ */
400
+ logitBias: z3.record(z3.coerce.number(), z3.number()).optional(),
401
+ /**
402
+ * Return the log probabilities of the tokens.
403
+ *
404
+ * Setting to true will return the log probabilities of the tokens that
405
+ * were generated.
406
+ *
407
+ * Setting to a number will return the log probabilities of the top n
408
+ * tokens that were generated.
409
+ */
410
+ logprobs: z3.union([z3.boolean(), z3.number()]).optional(),
411
+ /**
412
+ * Whether to enable parallel function calling during tool use. Default to true.
413
+ */
414
+ parallelToolCalls: z3.boolean().optional(),
415
+ /**
416
+ * A unique identifier representing your end-user, which can help OpenAI to
417
+ * monitor and detect abuse.
418
+ */
419
+ user: z3.string().optional(),
420
+ /**
421
+ * Reasoning effort for reasoning models. Defaults to `medium`.
422
+ */
423
+ reasoningEffort: z3.enum(["minimal", "low", "medium", "high"]).optional(),
424
+ /**
425
+ * Maximum number of completion tokens to generate. Useful for reasoning models.
426
+ */
427
+ maxCompletionTokens: z3.number().optional(),
428
+ /**
429
+ * Whether to enable persistence in responses API.
430
+ */
431
+ store: z3.boolean().optional(),
432
+ /**
433
+ * Metadata to associate with the request.
434
+ */
435
+ metadata: z3.record(z3.string().max(64), z3.string().max(512)).optional(),
436
+ /**
437
+ * Parameters for prediction mode.
438
+ */
439
+ prediction: z3.record(z3.string(), z3.any()).optional(),
440
+ /**
441
+ * Whether to use structured outputs.
442
+ *
443
+ * @default true
444
+ */
445
+ structuredOutputs: z3.boolean().optional(),
446
+ /**
447
+ * Service tier for the request.
448
+ * - 'auto': Default service tier
449
+ * - 'flex': 50% cheaper processing at the cost of increased latency. Only available for o3 and o4-mini models.
450
+ * - 'priority': Higher-speed processing with predictably low latency at premium cost. Available for Enterprise customers.
451
+ *
452
+ * @default 'auto'
453
+ */
454
+ serviceTier: z3.enum(["auto", "flex", "priority"]).optional(),
455
+ /**
456
+ * Whether to use strict JSON schema validation.
457
+ *
458
+ * @default false
459
+ */
460
+ strictJsonSchema: z3.boolean().optional(),
461
+ /**
462
+ * Controls the verbosity of the model's responses.
463
+ * Lower values will result in more concise responses, while higher values will result in more verbose responses.
464
+ */
465
+ textVerbosity: z3.enum(["low", "medium", "high"]).optional(),
466
+ /**
467
+ * A cache key for prompt caching. Allows manual control over prompt caching behavior.
468
+ * Useful for improving cache hit rates and working around automatic caching issues.
469
+ */
470
+ promptCacheKey: z3.string().optional(),
471
+ /**
472
+ * A stable identifier used to help detect users of your application
473
+ * that may be violating OpenAI's usage policies. The IDs should be a
474
+ * string that uniquely identifies each user. We recommend hashing their
475
+ * username or email address, in order to avoid sending us any identifying
476
+ * information.
477
+ */
478
+ safetyIdentifier: z3.string().optional()
479
+ })
480
+ )
481
+ );
334
482
 
335
483
  // src/chat/openai-chat-prepare-tools.ts
336
484
  import {
@@ -888,121 +1036,6 @@ var OpenAIChatLanguageModel = class {
888
1036
  };
889
1037
  }
890
1038
  };
891
- var openaiTokenUsageSchema = z3.object({
892
- prompt_tokens: z3.number().nullish(),
893
- completion_tokens: z3.number().nullish(),
894
- total_tokens: z3.number().nullish(),
895
- prompt_tokens_details: z3.object({
896
- cached_tokens: z3.number().nullish()
897
- }).nullish(),
898
- completion_tokens_details: z3.object({
899
- reasoning_tokens: z3.number().nullish(),
900
- accepted_prediction_tokens: z3.number().nullish(),
901
- rejected_prediction_tokens: z3.number().nullish()
902
- }).nullish()
903
- }).nullish();
904
- var openaiChatResponseSchema = z3.object({
905
- id: z3.string().nullish(),
906
- created: z3.number().nullish(),
907
- model: z3.string().nullish(),
908
- choices: z3.array(
909
- z3.object({
910
- message: z3.object({
911
- role: z3.literal("assistant").nullish(),
912
- content: z3.string().nullish(),
913
- tool_calls: z3.array(
914
- z3.object({
915
- id: z3.string().nullish(),
916
- type: z3.literal("function"),
917
- function: z3.object({
918
- name: z3.string(),
919
- arguments: z3.string()
920
- })
921
- })
922
- ).nullish(),
923
- annotations: z3.array(
924
- z3.object({
925
- type: z3.literal("url_citation"),
926
- start_index: z3.number(),
927
- end_index: z3.number(),
928
- url: z3.string(),
929
- title: z3.string()
930
- })
931
- ).nullish()
932
- }),
933
- index: z3.number(),
934
- logprobs: z3.object({
935
- content: z3.array(
936
- z3.object({
937
- token: z3.string(),
938
- logprob: z3.number(),
939
- top_logprobs: z3.array(
940
- z3.object({
941
- token: z3.string(),
942
- logprob: z3.number()
943
- })
944
- )
945
- })
946
- ).nullish()
947
- }).nullish(),
948
- finish_reason: z3.string().nullish()
949
- })
950
- ),
951
- usage: openaiTokenUsageSchema
952
- });
953
- var openaiChatChunkSchema = z3.union([
954
- z3.object({
955
- id: z3.string().nullish(),
956
- created: z3.number().nullish(),
957
- model: z3.string().nullish(),
958
- choices: z3.array(
959
- z3.object({
960
- delta: z3.object({
961
- role: z3.enum(["assistant"]).nullish(),
962
- content: z3.string().nullish(),
963
- tool_calls: z3.array(
964
- z3.object({
965
- index: z3.number(),
966
- id: z3.string().nullish(),
967
- type: z3.literal("function").nullish(),
968
- function: z3.object({
969
- name: z3.string().nullish(),
970
- arguments: z3.string().nullish()
971
- })
972
- })
973
- ).nullish(),
974
- annotations: z3.array(
975
- z3.object({
976
- type: z3.literal("url_citation"),
977
- start_index: z3.number(),
978
- end_index: z3.number(),
979
- url: z3.string(),
980
- title: z3.string()
981
- })
982
- ).nullish()
983
- }).nullish(),
984
- logprobs: z3.object({
985
- content: z3.array(
986
- z3.object({
987
- token: z3.string(),
988
- logprob: z3.number(),
989
- top_logprobs: z3.array(
990
- z3.object({
991
- token: z3.string(),
992
- logprob: z3.number()
993
- })
994
- )
995
- })
996
- ).nullish()
997
- }).nullish(),
998
- finish_reason: z3.string().nullish(),
999
- index: z3.number()
1000
- })
1001
- ),
1002
- usage: openaiTokenUsageSchema
1003
- }),
1004
- openaiErrorDataSchema
1005
- ]);
1006
1039
  function isReasoningModel(modelId) {
1007
1040
  return (modelId.startsWith("o") || modelId.startsWith("gpt-5")) && !modelId.startsWith("gpt-5-chat");
1008
1041
  }
@@ -1060,7 +1093,6 @@ import {
1060
1093
  parseProviderOptions as parseProviderOptions2,
1061
1094
  postJsonToApi as postJsonToApi2
1062
1095
  } from "@ai-sdk/provider-utils";
1063
- import { z as z5 } from "zod/v4";
1064
1096
 
1065
1097
  // src/completion/convert-to-openai-completion-prompt.ts
1066
1098
  import {
@@ -1170,48 +1202,117 @@ function mapOpenAIFinishReason2(finishReason) {
1170
1202
  }
1171
1203
  }
1172
1204
 
1205
+ // src/completion/openai-completion-api.ts
1206
+ import * as z4 from "zod/v4";
1207
+ import {
1208
+ lazyValidator as lazyValidator3,
1209
+ zodSchema as zodSchema3
1210
+ } from "@ai-sdk/provider-utils";
1211
+ var openaiCompletionResponseSchema = lazyValidator3(
1212
+ () => zodSchema3(
1213
+ z4.object({
1214
+ id: z4.string().nullish(),
1215
+ created: z4.number().nullish(),
1216
+ model: z4.string().nullish(),
1217
+ choices: z4.array(
1218
+ z4.object({
1219
+ text: z4.string(),
1220
+ finish_reason: z4.string(),
1221
+ logprobs: z4.object({
1222
+ tokens: z4.array(z4.string()),
1223
+ token_logprobs: z4.array(z4.number()),
1224
+ top_logprobs: z4.array(z4.record(z4.string(), z4.number())).nullish()
1225
+ }).nullish()
1226
+ })
1227
+ ),
1228
+ usage: z4.object({
1229
+ prompt_tokens: z4.number(),
1230
+ completion_tokens: z4.number(),
1231
+ total_tokens: z4.number()
1232
+ }).nullish()
1233
+ })
1234
+ )
1235
+ );
1236
+ var openaiCompletionChunkSchema = lazyValidator3(
1237
+ () => zodSchema3(
1238
+ z4.union([
1239
+ z4.object({
1240
+ id: z4.string().nullish(),
1241
+ created: z4.number().nullish(),
1242
+ model: z4.string().nullish(),
1243
+ choices: z4.array(
1244
+ z4.object({
1245
+ text: z4.string(),
1246
+ finish_reason: z4.string().nullish(),
1247
+ index: z4.number(),
1248
+ logprobs: z4.object({
1249
+ tokens: z4.array(z4.string()),
1250
+ token_logprobs: z4.array(z4.number()),
1251
+ top_logprobs: z4.array(z4.record(z4.string(), z4.number())).nullish()
1252
+ }).nullish()
1253
+ })
1254
+ ),
1255
+ usage: z4.object({
1256
+ prompt_tokens: z4.number(),
1257
+ completion_tokens: z4.number(),
1258
+ total_tokens: z4.number()
1259
+ }).nullish()
1260
+ }),
1261
+ openaiErrorDataSchema
1262
+ ])
1263
+ )
1264
+ );
1265
+
1173
1266
  // src/completion/openai-completion-options.ts
1174
- import { z as z4 } from "zod/v4";
1175
- var openaiCompletionProviderOptions = z4.object({
1176
- /**
1177
- Echo back the prompt in addition to the completion.
1178
- */
1179
- echo: z4.boolean().optional(),
1180
- /**
1181
- Modify the likelihood of specified tokens appearing in the completion.
1182
-
1183
- Accepts a JSON object that maps tokens (specified by their token ID in
1184
- the GPT tokenizer) to an associated bias value from -100 to 100. You
1185
- can use this tokenizer tool to convert text to token IDs. Mathematically,
1186
- the bias is added to the logits generated by the model prior to sampling.
1187
- The exact effect will vary per model, but values between -1 and 1 should
1188
- decrease or increase likelihood of selection; values like -100 or 100
1189
- should result in a ban or exclusive selection of the relevant token.
1190
-
1191
- As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
1192
- token from being generated.
1193
- */
1194
- logitBias: z4.record(z4.string(), z4.number()).optional(),
1195
- /**
1196
- The suffix that comes after a completion of inserted text.
1197
- */
1198
- suffix: z4.string().optional(),
1199
- /**
1200
- A unique identifier representing your end-user, which can help OpenAI to
1201
- monitor and detect abuse. Learn more.
1202
- */
1203
- user: z4.string().optional(),
1204
- /**
1205
- Return the log probabilities of the tokens. Including logprobs will increase
1206
- the response size and can slow down response times. However, it can
1207
- be useful to better understand how the model is behaving.
1208
- Setting to true will return the log probabilities of the tokens that
1209
- were generated.
1210
- Setting to a number will return the log probabilities of the top n
1211
- tokens that were generated.
1212
- */
1213
- logprobs: z4.union([z4.boolean(), z4.number()]).optional()
1214
- });
1267
+ import {
1268
+ lazyValidator as lazyValidator4,
1269
+ zodSchema as zodSchema4
1270
+ } from "@ai-sdk/provider-utils";
1271
+ import * as z5 from "zod/v4";
1272
+ var openaiCompletionProviderOptions = lazyValidator4(
1273
+ () => zodSchema4(
1274
+ z5.object({
1275
+ /**
1276
+ Echo back the prompt in addition to the completion.
1277
+ */
1278
+ echo: z5.boolean().optional(),
1279
+ /**
1280
+ Modify the likelihood of specified tokens appearing in the completion.
1281
+
1282
+ Accepts a JSON object that maps tokens (specified by their token ID in
1283
+ the GPT tokenizer) to an associated bias value from -100 to 100. You
1284
+ can use this tokenizer tool to convert text to token IDs. Mathematically,
1285
+ the bias is added to the logits generated by the model prior to sampling.
1286
+ The exact effect will vary per model, but values between -1 and 1 should
1287
+ decrease or increase likelihood of selection; values like -100 or 100
1288
+ should result in a ban or exclusive selection of the relevant token.
1289
+
1290
+ As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
1291
+ token from being generated.
1292
+ */
1293
+ logitBias: z5.record(z5.string(), z5.number()).optional(),
1294
+ /**
1295
+ The suffix that comes after a completion of inserted text.
1296
+ */
1297
+ suffix: z5.string().optional(),
1298
+ /**
1299
+ A unique identifier representing your end-user, which can help OpenAI to
1300
+ monitor and detect abuse. Learn more.
1301
+ */
1302
+ user: z5.string().optional(),
1303
+ /**
1304
+ Return the log probabilities of the tokens. Including logprobs will increase
1305
+ the response size and can slow down response times. However, it can
1306
+ be useful to better understand how the model is behaving.
1307
+ Setting to true will return the log probabilities of the tokens that
1308
+ were generated.
1309
+ Setting to a number will return the log probabilities of the top n
1310
+ tokens that were generated.
1311
+ */
1312
+ logprobs: z5.union([z5.boolean(), z5.number()]).optional()
1313
+ })
1314
+ )
1315
+ );
1215
1316
 
1216
1317
  // src/completion/openai-completion-language-model.ts
1217
1318
  var OpenAICompletionLanguageModel = class {
@@ -1442,49 +1543,6 @@ var OpenAICompletionLanguageModel = class {
1442
1543
  };
1443
1544
  }
1444
1545
  };
1445
- var usageSchema = z5.object({
1446
- prompt_tokens: z5.number(),
1447
- completion_tokens: z5.number(),
1448
- total_tokens: z5.number()
1449
- });
1450
- var openaiCompletionResponseSchema = z5.object({
1451
- id: z5.string().nullish(),
1452
- created: z5.number().nullish(),
1453
- model: z5.string().nullish(),
1454
- choices: z5.array(
1455
- z5.object({
1456
- text: z5.string(),
1457
- finish_reason: z5.string(),
1458
- logprobs: z5.object({
1459
- tokens: z5.array(z5.string()),
1460
- token_logprobs: z5.array(z5.number()),
1461
- top_logprobs: z5.array(z5.record(z5.string(), z5.number())).nullish()
1462
- }).nullish()
1463
- })
1464
- ),
1465
- usage: usageSchema.nullish()
1466
- });
1467
- var openaiCompletionChunkSchema = z5.union([
1468
- z5.object({
1469
- id: z5.string().nullish(),
1470
- created: z5.number().nullish(),
1471
- model: z5.string().nullish(),
1472
- choices: z5.array(
1473
- z5.object({
1474
- text: z5.string(),
1475
- finish_reason: z5.string().nullish(),
1476
- index: z5.number(),
1477
- logprobs: z5.object({
1478
- tokens: z5.array(z5.string()),
1479
- token_logprobs: z5.array(z5.number()),
1480
- top_logprobs: z5.array(z5.record(z5.string(), z5.number())).nullish()
1481
- }).nullish()
1482
- })
1483
- ),
1484
- usage: usageSchema.nullish()
1485
- }),
1486
- openaiErrorDataSchema
1487
- ]);
1488
1546
 
1489
1547
  // src/embedding/openai-embedding-model.ts
1490
1548
  import {
@@ -1496,22 +1554,41 @@ import {
1496
1554
  parseProviderOptions as parseProviderOptions3,
1497
1555
  postJsonToApi as postJsonToApi3
1498
1556
  } from "@ai-sdk/provider-utils";
1499
- import { z as z7 } from "zod/v4";
1500
1557
 
1501
1558
  // src/embedding/openai-embedding-options.ts
1502
- import { z as z6 } from "zod/v4";
1503
- var openaiEmbeddingProviderOptions = z6.object({
1504
- /**
1505
- The number of dimensions the resulting output embeddings should have.
1506
- Only supported in text-embedding-3 and later models.
1507
- */
1508
- dimensions: z6.number().optional(),
1509
- /**
1510
- A unique identifier representing your end-user, which can help OpenAI to
1511
- monitor and detect abuse. Learn more.
1512
- */
1513
- user: z6.string().optional()
1514
- });
1559
+ import {
1560
+ lazyValidator as lazyValidator5,
1561
+ zodSchema as zodSchema5
1562
+ } from "@ai-sdk/provider-utils";
1563
+ import * as z6 from "zod/v4";
1564
+ var openaiEmbeddingProviderOptions = lazyValidator5(
1565
+ () => zodSchema5(
1566
+ z6.object({
1567
+ /**
1568
+ The number of dimensions the resulting output embeddings should have.
1569
+ Only supported in text-embedding-3 and later models.
1570
+ */
1571
+ dimensions: z6.number().optional(),
1572
+ /**
1573
+ A unique identifier representing your end-user, which can help OpenAI to
1574
+ monitor and detect abuse. Learn more.
1575
+ */
1576
+ user: z6.string().optional()
1577
+ })
1578
+ )
1579
+ );
1580
+
1581
+ // src/embedding/openai-embedding-api.ts
1582
+ import { lazyValidator as lazyValidator6, zodSchema as zodSchema6 } from "@ai-sdk/provider-utils";
1583
+ import * as z7 from "zod/v4";
1584
+ var openaiTextEmbeddingResponseSchema = lazyValidator6(
1585
+ () => zodSchema6(
1586
+ z7.object({
1587
+ data: z7.array(z7.object({ embedding: z7.array(z7.number()) })),
1588
+ usage: z7.object({ prompt_tokens: z7.number() }).nullish()
1589
+ })
1590
+ )
1591
+ );
1515
1592
 
1516
1593
  // src/embedding/openai-embedding-model.ts
1517
1594
  var OpenAIEmbeddingModel = class {
@@ -1576,10 +1653,6 @@ var OpenAIEmbeddingModel = class {
1576
1653
  };
1577
1654
  }
1578
1655
  };
1579
- var openaiTextEmbeddingResponseSchema = z7.object({
1580
- data: z7.array(z7.object({ embedding: z7.array(z7.number()) })),
1581
- usage: z7.object({ prompt_tokens: z7.number() }).nullish()
1582
- });
1583
1656
 
1584
1657
  // src/image/openai-image-model.ts
1585
1658
  import {
@@ -1587,7 +1660,22 @@ import {
1587
1660
  createJsonResponseHandler as createJsonResponseHandler4,
1588
1661
  postJsonToApi as postJsonToApi4
1589
1662
  } from "@ai-sdk/provider-utils";
1590
- import { z as z8 } from "zod/v4";
1663
+
1664
+ // src/image/openai-image-api.ts
1665
+ import { lazyValidator as lazyValidator7, zodSchema as zodSchema7 } from "@ai-sdk/provider-utils";
1666
+ import * as z8 from "zod/v4";
1667
+ var openaiImageResponseSchema = lazyValidator7(
1668
+ () => zodSchema7(
1669
+ z8.object({
1670
+ data: z8.array(
1671
+ z8.object({
1672
+ b64_json: z8.string(),
1673
+ revised_prompt: z8.string().optional()
1674
+ })
1675
+ )
1676
+ })
1677
+ )
1678
+ );
1591
1679
 
1592
1680
  // src/image/openai-image-options.ts
1593
1681
  var modelMaxImagesPerCall = {
@@ -1679,11 +1767,6 @@ var OpenAIImageModel = class {
1679
1767
  };
1680
1768
  }
1681
1769
  };
1682
- var openaiImageResponseSchema = z8.object({
1683
- data: z8.array(
1684
- z8.object({ b64_json: z8.string(), revised_prompt: z8.string().optional() })
1685
- )
1686
- });
1687
1770
 
1688
1771
  // src/transcription/openai-transcription-model.ts
1689
1772
  import {
@@ -1694,34 +1777,75 @@ import {
1694
1777
  parseProviderOptions as parseProviderOptions4,
1695
1778
  postFormDataToApi
1696
1779
  } from "@ai-sdk/provider-utils";
1697
- import { z as z10 } from "zod/v4";
1780
+
1781
+ // src/transcription/openai-transcription-api.ts
1782
+ import { lazyValidator as lazyValidator8, zodSchema as zodSchema8 } from "@ai-sdk/provider-utils";
1783
+ import * as z9 from "zod/v4";
1784
+ var openaiTranscriptionResponseSchema = lazyValidator8(
1785
+ () => zodSchema8(
1786
+ z9.object({
1787
+ text: z9.string(),
1788
+ language: z9.string().nullish(),
1789
+ duration: z9.number().nullish(),
1790
+ words: z9.array(
1791
+ z9.object({
1792
+ word: z9.string(),
1793
+ start: z9.number(),
1794
+ end: z9.number()
1795
+ })
1796
+ ).nullish(),
1797
+ segments: z9.array(
1798
+ z9.object({
1799
+ id: z9.number(),
1800
+ seek: z9.number(),
1801
+ start: z9.number(),
1802
+ end: z9.number(),
1803
+ text: z9.string(),
1804
+ tokens: z9.array(z9.number()),
1805
+ temperature: z9.number(),
1806
+ avg_logprob: z9.number(),
1807
+ compression_ratio: z9.number(),
1808
+ no_speech_prob: z9.number()
1809
+ })
1810
+ ).nullish()
1811
+ })
1812
+ )
1813
+ );
1698
1814
 
1699
1815
  // src/transcription/openai-transcription-options.ts
1700
- import { z as z9 } from "zod/v4";
1701
- var openAITranscriptionProviderOptions = z9.object({
1702
- /**
1703
- * Additional information to include in the transcription response.
1704
- */
1705
- include: z9.array(z9.string()).optional(),
1706
- /**
1707
- * The language of the input audio in ISO-639-1 format.
1708
- */
1709
- language: z9.string().optional(),
1710
- /**
1711
- * An optional text to guide the model's style or continue a previous audio segment.
1712
- */
1713
- prompt: z9.string().optional(),
1714
- /**
1715
- * The sampling temperature, between 0 and 1.
1716
- * @default 0
1717
- */
1718
- temperature: z9.number().min(0).max(1).default(0).optional(),
1719
- /**
1720
- * The timestamp granularities to populate for this transcription.
1721
- * @default ['segment']
1722
- */
1723
- timestampGranularities: z9.array(z9.enum(["word", "segment"])).default(["segment"]).optional()
1724
- });
1816
+ import {
1817
+ lazyValidator as lazyValidator9,
1818
+ zodSchema as zodSchema9
1819
+ } from "@ai-sdk/provider-utils";
1820
+ import * as z10 from "zod/v4";
1821
+ var openAITranscriptionProviderOptions = lazyValidator9(
1822
+ () => zodSchema9(
1823
+ z10.object({
1824
+ /**
1825
+ * Additional information to include in the transcription response.
1826
+ */
1827
+ include: z10.array(z10.string()).optional(),
1828
+ /**
1829
+ * The language of the input audio in ISO-639-1 format.
1830
+ */
1831
+ language: z10.string().optional(),
1832
+ /**
1833
+ * An optional text to guide the model's style or continue a previous audio segment.
1834
+ */
1835
+ prompt: z10.string().optional(),
1836
+ /**
1837
+ * The sampling temperature, between 0 and 1.
1838
+ * @default 0
1839
+ */
1840
+ temperature: z10.number().min(0).max(1).default(0).optional(),
1841
+ /**
1842
+ * The timestamp granularities to populate for this transcription.
1843
+ * @default ['segment']
1844
+ */
1845
+ timestampGranularities: z10.array(z10.enum(["word", "segment"])).default(["segment"]).optional()
1846
+ })
1847
+ )
1848
+ );
1725
1849
 
1726
1850
  // src/transcription/openai-transcription-model.ts
1727
1851
  var languageMap = {
@@ -1889,32 +2013,6 @@ var OpenAITranscriptionModel = class {
1889
2013
  };
1890
2014
  }
1891
2015
  };
1892
- var openaiTranscriptionResponseSchema = z10.object({
1893
- text: z10.string(),
1894
- language: z10.string().nullish(),
1895
- duration: z10.number().nullish(),
1896
- words: z10.array(
1897
- z10.object({
1898
- word: z10.string(),
1899
- start: z10.number(),
1900
- end: z10.number()
1901
- })
1902
- ).nullish(),
1903
- segments: z10.array(
1904
- z10.object({
1905
- id: z10.number(),
1906
- seek: z10.number(),
1907
- start: z10.number(),
1908
- end: z10.number(),
1909
- text: z10.string(),
1910
- tokens: z10.array(z10.number()),
1911
- temperature: z10.number(),
1912
- avg_logprob: z10.number(),
1913
- compression_ratio: z10.number(),
1914
- no_speech_prob: z10.number()
1915
- })
1916
- ).nullish()
1917
- });
1918
2016
 
1919
2017
  // src/speech/openai-speech-model.ts
1920
2018
  import {
@@ -1923,11 +2021,23 @@ import {
1923
2021
  parseProviderOptions as parseProviderOptions5,
1924
2022
  postJsonToApi as postJsonToApi5
1925
2023
  } from "@ai-sdk/provider-utils";
1926
- import { z as z11 } from "zod/v4";
1927
- var OpenAIProviderOptionsSchema = z11.object({
1928
- instructions: z11.string().nullish(),
1929
- speed: z11.number().min(0.25).max(4).default(1).nullish()
1930
- });
2024
+
2025
+ // src/speech/openai-speech-options.ts
2026
+ import {
2027
+ lazyValidator as lazyValidator10,
2028
+ zodSchema as zodSchema10
2029
+ } from "@ai-sdk/provider-utils";
2030
+ import * as z11 from "zod/v4";
2031
+ var openaiSpeechProviderOptionsSchema = lazyValidator10(
2032
+ () => zodSchema10(
2033
+ z11.object({
2034
+ instructions: z11.string().nullish(),
2035
+ speed: z11.number().min(0.25).max(4).default(1).nullish()
2036
+ })
2037
+ )
2038
+ );
2039
+
2040
+ // src/speech/openai-speech-model.ts
1931
2041
  var OpenAISpeechModel = class {
1932
2042
  constructor(modelId, config) {
1933
2043
  this.modelId = modelId;
@@ -1950,7 +2060,7 @@ var OpenAISpeechModel = class {
1950
2060
  const openAIOptions = await parseProviderOptions5({
1951
2061
  provider: "openai",
1952
2062
  providerOptions,
1953
- schema: OpenAIProviderOptionsSchema
2063
+ schema: openaiSpeechProviderOptionsSchema
1954
2064
  });
1955
2065
  const requestBody = {
1956
2066
  model: this.modelId,
@@ -2040,31 +2150,42 @@ import {
2040
2150
  parseProviderOptions as parseProviderOptions7,
2041
2151
  postJsonToApi as postJsonToApi6
2042
2152
  } from "@ai-sdk/provider-utils";
2043
- import { z as z19 } from "zod/v4";
2044
2153
 
2045
2154
  // src/responses/convert-to-openai-responses-input.ts
2046
2155
  import {
2047
2156
  UnsupportedFunctionalityError as UnsupportedFunctionalityError4
2048
2157
  } from "@ai-sdk/provider";
2049
- import { convertToBase64 as convertToBase642, parseProviderOptions as parseProviderOptions6 } from "@ai-sdk/provider-utils";
2050
- import { z as z13 } from "zod/v4";
2158
+ import {
2159
+ convertToBase64 as convertToBase642,
2160
+ parseProviderOptions as parseProviderOptions6,
2161
+ validateTypes
2162
+ } from "@ai-sdk/provider-utils";
2163
+ import * as z13 from "zod/v4";
2051
2164
 
2052
2165
  // src/tool/local-shell.ts
2053
- import { createProviderDefinedToolFactoryWithOutputSchema } from "@ai-sdk/provider-utils";
2054
- import { z as z12 } from "zod/v4";
2055
- var localShellInputSchema = z12.object({
2056
- action: z12.object({
2057
- type: z12.literal("exec"),
2058
- command: z12.array(z12.string()),
2059
- timeoutMs: z12.number().optional(),
2060
- user: z12.string().optional(),
2061
- workingDirectory: z12.string().optional(),
2062
- env: z12.record(z12.string(), z12.string()).optional()
2063
- })
2064
- });
2065
- var localShellOutputSchema = z12.object({
2066
- output: z12.string()
2067
- });
2166
+ import {
2167
+ createProviderDefinedToolFactoryWithOutputSchema,
2168
+ lazySchema,
2169
+ zodSchema as zodSchema11
2170
+ } from "@ai-sdk/provider-utils";
2171
+ import * as z12 from "zod/v4";
2172
+ var localShellInputSchema = lazySchema(
2173
+ () => zodSchema11(
2174
+ z12.object({
2175
+ action: z12.object({
2176
+ type: z12.literal("exec"),
2177
+ command: z12.array(z12.string()),
2178
+ timeoutMs: z12.number().optional(),
2179
+ user: z12.string().optional(),
2180
+ workingDirectory: z12.string().optional(),
2181
+ env: z12.record(z12.string(), z12.string()).optional()
2182
+ })
2183
+ })
2184
+ )
2185
+ );
2186
+ var localShellOutputSchema = lazySchema(
2187
+ () => zodSchema11(z12.object({ output: z12.string() }))
2188
+ );
2068
2189
  var localShell = createProviderDefinedToolFactoryWithOutputSchema({
2069
2190
  id: "openai.local_shell",
2070
2191
  name: "local_shell",
@@ -2178,7 +2299,10 @@ async function convertToOpenAIResponsesInput({
2178
2299
  break;
2179
2300
  }
2180
2301
  if (hasLocalShellTool && part.toolName === "local_shell") {
2181
- const parsedInput = localShellInputSchema.parse(part.input);
2302
+ const parsedInput = await validateTypes({
2303
+ value: part.input,
2304
+ schema: localShellInputSchema
2305
+ });
2182
2306
  input.push({
2183
2307
  type: "local_shell_call",
2184
2308
  call_id: part.toolCallId,
@@ -2274,10 +2398,14 @@ async function convertToOpenAIResponsesInput({
2274
2398
  for (const part of content) {
2275
2399
  const output = part.output;
2276
2400
  if (hasLocalShellTool && part.toolName === "local_shell" && output.type === "json") {
2401
+ const parsedOutput = await validateTypes({
2402
+ value: output.value,
2403
+ schema: localShellOutputSchema
2404
+ });
2277
2405
  input.push({
2278
2406
  type: "local_shell_call_output",
2279
2407
  call_id: part.toolCallId,
2280
- output: localShellOutputSchema.parse(output.value).output
2408
+ output: parsedOutput.output
2281
2409
  });
2282
2410
  break;
2283
2411
  }
@@ -2332,34 +2460,585 @@ function mapOpenAIResponseFinishReason({
2332
2460
  }
2333
2461
  }
2334
2462
 
2463
+ // src/responses/openai-responses-api.ts
2464
+ import {
2465
+ lazyValidator as lazyValidator11,
2466
+ zodSchema as zodSchema12
2467
+ } from "@ai-sdk/provider-utils";
2468
+ import * as z14 from "zod/v4";
2469
+ var openaiResponsesChunkSchema = lazyValidator11(
2470
+ () => zodSchema12(
2471
+ z14.union([
2472
+ z14.object({
2473
+ type: z14.literal("response.output_text.delta"),
2474
+ item_id: z14.string(),
2475
+ delta: z14.string(),
2476
+ logprobs: z14.array(
2477
+ z14.object({
2478
+ token: z14.string(),
2479
+ logprob: z14.number(),
2480
+ top_logprobs: z14.array(
2481
+ z14.object({
2482
+ token: z14.string(),
2483
+ logprob: z14.number()
2484
+ })
2485
+ )
2486
+ })
2487
+ ).nullish()
2488
+ }),
2489
+ z14.object({
2490
+ type: z14.enum(["response.completed", "response.incomplete"]),
2491
+ response: z14.object({
2492
+ incomplete_details: z14.object({ reason: z14.string() }).nullish(),
2493
+ usage: z14.object({
2494
+ input_tokens: z14.number(),
2495
+ input_tokens_details: z14.object({ cached_tokens: z14.number().nullish() }).nullish(),
2496
+ output_tokens: z14.number(),
2497
+ output_tokens_details: z14.object({ reasoning_tokens: z14.number().nullish() }).nullish()
2498
+ }),
2499
+ service_tier: z14.string().nullish()
2500
+ })
2501
+ }),
2502
+ z14.object({
2503
+ type: z14.literal("response.created"),
2504
+ response: z14.object({
2505
+ id: z14.string(),
2506
+ created_at: z14.number(),
2507
+ model: z14.string(),
2508
+ service_tier: z14.string().nullish()
2509
+ })
2510
+ }),
2511
+ z14.object({
2512
+ type: z14.literal("response.output_item.added"),
2513
+ output_index: z14.number(),
2514
+ item: z14.discriminatedUnion("type", [
2515
+ z14.object({
2516
+ type: z14.literal("message"),
2517
+ id: z14.string()
2518
+ }),
2519
+ z14.object({
2520
+ type: z14.literal("reasoning"),
2521
+ id: z14.string(),
2522
+ encrypted_content: z14.string().nullish()
2523
+ }),
2524
+ z14.object({
2525
+ type: z14.literal("function_call"),
2526
+ id: z14.string(),
2527
+ call_id: z14.string(),
2528
+ name: z14.string(),
2529
+ arguments: z14.string()
2530
+ }),
2531
+ z14.object({
2532
+ type: z14.literal("web_search_call"),
2533
+ id: z14.string(),
2534
+ status: z14.string(),
2535
+ action: z14.object({
2536
+ type: z14.literal("search"),
2537
+ query: z14.string().optional()
2538
+ }).nullish()
2539
+ }),
2540
+ z14.object({
2541
+ type: z14.literal("computer_call"),
2542
+ id: z14.string(),
2543
+ status: z14.string()
2544
+ }),
2545
+ z14.object({
2546
+ type: z14.literal("file_search_call"),
2547
+ id: z14.string()
2548
+ }),
2549
+ z14.object({
2550
+ type: z14.literal("image_generation_call"),
2551
+ id: z14.string()
2552
+ }),
2553
+ z14.object({
2554
+ type: z14.literal("code_interpreter_call"),
2555
+ id: z14.string(),
2556
+ container_id: z14.string(),
2557
+ code: z14.string().nullable(),
2558
+ outputs: z14.array(
2559
+ z14.discriminatedUnion("type", [
2560
+ z14.object({ type: z14.literal("logs"), logs: z14.string() }),
2561
+ z14.object({ type: z14.literal("image"), url: z14.string() })
2562
+ ])
2563
+ ).nullable(),
2564
+ status: z14.string()
2565
+ })
2566
+ ])
2567
+ }),
2568
+ z14.object({
2569
+ type: z14.literal("response.output_item.done"),
2570
+ output_index: z14.number(),
2571
+ item: z14.discriminatedUnion("type", [
2572
+ z14.object({
2573
+ type: z14.literal("message"),
2574
+ id: z14.string()
2575
+ }),
2576
+ z14.object({
2577
+ type: z14.literal("reasoning"),
2578
+ id: z14.string(),
2579
+ encrypted_content: z14.string().nullish()
2580
+ }),
2581
+ z14.object({
2582
+ type: z14.literal("function_call"),
2583
+ id: z14.string(),
2584
+ call_id: z14.string(),
2585
+ name: z14.string(),
2586
+ arguments: z14.string(),
2587
+ status: z14.literal("completed")
2588
+ }),
2589
+ z14.object({
2590
+ type: z14.literal("code_interpreter_call"),
2591
+ id: z14.string(),
2592
+ code: z14.string().nullable(),
2593
+ container_id: z14.string(),
2594
+ outputs: z14.array(
2595
+ z14.discriminatedUnion("type", [
2596
+ z14.object({ type: z14.literal("logs"), logs: z14.string() }),
2597
+ z14.object({ type: z14.literal("image"), url: z14.string() })
2598
+ ])
2599
+ ).nullable()
2600
+ }),
2601
+ z14.object({
2602
+ type: z14.literal("image_generation_call"),
2603
+ id: z14.string(),
2604
+ result: z14.string()
2605
+ }),
2606
+ z14.object({
2607
+ type: z14.literal("web_search_call"),
2608
+ id: z14.string(),
2609
+ status: z14.string(),
2610
+ action: z14.discriminatedUnion("type", [
2611
+ z14.object({
2612
+ type: z14.literal("search"),
2613
+ query: z14.string().nullish()
2614
+ }),
2615
+ z14.object({
2616
+ type: z14.literal("open_page"),
2617
+ url: z14.string()
2618
+ }),
2619
+ z14.object({
2620
+ type: z14.literal("find"),
2621
+ url: z14.string(),
2622
+ pattern: z14.string()
2623
+ })
2624
+ ]).nullish()
2625
+ }),
2626
+ z14.object({
2627
+ type: z14.literal("file_search_call"),
2628
+ id: z14.string(),
2629
+ queries: z14.array(z14.string()),
2630
+ results: z14.array(
2631
+ z14.object({
2632
+ attributes: z14.record(z14.string(), z14.unknown()),
2633
+ file_id: z14.string(),
2634
+ filename: z14.string(),
2635
+ score: z14.number(),
2636
+ text: z14.string()
2637
+ })
2638
+ ).nullish()
2639
+ }),
2640
+ z14.object({
2641
+ type: z14.literal("local_shell_call"),
2642
+ id: z14.string(),
2643
+ call_id: z14.string(),
2644
+ action: z14.object({
2645
+ type: z14.literal("exec"),
2646
+ command: z14.array(z14.string()),
2647
+ timeout_ms: z14.number().optional(),
2648
+ user: z14.string().optional(),
2649
+ working_directory: z14.string().optional(),
2650
+ env: z14.record(z14.string(), z14.string()).optional()
2651
+ })
2652
+ }),
2653
+ z14.object({
2654
+ type: z14.literal("computer_call"),
2655
+ id: z14.string(),
2656
+ status: z14.literal("completed")
2657
+ })
2658
+ ])
2659
+ }),
2660
+ z14.object({
2661
+ type: z14.literal("response.function_call_arguments.delta"),
2662
+ item_id: z14.string(),
2663
+ output_index: z14.number(),
2664
+ delta: z14.string()
2665
+ }),
2666
+ z14.object({
2667
+ type: z14.literal("response.image_generation_call.partial_image"),
2668
+ item_id: z14.string(),
2669
+ output_index: z14.number(),
2670
+ partial_image_b64: z14.string()
2671
+ }),
2672
+ z14.object({
2673
+ type: z14.literal("response.code_interpreter_call_code.delta"),
2674
+ item_id: z14.string(),
2675
+ output_index: z14.number(),
2676
+ delta: z14.string()
2677
+ }),
2678
+ z14.object({
2679
+ type: z14.literal("response.code_interpreter_call_code.done"),
2680
+ item_id: z14.string(),
2681
+ output_index: z14.number(),
2682
+ code: z14.string()
2683
+ }),
2684
+ z14.object({
2685
+ type: z14.literal("response.output_text.annotation.added"),
2686
+ annotation: z14.discriminatedUnion("type", [
2687
+ z14.object({
2688
+ type: z14.literal("url_citation"),
2689
+ url: z14.string(),
2690
+ title: z14.string()
2691
+ }),
2692
+ z14.object({
2693
+ type: z14.literal("file_citation"),
2694
+ file_id: z14.string(),
2695
+ filename: z14.string().nullish(),
2696
+ index: z14.number().nullish(),
2697
+ start_index: z14.number().nullish(),
2698
+ end_index: z14.number().nullish(),
2699
+ quote: z14.string().nullish()
2700
+ })
2701
+ ])
2702
+ }),
2703
+ z14.object({
2704
+ type: z14.literal("response.reasoning_summary_part.added"),
2705
+ item_id: z14.string(),
2706
+ summary_index: z14.number()
2707
+ }),
2708
+ z14.object({
2709
+ type: z14.literal("response.reasoning_summary_text.delta"),
2710
+ item_id: z14.string(),
2711
+ summary_index: z14.number(),
2712
+ delta: z14.string()
2713
+ }),
2714
+ z14.object({
2715
+ type: z14.literal("error"),
2716
+ code: z14.string(),
2717
+ message: z14.string(),
2718
+ param: z14.string().nullish(),
2719
+ sequence_number: z14.number()
2720
+ }),
2721
+ z14.object({ type: z14.string() }).loose().transform((value) => ({
2722
+ type: "unknown_chunk",
2723
+ message: value.type
2724
+ }))
2725
+ // fallback for unknown chunks
2726
+ ])
2727
+ )
2728
+ );
2729
+ var openaiResponsesResponseSchema = lazyValidator11(
2730
+ () => zodSchema12(
2731
+ z14.object({
2732
+ id: z14.string(),
2733
+ created_at: z14.number(),
2734
+ error: z14.object({
2735
+ code: z14.string(),
2736
+ message: z14.string()
2737
+ }).nullish(),
2738
+ model: z14.string(),
2739
+ output: z14.array(
2740
+ z14.discriminatedUnion("type", [
2741
+ z14.object({
2742
+ type: z14.literal("message"),
2743
+ role: z14.literal("assistant"),
2744
+ id: z14.string(),
2745
+ content: z14.array(
2746
+ z14.object({
2747
+ type: z14.literal("output_text"),
2748
+ text: z14.string(),
2749
+ logprobs: z14.array(
2750
+ z14.object({
2751
+ token: z14.string(),
2752
+ logprob: z14.number(),
2753
+ top_logprobs: z14.array(
2754
+ z14.object({
2755
+ token: z14.string(),
2756
+ logprob: z14.number()
2757
+ })
2758
+ )
2759
+ })
2760
+ ).nullish(),
2761
+ annotations: z14.array(
2762
+ z14.discriminatedUnion("type", [
2763
+ z14.object({
2764
+ type: z14.literal("url_citation"),
2765
+ start_index: z14.number(),
2766
+ end_index: z14.number(),
2767
+ url: z14.string(),
2768
+ title: z14.string()
2769
+ }),
2770
+ z14.object({
2771
+ type: z14.literal("file_citation"),
2772
+ file_id: z14.string(),
2773
+ filename: z14.string().nullish(),
2774
+ index: z14.number().nullish(),
2775
+ start_index: z14.number().nullish(),
2776
+ end_index: z14.number().nullish(),
2777
+ quote: z14.string().nullish()
2778
+ }),
2779
+ z14.object({
2780
+ type: z14.literal("container_file_citation")
2781
+ })
2782
+ ])
2783
+ )
2784
+ })
2785
+ )
2786
+ }),
2787
+ z14.object({
2788
+ type: z14.literal("web_search_call"),
2789
+ id: z14.string(),
2790
+ status: z14.string(),
2791
+ action: z14.discriminatedUnion("type", [
2792
+ z14.object({
2793
+ type: z14.literal("search"),
2794
+ query: z14.string().nullish()
2795
+ }),
2796
+ z14.object({
2797
+ type: z14.literal("open_page"),
2798
+ url: z14.string()
2799
+ }),
2800
+ z14.object({
2801
+ type: z14.literal("find"),
2802
+ url: z14.string(),
2803
+ pattern: z14.string()
2804
+ })
2805
+ ]).nullish()
2806
+ }),
2807
+ z14.object({
2808
+ type: z14.literal("file_search_call"),
2809
+ id: z14.string(),
2810
+ queries: z14.array(z14.string()),
2811
+ results: z14.array(
2812
+ z14.object({
2813
+ attributes: z14.record(z14.string(), z14.unknown()),
2814
+ file_id: z14.string(),
2815
+ filename: z14.string(),
2816
+ score: z14.number(),
2817
+ text: z14.string()
2818
+ })
2819
+ ).nullish()
2820
+ }),
2821
+ z14.object({
2822
+ type: z14.literal("code_interpreter_call"),
2823
+ id: z14.string(),
2824
+ code: z14.string().nullable(),
2825
+ container_id: z14.string(),
2826
+ outputs: z14.array(
2827
+ z14.discriminatedUnion("type", [
2828
+ z14.object({ type: z14.literal("logs"), logs: z14.string() }),
2829
+ z14.object({ type: z14.literal("image"), url: z14.string() })
2830
+ ])
2831
+ ).nullable()
2832
+ }),
2833
+ z14.object({
2834
+ type: z14.literal("image_generation_call"),
2835
+ id: z14.string(),
2836
+ result: z14.string()
2837
+ }),
2838
+ z14.object({
2839
+ type: z14.literal("local_shell_call"),
2840
+ id: z14.string(),
2841
+ call_id: z14.string(),
2842
+ action: z14.object({
2843
+ type: z14.literal("exec"),
2844
+ command: z14.array(z14.string()),
2845
+ timeout_ms: z14.number().optional(),
2846
+ user: z14.string().optional(),
2847
+ working_directory: z14.string().optional(),
2848
+ env: z14.record(z14.string(), z14.string()).optional()
2849
+ })
2850
+ }),
2851
+ z14.object({
2852
+ type: z14.literal("function_call"),
2853
+ call_id: z14.string(),
2854
+ name: z14.string(),
2855
+ arguments: z14.string(),
2856
+ id: z14.string()
2857
+ }),
2858
+ z14.object({
2859
+ type: z14.literal("computer_call"),
2860
+ id: z14.string(),
2861
+ status: z14.string().optional()
2862
+ }),
2863
+ z14.object({
2864
+ type: z14.literal("reasoning"),
2865
+ id: z14.string(),
2866
+ encrypted_content: z14.string().nullish(),
2867
+ summary: z14.array(
2868
+ z14.object({
2869
+ type: z14.literal("summary_text"),
2870
+ text: z14.string()
2871
+ })
2872
+ )
2873
+ })
2874
+ ])
2875
+ ),
2876
+ service_tier: z14.string().nullish(),
2877
+ incomplete_details: z14.object({ reason: z14.string() }).nullish(),
2878
+ usage: z14.object({
2879
+ input_tokens: z14.number(),
2880
+ input_tokens_details: z14.object({ cached_tokens: z14.number().nullish() }).nullish(),
2881
+ output_tokens: z14.number(),
2882
+ output_tokens_details: z14.object({ reasoning_tokens: z14.number().nullish() }).nullish()
2883
+ })
2884
+ })
2885
+ )
2886
+ );
2887
+
2888
+ // src/responses/openai-responses-options.ts
2889
+ import {
2890
+ lazyValidator as lazyValidator12,
2891
+ zodSchema as zodSchema13
2892
+ } from "@ai-sdk/provider-utils";
2893
+ import * as z15 from "zod/v4";
2894
+ var TOP_LOGPROBS_MAX = 20;
2895
+ var openaiResponsesReasoningModelIds = [
2896
+ "o1",
2897
+ "o1-2024-12-17",
2898
+ "o3-mini",
2899
+ "o3-mini-2025-01-31",
2900
+ "o3",
2901
+ "o3-2025-04-16",
2902
+ "o4-mini",
2903
+ "o4-mini-2025-04-16",
2904
+ "codex-mini-latest",
2905
+ "computer-use-preview",
2906
+ "gpt-5",
2907
+ "gpt-5-2025-08-07",
2908
+ "gpt-5-codex",
2909
+ "gpt-5-mini",
2910
+ "gpt-5-mini-2025-08-07",
2911
+ "gpt-5-nano",
2912
+ "gpt-5-nano-2025-08-07",
2913
+ "gpt-5-pro",
2914
+ "gpt-5-pro-2025-10-06"
2915
+ ];
2916
+ var openaiResponsesModelIds = [
2917
+ "gpt-4.1",
2918
+ "gpt-4.1-2025-04-14",
2919
+ "gpt-4.1-mini",
2920
+ "gpt-4.1-mini-2025-04-14",
2921
+ "gpt-4.1-nano",
2922
+ "gpt-4.1-nano-2025-04-14",
2923
+ "gpt-4o",
2924
+ "gpt-4o-2024-05-13",
2925
+ "gpt-4o-2024-08-06",
2926
+ "gpt-4o-2024-11-20",
2927
+ "gpt-4o-audio-preview",
2928
+ "gpt-4o-audio-preview-2024-10-01",
2929
+ "gpt-4o-audio-preview-2024-12-17",
2930
+ "gpt-4o-search-preview",
2931
+ "gpt-4o-search-preview-2025-03-11",
2932
+ "gpt-4o-mini-search-preview",
2933
+ "gpt-4o-mini-search-preview-2025-03-11",
2934
+ "gpt-4o-mini",
2935
+ "gpt-4o-mini-2024-07-18",
2936
+ "gpt-4-turbo",
2937
+ "gpt-4-turbo-2024-04-09",
2938
+ "gpt-4-turbo-preview",
2939
+ "gpt-4-0125-preview",
2940
+ "gpt-4-1106-preview",
2941
+ "gpt-4",
2942
+ "gpt-4-0613",
2943
+ "gpt-4.5-preview",
2944
+ "gpt-4.5-preview-2025-02-27",
2945
+ "gpt-3.5-turbo-0125",
2946
+ "gpt-3.5-turbo",
2947
+ "gpt-3.5-turbo-1106",
2948
+ "chatgpt-4o-latest",
2949
+ "gpt-5-chat-latest",
2950
+ ...openaiResponsesReasoningModelIds
2951
+ ];
2952
+ var openaiResponsesProviderOptionsSchema = lazyValidator12(
2953
+ () => zodSchema13(
2954
+ z15.object({
2955
+ include: z15.array(
2956
+ z15.enum([
2957
+ "reasoning.encrypted_content",
2958
+ "file_search_call.results",
2959
+ "message.output_text.logprobs"
2960
+ ])
2961
+ ).nullish(),
2962
+ instructions: z15.string().nullish(),
2963
+ /**
2964
+ * Return the log probabilities of the tokens.
2965
+ *
2966
+ * Setting to true will return the log probabilities of the tokens that
2967
+ * were generated.
2968
+ *
2969
+ * Setting to a number will return the log probabilities of the top n
2970
+ * tokens that were generated.
2971
+ *
2972
+ * @see https://platform.openai.com/docs/api-reference/responses/create
2973
+ * @see https://cookbook.openai.com/examples/using_logprobs
2974
+ */
2975
+ logprobs: z15.union([z15.boolean(), z15.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
2976
+ /**
2977
+ * The maximum number of total calls to built-in tools that can be processed in a response.
2978
+ * This maximum number applies across all built-in tool calls, not per individual tool.
2979
+ * Any further attempts to call a tool by the model will be ignored.
2980
+ */
2981
+ maxToolCalls: z15.number().nullish(),
2982
+ metadata: z15.any().nullish(),
2983
+ parallelToolCalls: z15.boolean().nullish(),
2984
+ previousResponseId: z15.string().nullish(),
2985
+ promptCacheKey: z15.string().nullish(),
2986
+ reasoningEffort: z15.string().nullish(),
2987
+ reasoningSummary: z15.string().nullish(),
2988
+ safetyIdentifier: z15.string().nullish(),
2989
+ serviceTier: z15.enum(["auto", "flex", "priority"]).nullish(),
2990
+ store: z15.boolean().nullish(),
2991
+ strictJsonSchema: z15.boolean().nullish(),
2992
+ textVerbosity: z15.enum(["low", "medium", "high"]).nullish(),
2993
+ user: z15.string().nullish()
2994
+ })
2995
+ )
2996
+ );
2997
+
2335
2998
  // src/responses/openai-responses-prepare-tools.ts
2336
2999
  import {
2337
3000
  UnsupportedFunctionalityError as UnsupportedFunctionalityError5
2338
3001
  } from "@ai-sdk/provider";
2339
3002
 
2340
3003
  // src/tool/code-interpreter.ts
2341
- import { createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema2 } from "@ai-sdk/provider-utils";
2342
- import { z as z14 } from "zod/v4";
2343
- var codeInterpreterInputSchema = z14.object({
2344
- code: z14.string().nullish(),
2345
- containerId: z14.string()
2346
- });
2347
- var codeInterpreterOutputSchema = z14.object({
2348
- outputs: z14.array(
2349
- z14.discriminatedUnion("type", [
2350
- z14.object({ type: z14.literal("logs"), logs: z14.string() }),
2351
- z14.object({ type: z14.literal("image"), url: z14.string() })
2352
- ])
2353
- ).nullish()
2354
- });
2355
- var codeInterpreterArgsSchema = z14.object({
2356
- container: z14.union([
2357
- z14.string(),
2358
- z14.object({
2359
- fileIds: z14.array(z14.string()).optional()
3004
+ import {
3005
+ createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema2,
3006
+ lazySchema as lazySchema2,
3007
+ zodSchema as zodSchema14
3008
+ } from "@ai-sdk/provider-utils";
3009
+ import * as z16 from "zod/v4";
3010
+ var codeInterpreterInputSchema = lazySchema2(
3011
+ () => zodSchema14(
3012
+ z16.object({
3013
+ code: z16.string().nullish(),
3014
+ containerId: z16.string()
2360
3015
  })
2361
- ]).optional()
2362
- });
3016
+ )
3017
+ );
3018
+ var codeInterpreterOutputSchema = lazySchema2(
3019
+ () => zodSchema14(
3020
+ z16.object({
3021
+ outputs: z16.array(
3022
+ z16.discriminatedUnion("type", [
3023
+ z16.object({ type: z16.literal("logs"), logs: z16.string() }),
3024
+ z16.object({ type: z16.literal("image"), url: z16.string() })
3025
+ ])
3026
+ ).nullish()
3027
+ })
3028
+ )
3029
+ );
3030
+ var codeInterpreterArgsSchema = lazySchema2(
3031
+ () => zodSchema14(
3032
+ z16.object({
3033
+ container: z16.union([
3034
+ z16.string(),
3035
+ z16.object({
3036
+ fileIds: z16.array(z16.string()).optional()
3037
+ })
3038
+ ]).optional()
3039
+ })
3040
+ )
3041
+ );
2363
3042
  var codeInterpreterToolFactory = createProviderDefinedToolFactoryWithOutputSchema2({
2364
3043
  id: "openai.code_interpreter",
2365
3044
  name: "code_interpreter",
@@ -2371,168 +3050,216 @@ var codeInterpreter = (args = {}) => {
2371
3050
  };
2372
3051
 
2373
3052
  // src/tool/file-search.ts
2374
- import { createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema3 } from "@ai-sdk/provider-utils";
2375
- import { z as z15 } from "zod/v4";
2376
- var comparisonFilterSchema = z15.object({
2377
- key: z15.string(),
2378
- type: z15.enum(["eq", "ne", "gt", "gte", "lt", "lte"]),
2379
- value: z15.union([z15.string(), z15.number(), z15.boolean()])
3053
+ import {
3054
+ createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema3,
3055
+ lazySchema as lazySchema3,
3056
+ zodSchema as zodSchema15
3057
+ } from "@ai-sdk/provider-utils";
3058
+ import * as z17 from "zod/v4";
3059
+ var comparisonFilterSchema = z17.object({
3060
+ key: z17.string(),
3061
+ type: z17.enum(["eq", "ne", "gt", "gte", "lt", "lte"]),
3062
+ value: z17.union([z17.string(), z17.number(), z17.boolean()])
2380
3063
  });
2381
- var compoundFilterSchema = z15.object({
2382
- type: z15.enum(["and", "or"]),
2383
- filters: z15.array(
2384
- z15.union([comparisonFilterSchema, z15.lazy(() => compoundFilterSchema)])
3064
+ var compoundFilterSchema = z17.object({
3065
+ type: z17.enum(["and", "or"]),
3066
+ filters: z17.array(
3067
+ z17.union([comparisonFilterSchema, z17.lazy(() => compoundFilterSchema)])
2385
3068
  )
2386
3069
  });
2387
- var fileSearchArgsSchema = z15.object({
2388
- vectorStoreIds: z15.array(z15.string()),
2389
- maxNumResults: z15.number().optional(),
2390
- ranking: z15.object({
2391
- ranker: z15.string().optional(),
2392
- scoreThreshold: z15.number().optional()
2393
- }).optional(),
2394
- filters: z15.union([comparisonFilterSchema, compoundFilterSchema]).optional()
2395
- });
2396
- var fileSearchOutputSchema = z15.object({
2397
- queries: z15.array(z15.string()),
2398
- results: z15.array(
2399
- z15.object({
2400
- attributes: z15.record(z15.string(), z15.unknown()),
2401
- fileId: z15.string(),
2402
- filename: z15.string(),
2403
- score: z15.number(),
2404
- text: z15.string()
3070
+ var fileSearchArgsSchema = lazySchema3(
3071
+ () => zodSchema15(
3072
+ z17.object({
3073
+ vectorStoreIds: z17.array(z17.string()),
3074
+ maxNumResults: z17.number().optional(),
3075
+ ranking: z17.object({
3076
+ ranker: z17.string().optional(),
3077
+ scoreThreshold: z17.number().optional()
3078
+ }).optional(),
3079
+ filters: z17.union([comparisonFilterSchema, compoundFilterSchema]).optional()
2405
3080
  })
2406
- ).nullable()
2407
- });
3081
+ )
3082
+ );
3083
+ var fileSearchOutputSchema = lazySchema3(
3084
+ () => zodSchema15(
3085
+ z17.object({
3086
+ queries: z17.array(z17.string()),
3087
+ results: z17.array(
3088
+ z17.object({
3089
+ attributes: z17.record(z17.string(), z17.unknown()),
3090
+ fileId: z17.string(),
3091
+ filename: z17.string(),
3092
+ score: z17.number(),
3093
+ text: z17.string()
3094
+ })
3095
+ ).nullable()
3096
+ })
3097
+ )
3098
+ );
2408
3099
  var fileSearch = createProviderDefinedToolFactoryWithOutputSchema3({
2409
3100
  id: "openai.file_search",
2410
3101
  name: "file_search",
2411
- inputSchema: z15.object({}),
3102
+ inputSchema: z17.object({}),
2412
3103
  outputSchema: fileSearchOutputSchema
2413
3104
  });
2414
3105
 
2415
3106
  // src/tool/web-search.ts
2416
- import { createProviderDefinedToolFactory } from "@ai-sdk/provider-utils";
2417
- import { z as z16 } from "zod/v4";
2418
- var webSearchArgsSchema = z16.object({
2419
- filters: z16.object({
2420
- allowedDomains: z16.array(z16.string()).optional()
2421
- }).optional(),
2422
- searchContextSize: z16.enum(["low", "medium", "high"]).optional(),
2423
- userLocation: z16.object({
2424
- type: z16.literal("approximate"),
2425
- country: z16.string().optional(),
2426
- city: z16.string().optional(),
2427
- region: z16.string().optional(),
2428
- timezone: z16.string().optional()
2429
- }).optional()
2430
- });
3107
+ import {
3108
+ createProviderDefinedToolFactory,
3109
+ lazySchema as lazySchema4,
3110
+ zodSchema as zodSchema16
3111
+ } from "@ai-sdk/provider-utils";
3112
+ import * as z18 from "zod/v4";
3113
+ var webSearchArgsSchema = lazySchema4(
3114
+ () => zodSchema16(
3115
+ z18.object({
3116
+ filters: z18.object({
3117
+ allowedDomains: z18.array(z18.string()).optional()
3118
+ }).optional(),
3119
+ searchContextSize: z18.enum(["low", "medium", "high"]).optional(),
3120
+ userLocation: z18.object({
3121
+ type: z18.literal("approximate"),
3122
+ country: z18.string().optional(),
3123
+ city: z18.string().optional(),
3124
+ region: z18.string().optional(),
3125
+ timezone: z18.string().optional()
3126
+ }).optional()
3127
+ })
3128
+ )
3129
+ );
3130
+ var webSearchInputSchema = lazySchema4(
3131
+ () => zodSchema16(
3132
+ z18.object({
3133
+ action: z18.discriminatedUnion("type", [
3134
+ z18.object({
3135
+ type: z18.literal("search"),
3136
+ query: z18.string().nullish()
3137
+ }),
3138
+ z18.object({
3139
+ type: z18.literal("open_page"),
3140
+ url: z18.string()
3141
+ }),
3142
+ z18.object({
3143
+ type: z18.literal("find"),
3144
+ url: z18.string(),
3145
+ pattern: z18.string()
3146
+ })
3147
+ ]).nullish()
3148
+ })
3149
+ )
3150
+ );
2431
3151
  var webSearchToolFactory = createProviderDefinedToolFactory({
2432
3152
  id: "openai.web_search",
2433
3153
  name: "web_search",
2434
- inputSchema: z16.object({
2435
- action: z16.discriminatedUnion("type", [
2436
- z16.object({
2437
- type: z16.literal("search"),
2438
- query: z16.string().nullish()
2439
- }),
2440
- z16.object({
2441
- type: z16.literal("open_page"),
2442
- url: z16.string()
2443
- }),
2444
- z16.object({
2445
- type: z16.literal("find"),
2446
- url: z16.string(),
2447
- pattern: z16.string()
2448
- })
2449
- ]).nullish()
2450
- })
3154
+ inputSchema: webSearchInputSchema
2451
3155
  });
2452
3156
 
2453
3157
  // src/tool/web-search-preview.ts
2454
- import { createProviderDefinedToolFactory as createProviderDefinedToolFactory2 } from "@ai-sdk/provider-utils";
2455
- import { z as z17 } from "zod/v4";
2456
- var webSearchPreviewArgsSchema = z17.object({
2457
- /**
2458
- * Search context size to use for the web search.
2459
- * - high: Most comprehensive context, highest cost, slower response
2460
- * - medium: Balanced context, cost, and latency (default)
2461
- * - low: Least context, lowest cost, fastest response
2462
- */
2463
- searchContextSize: z17.enum(["low", "medium", "high"]).optional(),
2464
- /**
2465
- * User location information to provide geographically relevant search results.
2466
- */
2467
- userLocation: z17.object({
2468
- /**
2469
- * Type of location (always 'approximate')
2470
- */
2471
- type: z17.literal("approximate"),
2472
- /**
2473
- * Two-letter ISO country code (e.g., 'US', 'GB')
2474
- */
2475
- country: z17.string().optional(),
2476
- /**
2477
- * City name (free text, e.g., 'Minneapolis')
2478
- */
2479
- city: z17.string().optional(),
2480
- /**
2481
- * Region name (free text, e.g., 'Minnesota')
2482
- */
2483
- region: z17.string().optional(),
2484
- /**
2485
- * IANA timezone (e.g., 'America/Chicago')
2486
- */
2487
- timezone: z17.string().optional()
2488
- }).optional()
2489
- });
3158
+ import {
3159
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory2,
3160
+ lazySchema as lazySchema5,
3161
+ zodSchema as zodSchema17
3162
+ } from "@ai-sdk/provider-utils";
3163
+ import * as z19 from "zod/v4";
3164
+ var webSearchPreviewArgsSchema = lazySchema5(
3165
+ () => zodSchema17(
3166
+ z19.object({
3167
+ /**
3168
+ * Search context size to use for the web search.
3169
+ * - high: Most comprehensive context, highest cost, slower response
3170
+ * - medium: Balanced context, cost, and latency (default)
3171
+ * - low: Least context, lowest cost, fastest response
3172
+ */
3173
+ searchContextSize: z19.enum(["low", "medium", "high"]).optional(),
3174
+ /**
3175
+ * User location information to provide geographically relevant search results.
3176
+ */
3177
+ userLocation: z19.object({
3178
+ /**
3179
+ * Type of location (always 'approximate')
3180
+ */
3181
+ type: z19.literal("approximate"),
3182
+ /**
3183
+ * Two-letter ISO country code (e.g., 'US', 'GB')
3184
+ */
3185
+ country: z19.string().optional(),
3186
+ /**
3187
+ * City name (free text, e.g., 'Minneapolis')
3188
+ */
3189
+ city: z19.string().optional(),
3190
+ /**
3191
+ * Region name (free text, e.g., 'Minnesota')
3192
+ */
3193
+ region: z19.string().optional(),
3194
+ /**
3195
+ * IANA timezone (e.g., 'America/Chicago')
3196
+ */
3197
+ timezone: z19.string().optional()
3198
+ }).optional()
3199
+ })
3200
+ )
3201
+ );
3202
+ var webSearchPreviewInputSchema = lazySchema5(
3203
+ () => zodSchema17(
3204
+ z19.object({
3205
+ action: z19.discriminatedUnion("type", [
3206
+ z19.object({
3207
+ type: z19.literal("search"),
3208
+ query: z19.string().nullish()
3209
+ }),
3210
+ z19.object({
3211
+ type: z19.literal("open_page"),
3212
+ url: z19.string()
3213
+ }),
3214
+ z19.object({
3215
+ type: z19.literal("find"),
3216
+ url: z19.string(),
3217
+ pattern: z19.string()
3218
+ })
3219
+ ]).nullish()
3220
+ })
3221
+ )
3222
+ );
2490
3223
  var webSearchPreview = createProviderDefinedToolFactory2({
2491
3224
  id: "openai.web_search_preview",
2492
3225
  name: "web_search_preview",
2493
- inputSchema: z17.object({
2494
- action: z17.discriminatedUnion("type", [
2495
- z17.object({
2496
- type: z17.literal("search"),
2497
- query: z17.string().nullish()
2498
- }),
2499
- z17.object({
2500
- type: z17.literal("open_page"),
2501
- url: z17.string()
2502
- }),
2503
- z17.object({
2504
- type: z17.literal("find"),
2505
- url: z17.string(),
2506
- pattern: z17.string()
2507
- })
2508
- ]).nullish()
2509
- })
3226
+ inputSchema: webSearchPreviewInputSchema
2510
3227
  });
2511
3228
 
2512
3229
  // src/tool/image-generation.ts
2513
- import { createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema4 } from "@ai-sdk/provider-utils";
2514
- import { z as z18 } from "zod/v4";
2515
- var imageGenerationArgsSchema = z18.object({
2516
- background: z18.enum(["auto", "opaque", "transparent"]).optional(),
2517
- inputFidelity: z18.enum(["low", "high"]).optional(),
2518
- inputImageMask: z18.object({
2519
- fileId: z18.string().optional(),
2520
- imageUrl: z18.string().optional()
2521
- }).optional(),
2522
- model: z18.string().optional(),
2523
- moderation: z18.enum(["auto"]).optional(),
2524
- outputCompression: z18.number().int().min(0).max(100).optional(),
2525
- outputFormat: z18.enum(["png", "jpeg", "webp"]).optional(),
2526
- quality: z18.enum(["auto", "low", "medium", "high"]).optional(),
2527
- size: z18.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
2528
- }).strict();
2529
- var imageGenerationOutputSchema = z18.object({
2530
- result: z18.string()
2531
- });
3230
+ import {
3231
+ createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema4,
3232
+ lazySchema as lazySchema6,
3233
+ zodSchema as zodSchema18
3234
+ } from "@ai-sdk/provider-utils";
3235
+ import * as z20 from "zod/v4";
3236
+ var imageGenerationArgsSchema = lazySchema6(
3237
+ () => zodSchema18(
3238
+ z20.object({
3239
+ background: z20.enum(["auto", "opaque", "transparent"]).optional(),
3240
+ inputFidelity: z20.enum(["low", "high"]).optional(),
3241
+ inputImageMask: z20.object({
3242
+ fileId: z20.string().optional(),
3243
+ imageUrl: z20.string().optional()
3244
+ }).optional(),
3245
+ model: z20.string().optional(),
3246
+ moderation: z20.enum(["auto"]).optional(),
3247
+ outputCompression: z20.number().int().min(0).max(100).optional(),
3248
+ outputFormat: z20.enum(["png", "jpeg", "webp"]).optional(),
3249
+ partialImages: z20.number().int().min(0).max(3).optional(),
3250
+ quality: z20.enum(["auto", "low", "medium", "high"]).optional(),
3251
+ size: z20.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
3252
+ }).strict()
3253
+ )
3254
+ );
3255
+ var imageGenerationInputSchema = lazySchema6(() => zodSchema18(z20.object({})));
3256
+ var imageGenerationOutputSchema = lazySchema6(
3257
+ () => zodSchema18(z20.object({ result: z20.string() }))
3258
+ );
2532
3259
  var imageGenerationToolFactory = createProviderDefinedToolFactoryWithOutputSchema4({
2533
3260
  id: "openai.image_generation",
2534
3261
  name: "image_generation",
2535
- inputSchema: z18.object({}),
3262
+ inputSchema: imageGenerationInputSchema,
2536
3263
  outputSchema: imageGenerationOutputSchema
2537
3264
  });
2538
3265
  var imageGeneration = (args = {}) => {
@@ -2540,7 +3267,8 @@ var imageGeneration = (args = {}) => {
2540
3267
  };
2541
3268
 
2542
3269
  // src/responses/openai-responses-prepare-tools.ts
2543
- function prepareResponsesTools({
3270
+ import { validateTypes as validateTypes2 } from "@ai-sdk/provider-utils";
3271
+ async function prepareResponsesTools({
2544
3272
  tools,
2545
3273
  toolChoice,
2546
3274
  strictJsonSchema
@@ -2565,7 +3293,10 @@ function prepareResponsesTools({
2565
3293
  case "provider-defined": {
2566
3294
  switch (tool.id) {
2567
3295
  case "openai.file_search": {
2568
- const args = fileSearchArgsSchema.parse(tool.args);
3296
+ const args = await validateTypes2({
3297
+ value: tool.args,
3298
+ schema: fileSearchArgsSchema
3299
+ });
2569
3300
  openaiTools.push({
2570
3301
  type: "file_search",
2571
3302
  vector_store_ids: args.vectorStoreIds,
@@ -2585,7 +3316,10 @@ function prepareResponsesTools({
2585
3316
  break;
2586
3317
  }
2587
3318
  case "openai.web_search_preview": {
2588
- const args = webSearchPreviewArgsSchema.parse(tool.args);
3319
+ const args = await validateTypes2({
3320
+ value: tool.args,
3321
+ schema: webSearchPreviewArgsSchema
3322
+ });
2589
3323
  openaiTools.push({
2590
3324
  type: "web_search_preview",
2591
3325
  search_context_size: args.searchContextSize,
@@ -2594,7 +3328,10 @@ function prepareResponsesTools({
2594
3328
  break;
2595
3329
  }
2596
3330
  case "openai.web_search": {
2597
- const args = webSearchArgsSchema.parse(tool.args);
3331
+ const args = await validateTypes2({
3332
+ value: tool.args,
3333
+ schema: webSearchArgsSchema
3334
+ });
2598
3335
  openaiTools.push({
2599
3336
  type: "web_search",
2600
3337
  filters: args.filters != null ? { allowed_domains: args.filters.allowedDomains } : void 0,
@@ -2604,7 +3341,10 @@ function prepareResponsesTools({
2604
3341
  break;
2605
3342
  }
2606
3343
  case "openai.code_interpreter": {
2607
- const args = codeInterpreterArgsSchema.parse(tool.args);
3344
+ const args = await validateTypes2({
3345
+ value: tool.args,
3346
+ schema: codeInterpreterArgsSchema
3347
+ });
2608
3348
  openaiTools.push({
2609
3349
  type: "code_interpreter",
2610
3350
  container: args.container == null ? { type: "auto", file_ids: void 0 } : typeof args.container === "string" ? args.container : { type: "auto", file_ids: args.container.fileIds }
@@ -2612,7 +3352,10 @@ function prepareResponsesTools({
2612
3352
  break;
2613
3353
  }
2614
3354
  case "openai.image_generation": {
2615
- const args = imageGenerationArgsSchema.parse(tool.args);
3355
+ const args = await validateTypes2({
3356
+ value: tool.args,
3357
+ schema: imageGenerationArgsSchema
3358
+ });
2616
3359
  openaiTools.push({
2617
3360
  type: "image_generation",
2618
3361
  background: args.background,
@@ -2663,83 +3406,6 @@ function prepareResponsesTools({
2663
3406
  }
2664
3407
 
2665
3408
  // src/responses/openai-responses-language-model.ts
2666
- var webSearchCallItem = z19.object({
2667
- type: z19.literal("web_search_call"),
2668
- id: z19.string(),
2669
- status: z19.string(),
2670
- action: z19.discriminatedUnion("type", [
2671
- z19.object({
2672
- type: z19.literal("search"),
2673
- query: z19.string().nullish()
2674
- }),
2675
- z19.object({
2676
- type: z19.literal("open_page"),
2677
- url: z19.string()
2678
- }),
2679
- z19.object({
2680
- type: z19.literal("find"),
2681
- url: z19.string(),
2682
- pattern: z19.string()
2683
- })
2684
- ]).nullish()
2685
- });
2686
- var fileSearchCallItem = z19.object({
2687
- type: z19.literal("file_search_call"),
2688
- id: z19.string(),
2689
- queries: z19.array(z19.string()),
2690
- results: z19.array(
2691
- z19.object({
2692
- attributes: z19.record(z19.string(), z19.unknown()),
2693
- file_id: z19.string(),
2694
- filename: z19.string(),
2695
- score: z19.number(),
2696
- text: z19.string()
2697
- })
2698
- ).nullish()
2699
- });
2700
- var codeInterpreterCallItem = z19.object({
2701
- type: z19.literal("code_interpreter_call"),
2702
- id: z19.string(),
2703
- code: z19.string().nullable(),
2704
- container_id: z19.string(),
2705
- outputs: z19.array(
2706
- z19.discriminatedUnion("type", [
2707
- z19.object({ type: z19.literal("logs"), logs: z19.string() }),
2708
- z19.object({ type: z19.literal("image"), url: z19.string() })
2709
- ])
2710
- ).nullable()
2711
- });
2712
- var localShellCallItem = z19.object({
2713
- type: z19.literal("local_shell_call"),
2714
- id: z19.string(),
2715
- call_id: z19.string(),
2716
- action: z19.object({
2717
- type: z19.literal("exec"),
2718
- command: z19.array(z19.string()),
2719
- timeout_ms: z19.number().optional(),
2720
- user: z19.string().optional(),
2721
- working_directory: z19.string().optional(),
2722
- env: z19.record(z19.string(), z19.string()).optional()
2723
- })
2724
- });
2725
- var imageGenerationCallItem = z19.object({
2726
- type: z19.literal("image_generation_call"),
2727
- id: z19.string(),
2728
- result: z19.string()
2729
- });
2730
- var TOP_LOGPROBS_MAX = 20;
2731
- var LOGPROBS_SCHEMA = z19.array(
2732
- z19.object({
2733
- token: z19.string(),
2734
- logprob: z19.number(),
2735
- top_logprobs: z19.array(
2736
- z19.object({
2737
- token: z19.string(),
2738
- logprob: z19.number()
2739
- })
2740
- )
2741
- })
2742
- );
2743
3409
  var OpenAIResponsesLanguageModel = class {
2744
3410
  constructor(modelId, config) {
2745
3411
  this.specificationVersion = "v2";
@@ -2931,7 +3597,7 @@ var OpenAIResponsesLanguageModel = class {
2931
3597
  tools: openaiTools,
2932
3598
  toolChoice: openaiToolChoice,
2933
3599
  toolWarnings
2934
- } = prepareResponsesTools({
3600
+ } = await prepareResponsesTools({
2935
3601
  tools,
2936
3602
  toolChoice,
2937
3603
  strictJsonSchema
@@ -2967,85 +3633,7 @@ var OpenAIResponsesLanguageModel = class {
2967
3633
  body,
2968
3634
  failedResponseHandler: openaiFailedResponseHandler,
2969
3635
  successfulResponseHandler: createJsonResponseHandler6(
2970
- z19.object({
2971
- id: z19.string(),
2972
- created_at: z19.number(),
2973
- error: z19.object({
2974
- code: z19.string(),
2975
- message: z19.string()
2976
- }).nullish(),
2977
- model: z19.string(),
2978
- output: z19.array(
2979
- z19.discriminatedUnion("type", [
2980
- z19.object({
2981
- type: z19.literal("message"),
2982
- role: z19.literal("assistant"),
2983
- id: z19.string(),
2984
- content: z19.array(
2985
- z19.object({
2986
- type: z19.literal("output_text"),
2987
- text: z19.string(),
2988
- logprobs: LOGPROBS_SCHEMA.nullish(),
2989
- annotations: z19.array(
2990
- z19.discriminatedUnion("type", [
2991
- z19.object({
2992
- type: z19.literal("url_citation"),
2993
- start_index: z19.number(),
2994
- end_index: z19.number(),
2995
- url: z19.string(),
2996
- title: z19.string()
2997
- }),
2998
- z19.object({
2999
- type: z19.literal("file_citation"),
3000
- file_id: z19.string(),
3001
- filename: z19.string().nullish(),
3002
- index: z19.number().nullish(),
3003
- start_index: z19.number().nullish(),
3004
- end_index: z19.number().nullish(),
3005
- quote: z19.string().nullish()
3006
- }),
3007
- z19.object({
3008
- type: z19.literal("container_file_citation")
3009
- })
3010
- ])
3011
- )
3012
- })
3013
- )
3014
- }),
3015
- webSearchCallItem,
3016
- fileSearchCallItem,
3017
- codeInterpreterCallItem,
3018
- imageGenerationCallItem,
3019
- localShellCallItem,
3020
- z19.object({
3021
- type: z19.literal("function_call"),
3022
- call_id: z19.string(),
3023
- name: z19.string(),
3024
- arguments: z19.string(),
3025
- id: z19.string()
3026
- }),
3027
- z19.object({
3028
- type: z19.literal("computer_call"),
3029
- id: z19.string(),
3030
- status: z19.string().optional()
3031
- }),
3032
- z19.object({
3033
- type: z19.literal("reasoning"),
3034
- id: z19.string(),
3035
- encrypted_content: z19.string().nullish(),
3036
- summary: z19.array(
3037
- z19.object({
3038
- type: z19.literal("summary_text"),
3039
- text: z19.string()
3040
- })
3041
- )
3042
- })
3043
- ])
3044
- ),
3045
- service_tier: z19.string().nullish(),
3046
- incomplete_details: z19.object({ reason: z19.string() }).nullish(),
3047
- usage: usageSchema2
3048
- })
3636
+ openaiResponsesResponseSchema
3049
3637
  ),
3050
3638
  abortSignal: options.abortSignal,
3051
3639
  fetch: this.config.fetch
@@ -3108,7 +3696,9 @@ var OpenAIResponsesLanguageModel = class {
3108
3696
  type: "tool-call",
3109
3697
  toolCallId: part.call_id,
3110
3698
  toolName: "local_shell",
3111
- input: JSON.stringify({ action: part.action }),
3699
+ input: JSON.stringify({
3700
+ action: part.action
3701
+ }),
3112
3702
  providerMetadata: {
3113
3703
  openai: {
3114
3704
  itemId: part.id
@@ -3728,196 +4318,6 @@ var OpenAIResponsesLanguageModel = class {
3728
4318
  };
3729
4319
  }
3730
4320
  };
3731
- var usageSchema2 = z19.object({
3732
- input_tokens: z19.number(),
3733
- input_tokens_details: z19.object({ cached_tokens: z19.number().nullish() }).nullish(),
3734
- output_tokens: z19.number(),
3735
- output_tokens_details: z19.object({ reasoning_tokens: z19.number().nullish() }).nullish()
3736
- });
3737
- var textDeltaChunkSchema = z19.object({
3738
- type: z19.literal("response.output_text.delta"),
3739
- item_id: z19.string(),
3740
- delta: z19.string(),
3741
- logprobs: LOGPROBS_SCHEMA.nullish()
3742
- });
3743
- var errorChunkSchema = z19.object({
3744
- type: z19.literal("error"),
3745
- code: z19.string(),
3746
- message: z19.string(),
3747
- param: z19.string().nullish(),
3748
- sequence_number: z19.number()
3749
- });
3750
- var responseFinishedChunkSchema = z19.object({
3751
- type: z19.enum(["response.completed", "response.incomplete"]),
3752
- response: z19.object({
3753
- incomplete_details: z19.object({ reason: z19.string() }).nullish(),
3754
- usage: usageSchema2,
3755
- service_tier: z19.string().nullish()
3756
- })
3757
- });
3758
- var responseCreatedChunkSchema = z19.object({
3759
- type: z19.literal("response.created"),
3760
- response: z19.object({
3761
- id: z19.string(),
3762
- created_at: z19.number(),
3763
- model: z19.string(),
3764
- service_tier: z19.string().nullish()
3765
- })
3766
- });
3767
- var responseOutputItemAddedSchema = z19.object({
3768
- type: z19.literal("response.output_item.added"),
3769
- output_index: z19.number(),
3770
- item: z19.discriminatedUnion("type", [
3771
- z19.object({
3772
- type: z19.literal("message"),
3773
- id: z19.string()
3774
- }),
3775
- z19.object({
3776
- type: z19.literal("reasoning"),
3777
- id: z19.string(),
3778
- encrypted_content: z19.string().nullish()
3779
- }),
3780
- z19.object({
3781
- type: z19.literal("function_call"),
3782
- id: z19.string(),
3783
- call_id: z19.string(),
3784
- name: z19.string(),
3785
- arguments: z19.string()
3786
- }),
3787
- z19.object({
3788
- type: z19.literal("web_search_call"),
3789
- id: z19.string(),
3790
- status: z19.string(),
3791
- action: z19.object({
3792
- type: z19.literal("search"),
3793
- query: z19.string().optional()
3794
- }).nullish()
3795
- }),
3796
- z19.object({
3797
- type: z19.literal("computer_call"),
3798
- id: z19.string(),
3799
- status: z19.string()
3800
- }),
3801
- z19.object({
3802
- type: z19.literal("file_search_call"),
3803
- id: z19.string()
3804
- }),
3805
- z19.object({
3806
- type: z19.literal("image_generation_call"),
3807
- id: z19.string()
3808
- }),
3809
- z19.object({
3810
- type: z19.literal("code_interpreter_call"),
3811
- id: z19.string(),
3812
- container_id: z19.string(),
3813
- code: z19.string().nullable(),
3814
- outputs: z19.array(
3815
- z19.discriminatedUnion("type", [
3816
- z19.object({ type: z19.literal("logs"), logs: z19.string() }),
3817
- z19.object({ type: z19.literal("image"), url: z19.string() })
3818
- ])
3819
- ).nullable(),
3820
- status: z19.string()
3821
- })
3822
- ])
3823
- });
3824
- var responseOutputItemDoneSchema = z19.object({
3825
- type: z19.literal("response.output_item.done"),
3826
- output_index: z19.number(),
3827
- item: z19.discriminatedUnion("type", [
3828
- z19.object({
3829
- type: z19.literal("message"),
3830
- id: z19.string()
3831
- }),
3832
- z19.object({
3833
- type: z19.literal("reasoning"),
3834
- id: z19.string(),
3835
- encrypted_content: z19.string().nullish()
3836
- }),
3837
- z19.object({
3838
- type: z19.literal("function_call"),
3839
- id: z19.string(),
3840
- call_id: z19.string(),
3841
- name: z19.string(),
3842
- arguments: z19.string(),
3843
- status: z19.literal("completed")
3844
- }),
3845
- codeInterpreterCallItem,
3846
- imageGenerationCallItem,
3847
- webSearchCallItem,
3848
- fileSearchCallItem,
3849
- localShellCallItem,
3850
- z19.object({
3851
- type: z19.literal("computer_call"),
3852
- id: z19.string(),
3853
- status: z19.literal("completed")
3854
- })
3855
- ])
3856
- });
3857
- var responseFunctionCallArgumentsDeltaSchema = z19.object({
3858
- type: z19.literal("response.function_call_arguments.delta"),
3859
- item_id: z19.string(),
3860
- output_index: z19.number(),
3861
- delta: z19.string()
3862
- });
3863
- var responseCodeInterpreterCallCodeDeltaSchema = z19.object({
3864
- type: z19.literal("response.code_interpreter_call_code.delta"),
3865
- item_id: z19.string(),
3866
- output_index: z19.number(),
3867
- delta: z19.string()
3868
- });
3869
- var responseCodeInterpreterCallCodeDoneSchema = z19.object({
3870
- type: z19.literal("response.code_interpreter_call_code.done"),
3871
- item_id: z19.string(),
3872
- output_index: z19.number(),
3873
- code: z19.string()
3874
- });
3875
- var responseAnnotationAddedSchema = z19.object({
3876
- type: z19.literal("response.output_text.annotation.added"),
3877
- annotation: z19.discriminatedUnion("type", [
3878
- z19.object({
3879
- type: z19.literal("url_citation"),
3880
- url: z19.string(),
3881
- title: z19.string()
3882
- }),
3883
- z19.object({
3884
- type: z19.literal("file_citation"),
3885
- file_id: z19.string(),
3886
- filename: z19.string().nullish(),
3887
- index: z19.number().nullish(),
3888
- start_index: z19.number().nullish(),
3889
- end_index: z19.number().nullish(),
3890
- quote: z19.string().nullish()
3891
- })
3892
- ])
3893
- });
3894
- var responseReasoningSummaryPartAddedSchema = z19.object({
3895
- type: z19.literal("response.reasoning_summary_part.added"),
3896
- item_id: z19.string(),
3897
- summary_index: z19.number()
3898
- });
3899
- var responseReasoningSummaryTextDeltaSchema = z19.object({
3900
- type: z19.literal("response.reasoning_summary_text.delta"),
3901
- item_id: z19.string(),
3902
- summary_index: z19.number(),
3903
- delta: z19.string()
3904
- });
3905
- var openaiResponsesChunkSchema = z19.union([
3906
- textDeltaChunkSchema,
3907
- responseFinishedChunkSchema,
3908
- responseCreatedChunkSchema,
3909
- responseOutputItemAddedSchema,
3910
- responseOutputItemDoneSchema,
3911
- responseFunctionCallArgumentsDeltaSchema,
3912
- responseCodeInterpreterCallCodeDeltaSchema,
3913
- responseCodeInterpreterCallCodeDoneSchema,
3914
- responseAnnotationAddedSchema,
3915
- responseReasoningSummaryPartAddedSchema,
3916
- responseReasoningSummaryTextDeltaSchema,
3917
- errorChunkSchema,
3918
- z19.object({ type: z19.string() }).loose()
3919
- // fallback for unknown chunks
3920
- ]);
3921
4321
  function isTextDeltaChunk(chunk) {
3922
4322
  return chunk.type === "response.output_text.delta";
3923
4323
  }
@@ -3994,47 +4394,6 @@ function getResponsesModelConfig(modelId) {
3994
4394
  isReasoningModel: false
3995
4395
  };
3996
4396
  }
3997
- var openaiResponsesProviderOptionsSchema = z19.object({
3998
- include: z19.array(
3999
- z19.enum([
4000
- "reasoning.encrypted_content",
4001
- "file_search_call.results",
4002
- "message.output_text.logprobs"
4003
- ])
4004
- ).nullish(),
4005
- instructions: z19.string().nullish(),
4006
- /**
4007
- * Return the log probabilities of the tokens.
4008
- *
4009
- * Setting to true will return the log probabilities of the tokens that
4010
- * were generated.
4011
- *
4012
- * Setting to a number will return the log probabilities of the top n
4013
- * tokens that were generated.
4014
- *
4015
- * @see https://platform.openai.com/docs/api-reference/responses/create
4016
- * @see https://cookbook.openai.com/examples/using_logprobs
4017
- */
4018
- logprobs: z19.union([z19.boolean(), z19.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
4019
- /**
4020
- * The maximum number of total calls to built-in tools that can be processed in a response.
4021
- * This maximum number applies across all built-in tool calls, not per individual tool.
4022
- * Any further attempts to call a tool by the model will be ignored.
4023
- */
4024
- maxToolCalls: z19.number().nullish(),
4025
- metadata: z19.any().nullish(),
4026
- parallelToolCalls: z19.boolean().nullish(),
4027
- previousResponseId: z19.string().nullish(),
4028
- promptCacheKey: z19.string().nullish(),
4029
- reasoningEffort: z19.string().nullish(),
4030
- reasoningSummary: z19.string().nullish(),
4031
- safetyIdentifier: z19.string().nullish(),
4032
- serviceTier: z19.enum(["auto", "flex", "priority"]).nullish(),
4033
- store: z19.boolean().nullish(),
4034
- strictJsonSchema: z19.boolean().nullish(),
4035
- textVerbosity: z19.enum(["low", "medium", "high"]).nullish(),
4036
- user: z19.string().nullish()
4037
- });
4038
4397
  export {
4039
4398
  OpenAIChatLanguageModel,
4040
4399
  OpenAICompletionLanguageModel,
@@ -4059,6 +4418,7 @@ export {
4059
4418
  openAITranscriptionProviderOptions,
4060
4419
  openaiChatLanguageModelOptions,
4061
4420
  openaiCompletionProviderOptions,
4062
- openaiEmbeddingProviderOptions
4421
+ openaiEmbeddingProviderOptions,
4422
+ openaiSpeechProviderOptionsSchema
4063
4423
  };
4064
4424
  //# sourceMappingURL=index.mjs.map