@ai-sdk/openai 2.0.0-beta.1 → 2.0.0-beta.3

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/dist/index.js CHANGED
@@ -31,7 +31,7 @@ var import_provider_utils12 = require("@ai-sdk/provider-utils");
31
31
  // src/openai-chat-language-model.ts
32
32
  var import_provider3 = require("@ai-sdk/provider");
33
33
  var import_provider_utils5 = require("@ai-sdk/provider-utils");
34
- var import_zod5 = require("zod");
34
+ var import_v45 = require("zod/v4");
35
35
 
36
36
  // src/convert-to-openai-chat-messages.ts
37
37
  var import_provider = require("@ai-sdk/provider");
@@ -242,15 +242,15 @@ function mapOpenAIFinishReason(finishReason) {
242
242
  }
243
243
 
244
244
  // src/openai-chat-options.ts
245
- var import_zod = require("zod");
246
- var openaiProviderOptions = import_zod.z.object({
245
+ var import_v4 = require("zod/v4");
246
+ var openaiProviderOptions = import_v4.z.object({
247
247
  /**
248
248
  * Modify the likelihood of specified tokens appearing in the completion.
249
249
  *
250
250
  * Accepts a JSON object that maps tokens (specified by their token ID in
251
251
  * the GPT tokenizer) to an associated bias value from -100 to 100.
252
252
  */
253
- logitBias: import_zod.z.record(import_zod.z.coerce.number(), import_zod.z.number()).optional(),
253
+ logitBias: import_v4.z.record(import_v4.z.coerce.number(), import_v4.z.number()).optional(),
254
254
  /**
255
255
  * Return the log probabilities of the tokens.
256
256
  *
@@ -260,63 +260,69 @@ var openaiProviderOptions = import_zod.z.object({
260
260
  * Setting to a number will return the log probabilities of the top n
261
261
  * tokens that were generated.
262
262
  */
263
- logprobs: import_zod.z.union([import_zod.z.boolean(), import_zod.z.number()]).optional(),
263
+ logprobs: import_v4.z.union([import_v4.z.boolean(), import_v4.z.number()]).optional(),
264
264
  /**
265
265
  * Whether to enable parallel function calling during tool use. Default to true.
266
266
  */
267
- parallelToolCalls: import_zod.z.boolean().optional(),
267
+ parallelToolCalls: import_v4.z.boolean().optional(),
268
268
  /**
269
269
  * A unique identifier representing your end-user, which can help OpenAI to
270
270
  * monitor and detect abuse.
271
271
  */
272
- user: import_zod.z.string().optional(),
272
+ user: import_v4.z.string().optional(),
273
273
  /**
274
274
  * Reasoning effort for reasoning models. Defaults to `medium`.
275
275
  */
276
- reasoningEffort: import_zod.z.enum(["low", "medium", "high"]).optional(),
276
+ reasoningEffort: import_v4.z.enum(["low", "medium", "high"]).optional(),
277
277
  /**
278
278
  * Maximum number of completion tokens to generate. Useful for reasoning models.
279
279
  */
280
- maxCompletionTokens: import_zod.z.number().optional(),
280
+ maxCompletionTokens: import_v4.z.number().optional(),
281
281
  /**
282
282
  * Whether to enable persistence in responses API.
283
283
  */
284
- store: import_zod.z.boolean().optional(),
284
+ store: import_v4.z.boolean().optional(),
285
285
  /**
286
286
  * Metadata to associate with the request.
287
287
  */
288
- metadata: import_zod.z.record(import_zod.z.string()).optional(),
288
+ metadata: import_v4.z.record(import_v4.z.string().max(64), import_v4.z.string().max(512)).optional(),
289
289
  /**
290
290
  * Parameters for prediction mode.
291
291
  */
292
- prediction: import_zod.z.record(import_zod.z.any()).optional(),
292
+ prediction: import_v4.z.record(import_v4.z.string(), import_v4.z.any()).optional(),
293
293
  /**
294
294
  * Whether to use structured outputs.
295
295
  *
296
296
  * @default true
297
297
  */
298
- structuredOutputs: import_zod.z.boolean().optional(),
298
+ structuredOutputs: import_v4.z.boolean().optional(),
299
299
  /**
300
300
  * Service tier for the request. Set to 'flex' for 50% cheaper processing
301
301
  * at the cost of increased latency. Only available for o3 and o4-mini models.
302
302
  *
303
303
  * @default 'auto'
304
304
  */
305
- serviceTier: import_zod.z.enum(["auto", "flex"]).optional()
305
+ serviceTier: import_v4.z.enum(["auto", "flex"]).optional(),
306
+ /**
307
+ * Whether to use strict JSON schema validation.
308
+ *
309
+ * @default true
310
+ */
311
+ strictJsonSchema: import_v4.z.boolean().optional()
306
312
  });
307
313
 
308
314
  // src/openai-error.ts
309
- var import_zod2 = require("zod");
315
+ var import_v42 = require("zod/v4");
310
316
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
311
- var openaiErrorDataSchema = import_zod2.z.object({
312
- error: import_zod2.z.object({
313
- message: import_zod2.z.string(),
317
+ var openaiErrorDataSchema = import_v42.z.object({
318
+ error: import_v42.z.object({
319
+ message: import_v42.z.string(),
314
320
  // The additional information below is handled loosely to support
315
321
  // OpenAI-compatible providers that have slightly different error
316
322
  // responses:
317
- type: import_zod2.z.string().nullish(),
318
- param: import_zod2.z.any().nullish(),
319
- code: import_zod2.z.union([import_zod2.z.string(), import_zod2.z.number()]).nullish()
323
+ type: import_v42.z.string().nullish(),
324
+ param: import_v42.z.any().nullish(),
325
+ code: import_v42.z.union([import_v42.z.string(), import_v42.z.number()]).nullish()
320
326
  })
321
327
  });
322
328
  var openaiFailedResponseHandler = (0, import_provider_utils2.createJsonErrorResponseHandler)({
@@ -329,77 +335,78 @@ var import_provider2 = require("@ai-sdk/provider");
329
335
 
330
336
  // src/tool/file-search.ts
331
337
  var import_provider_utils3 = require("@ai-sdk/provider-utils");
332
- var import_zod3 = require("zod");
333
- var fileSearchArgsSchema = import_zod3.z.object({
338
+ var import_v43 = require("zod/v4");
339
+ var fileSearchArgsSchema = import_v43.z.object({
334
340
  /**
335
341
  * List of vector store IDs to search through. If not provided, searches all available vector stores.
336
342
  */
337
- vectorStoreIds: import_zod3.z.array(import_zod3.z.string()).optional(),
343
+ vectorStoreIds: import_v43.z.array(import_v43.z.string()).optional(),
338
344
  /**
339
345
  * Maximum number of search results to return. Defaults to 10.
340
346
  */
341
- maxResults: import_zod3.z.number().optional(),
347
+ maxResults: import_v43.z.number().optional(),
342
348
  /**
343
349
  * Type of search to perform. Defaults to 'auto'.
344
350
  */
345
- searchType: import_zod3.z.enum(["auto", "keyword", "semantic"]).optional()
351
+ searchType: import_v43.z.enum(["auto", "keyword", "semantic"]).optional()
346
352
  });
347
353
  var fileSearch = (0, import_provider_utils3.createProviderDefinedToolFactory)({
348
354
  id: "openai.file_search",
349
355
  name: "file_search",
350
- inputSchema: import_zod3.z.object({
351
- query: import_zod3.z.string()
356
+ inputSchema: import_v43.z.object({
357
+ query: import_v43.z.string()
352
358
  })
353
359
  });
354
360
 
355
361
  // src/tool/web-search-preview.ts
356
362
  var import_provider_utils4 = require("@ai-sdk/provider-utils");
357
- var import_zod4 = require("zod");
358
- var webSearchPreviewArgsSchema = import_zod4.z.object({
363
+ var import_v44 = require("zod/v4");
364
+ var webSearchPreviewArgsSchema = import_v44.z.object({
359
365
  /**
360
366
  * Search context size to use for the web search.
361
367
  * - high: Most comprehensive context, highest cost, slower response
362
368
  * - medium: Balanced context, cost, and latency (default)
363
369
  * - low: Least context, lowest cost, fastest response
364
370
  */
365
- searchContextSize: import_zod4.z.enum(["low", "medium", "high"]).optional(),
371
+ searchContextSize: import_v44.z.enum(["low", "medium", "high"]).optional(),
366
372
  /**
367
373
  * User location information to provide geographically relevant search results.
368
374
  */
369
- userLocation: import_zod4.z.object({
375
+ userLocation: import_v44.z.object({
370
376
  /**
371
377
  * Type of location (always 'approximate')
372
378
  */
373
- type: import_zod4.z.literal("approximate"),
379
+ type: import_v44.z.literal("approximate"),
374
380
  /**
375
381
  * Two-letter ISO country code (e.g., 'US', 'GB')
376
382
  */
377
- country: import_zod4.z.string().optional(),
383
+ country: import_v44.z.string().optional(),
378
384
  /**
379
385
  * City name (free text, e.g., 'Minneapolis')
380
386
  */
381
- city: import_zod4.z.string().optional(),
387
+ city: import_v44.z.string().optional(),
382
388
  /**
383
389
  * Region name (free text, e.g., 'Minnesota')
384
390
  */
385
- region: import_zod4.z.string().optional(),
391
+ region: import_v44.z.string().optional(),
386
392
  /**
387
393
  * IANA timezone (e.g., 'America/Chicago')
388
394
  */
389
- timezone: import_zod4.z.string().optional()
395
+ timezone: import_v44.z.string().optional()
390
396
  }).optional()
391
397
  });
392
398
  var webSearchPreview = (0, import_provider_utils4.createProviderDefinedToolFactory)({
393
399
  id: "openai.web_search_preview",
394
400
  name: "web_search_preview",
395
- inputSchema: import_zod4.z.object({})
401
+ inputSchema: import_v44.z.object({})
396
402
  });
397
403
 
398
404
  // src/openai-prepare-tools.ts
399
405
  function prepareTools({
400
406
  tools,
401
407
  toolChoice,
402
- structuredOutputs
408
+ structuredOutputs,
409
+ strictJsonSchema
403
410
  }) {
404
411
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
405
412
  const toolWarnings = [];
@@ -416,7 +423,7 @@ function prepareTools({
416
423
  name: tool.name,
417
424
  description: tool.description,
418
425
  parameters: tool.inputSchema,
419
- strict: structuredOutputs ? true : void 0
426
+ strict: structuredOutputs ? strictJsonSchema : void 0
420
427
  }
421
428
  });
422
429
  break;
@@ -508,7 +515,7 @@ var OpenAIChatLanguageModel = class {
508
515
  toolChoice,
509
516
  providerOptions
510
517
  }) {
511
- var _a, _b, _c;
518
+ var _a, _b, _c, _d;
512
519
  const warnings = [];
513
520
  const openaiOptions = (_a = await (0, import_provider_utils5.parseProviderOptions)({
514
521
  provider: "openai",
@@ -536,6 +543,7 @@ var OpenAIChatLanguageModel = class {
536
543
  }
537
544
  );
538
545
  warnings.push(...messageWarnings);
546
+ const strictJsonSchema = (_c = openaiOptions.strictJsonSchema) != null ? _c : false;
539
547
  const baseArgs = {
540
548
  // model id:
541
549
  model: this.modelId,
@@ -551,18 +559,15 @@ var OpenAIChatLanguageModel = class {
551
559
  top_p: topP,
552
560
  frequency_penalty: frequencyPenalty,
553
561
  presence_penalty: presencePenalty,
554
- response_format: (responseFormat == null ? void 0 : responseFormat.type) === "json" ? (
555
- // TODO convert into provider option
556
- structuredOutputs && responseFormat.schema != null ? {
557
- type: "json_schema",
558
- json_schema: {
559
- schema: responseFormat.schema,
560
- strict: true,
561
- name: (_c = responseFormat.name) != null ? _c : "response",
562
- description: responseFormat.description
563
- }
564
- } : { type: "json_object" }
565
- ) : void 0,
562
+ response_format: (responseFormat == null ? void 0 : responseFormat.type) === "json" ? structuredOutputs && responseFormat.schema != null ? {
563
+ type: "json_schema",
564
+ json_schema: {
565
+ schema: responseFormat.schema,
566
+ strict: strictJsonSchema,
567
+ name: (_d = responseFormat.name) != null ? _d : "response",
568
+ description: responseFormat.description
569
+ }
570
+ } : { type: "json_object" } : void 0,
566
571
  stop: stopSequences,
567
572
  seed,
568
573
  // openai specific settings:
@@ -661,7 +666,8 @@ var OpenAIChatLanguageModel = class {
661
666
  } = prepareTools({
662
667
  tools,
663
668
  toolChoice,
664
- structuredOutputs
669
+ structuredOutputs,
670
+ strictJsonSchema
665
671
  });
666
672
  return {
667
673
  args: {
@@ -943,97 +949,97 @@ var OpenAIChatLanguageModel = class {
943
949
  };
944
950
  }
945
951
  };
946
- var openaiTokenUsageSchema = import_zod5.z.object({
947
- prompt_tokens: import_zod5.z.number().nullish(),
948
- completion_tokens: import_zod5.z.number().nullish(),
949
- total_tokens: import_zod5.z.number().nullish(),
950
- prompt_tokens_details: import_zod5.z.object({
951
- cached_tokens: import_zod5.z.number().nullish()
952
+ var openaiTokenUsageSchema = import_v45.z.object({
953
+ prompt_tokens: import_v45.z.number().nullish(),
954
+ completion_tokens: import_v45.z.number().nullish(),
955
+ total_tokens: import_v45.z.number().nullish(),
956
+ prompt_tokens_details: import_v45.z.object({
957
+ cached_tokens: import_v45.z.number().nullish()
952
958
  }).nullish(),
953
- completion_tokens_details: import_zod5.z.object({
954
- reasoning_tokens: import_zod5.z.number().nullish(),
955
- accepted_prediction_tokens: import_zod5.z.number().nullish(),
956
- rejected_prediction_tokens: import_zod5.z.number().nullish()
959
+ completion_tokens_details: import_v45.z.object({
960
+ reasoning_tokens: import_v45.z.number().nullish(),
961
+ accepted_prediction_tokens: import_v45.z.number().nullish(),
962
+ rejected_prediction_tokens: import_v45.z.number().nullish()
957
963
  }).nullish()
958
964
  }).nullish();
959
- var openaiChatResponseSchema = import_zod5.z.object({
960
- id: import_zod5.z.string().nullish(),
961
- created: import_zod5.z.number().nullish(),
962
- model: import_zod5.z.string().nullish(),
963
- choices: import_zod5.z.array(
964
- import_zod5.z.object({
965
- message: import_zod5.z.object({
966
- role: import_zod5.z.literal("assistant").nullish(),
967
- content: import_zod5.z.string().nullish(),
968
- tool_calls: import_zod5.z.array(
969
- import_zod5.z.object({
970
- id: import_zod5.z.string().nullish(),
971
- type: import_zod5.z.literal("function"),
972
- function: import_zod5.z.object({
973
- name: import_zod5.z.string(),
974
- arguments: import_zod5.z.string()
965
+ var openaiChatResponseSchema = import_v45.z.object({
966
+ id: import_v45.z.string().nullish(),
967
+ created: import_v45.z.number().nullish(),
968
+ model: import_v45.z.string().nullish(),
969
+ choices: import_v45.z.array(
970
+ import_v45.z.object({
971
+ message: import_v45.z.object({
972
+ role: import_v45.z.literal("assistant").nullish(),
973
+ content: import_v45.z.string().nullish(),
974
+ tool_calls: import_v45.z.array(
975
+ import_v45.z.object({
976
+ id: import_v45.z.string().nullish(),
977
+ type: import_v45.z.literal("function"),
978
+ function: import_v45.z.object({
979
+ name: import_v45.z.string(),
980
+ arguments: import_v45.z.string()
975
981
  })
976
982
  })
977
983
  ).nullish()
978
984
  }),
979
- index: import_zod5.z.number(),
980
- logprobs: import_zod5.z.object({
981
- content: import_zod5.z.array(
982
- import_zod5.z.object({
983
- token: import_zod5.z.string(),
984
- logprob: import_zod5.z.number(),
985
- top_logprobs: import_zod5.z.array(
986
- import_zod5.z.object({
987
- token: import_zod5.z.string(),
988
- logprob: import_zod5.z.number()
985
+ index: import_v45.z.number(),
986
+ logprobs: import_v45.z.object({
987
+ content: import_v45.z.array(
988
+ import_v45.z.object({
989
+ token: import_v45.z.string(),
990
+ logprob: import_v45.z.number(),
991
+ top_logprobs: import_v45.z.array(
992
+ import_v45.z.object({
993
+ token: import_v45.z.string(),
994
+ logprob: import_v45.z.number()
989
995
  })
990
996
  )
991
997
  })
992
998
  ).nullish()
993
999
  }).nullish(),
994
- finish_reason: import_zod5.z.string().nullish()
1000
+ finish_reason: import_v45.z.string().nullish()
995
1001
  })
996
1002
  ),
997
1003
  usage: openaiTokenUsageSchema
998
1004
  });
999
- var openaiChatChunkSchema = import_zod5.z.union([
1000
- import_zod5.z.object({
1001
- id: import_zod5.z.string().nullish(),
1002
- created: import_zod5.z.number().nullish(),
1003
- model: import_zod5.z.string().nullish(),
1004
- choices: import_zod5.z.array(
1005
- import_zod5.z.object({
1006
- delta: import_zod5.z.object({
1007
- role: import_zod5.z.enum(["assistant"]).nullish(),
1008
- content: import_zod5.z.string().nullish(),
1009
- tool_calls: import_zod5.z.array(
1010
- import_zod5.z.object({
1011
- index: import_zod5.z.number(),
1012
- id: import_zod5.z.string().nullish(),
1013
- type: import_zod5.z.literal("function").nullish(),
1014
- function: import_zod5.z.object({
1015
- name: import_zod5.z.string().nullish(),
1016
- arguments: import_zod5.z.string().nullish()
1005
+ var openaiChatChunkSchema = import_v45.z.union([
1006
+ import_v45.z.object({
1007
+ id: import_v45.z.string().nullish(),
1008
+ created: import_v45.z.number().nullish(),
1009
+ model: import_v45.z.string().nullish(),
1010
+ choices: import_v45.z.array(
1011
+ import_v45.z.object({
1012
+ delta: import_v45.z.object({
1013
+ role: import_v45.z.enum(["assistant"]).nullish(),
1014
+ content: import_v45.z.string().nullish(),
1015
+ tool_calls: import_v45.z.array(
1016
+ import_v45.z.object({
1017
+ index: import_v45.z.number(),
1018
+ id: import_v45.z.string().nullish(),
1019
+ type: import_v45.z.literal("function").nullish(),
1020
+ function: import_v45.z.object({
1021
+ name: import_v45.z.string().nullish(),
1022
+ arguments: import_v45.z.string().nullish()
1017
1023
  })
1018
1024
  })
1019
1025
  ).nullish()
1020
1026
  }).nullish(),
1021
- logprobs: import_zod5.z.object({
1022
- content: import_zod5.z.array(
1023
- import_zod5.z.object({
1024
- token: import_zod5.z.string(),
1025
- logprob: import_zod5.z.number(),
1026
- top_logprobs: import_zod5.z.array(
1027
- import_zod5.z.object({
1028
- token: import_zod5.z.string(),
1029
- logprob: import_zod5.z.number()
1027
+ logprobs: import_v45.z.object({
1028
+ content: import_v45.z.array(
1029
+ import_v45.z.object({
1030
+ token: import_v45.z.string(),
1031
+ logprob: import_v45.z.number(),
1032
+ top_logprobs: import_v45.z.array(
1033
+ import_v45.z.object({
1034
+ token: import_v45.z.string(),
1035
+ logprob: import_v45.z.number()
1030
1036
  })
1031
1037
  )
1032
1038
  })
1033
1039
  ).nullish()
1034
1040
  }).nullish(),
1035
- finish_reason: import_zod5.z.string().nullish(),
1036
- index: import_zod5.z.number()
1041
+ finish_reason: import_v45.z.string().nullish(),
1042
+ index: import_v45.z.number()
1037
1043
  })
1038
1044
  ),
1039
1045
  usage: openaiTokenUsageSchema
@@ -1088,7 +1094,7 @@ var reasoningModels = {
1088
1094
 
1089
1095
  // src/openai-completion-language-model.ts
1090
1096
  var import_provider_utils6 = require("@ai-sdk/provider-utils");
1091
- var import_zod7 = require("zod");
1097
+ var import_v47 = require("zod/v4");
1092
1098
 
1093
1099
  // src/convert-to-openai-completion-prompt.ts
1094
1100
  var import_provider4 = require("@ai-sdk/provider");
@@ -1166,12 +1172,12 @@ ${user}:`]
1166
1172
  }
1167
1173
 
1168
1174
  // src/openai-completion-options.ts
1169
- var import_zod6 = require("zod");
1170
- var openaiCompletionProviderOptions = import_zod6.z.object({
1175
+ var import_v46 = require("zod/v4");
1176
+ var openaiCompletionProviderOptions = import_v46.z.object({
1171
1177
  /**
1172
1178
  Echo back the prompt in addition to the completion.
1173
1179
  */
1174
- echo: import_zod6.z.boolean().optional(),
1180
+ echo: import_v46.z.boolean().optional(),
1175
1181
  /**
1176
1182
  Modify the likelihood of specified tokens appearing in the completion.
1177
1183
 
@@ -1186,16 +1192,16 @@ var openaiCompletionProviderOptions = import_zod6.z.object({
1186
1192
  As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
1187
1193
  token from being generated.
1188
1194
  */
1189
- logitBias: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.number()).optional(),
1195
+ logitBias: import_v46.z.record(import_v46.z.string(), import_v46.z.number()).optional(),
1190
1196
  /**
1191
1197
  The suffix that comes after a completion of inserted text.
1192
1198
  */
1193
- suffix: import_zod6.z.string().optional(),
1199
+ suffix: import_v46.z.string().optional(),
1194
1200
  /**
1195
1201
  A unique identifier representing your end-user, which can help OpenAI to
1196
1202
  monitor and detect abuse. Learn more.
1197
1203
  */
1198
- user: import_zod6.z.string().optional(),
1204
+ user: import_v46.z.string().optional(),
1199
1205
  /**
1200
1206
  Return the log probabilities of the tokens. Including logprobs will increase
1201
1207
  the response size and can slow down response times. However, it can
@@ -1205,7 +1211,7 @@ var openaiCompletionProviderOptions = import_zod6.z.object({
1205
1211
  Setting to a number will return the log probabilities of the top n
1206
1212
  tokens that were generated.
1207
1213
  */
1208
- logprobs: import_zod6.z.union([import_zod6.z.boolean(), import_zod6.z.number()]).optional()
1214
+ logprobs: import_v46.z.union([import_v46.z.boolean(), import_v46.z.number()]).optional()
1209
1215
  });
1210
1216
 
1211
1217
  // src/openai-completion-language-model.ts
@@ -1437,42 +1443,42 @@ var OpenAICompletionLanguageModel = class {
1437
1443
  };
1438
1444
  }
1439
1445
  };
1440
- var usageSchema = import_zod7.z.object({
1441
- prompt_tokens: import_zod7.z.number(),
1442
- completion_tokens: import_zod7.z.number(),
1443
- total_tokens: import_zod7.z.number()
1446
+ var usageSchema = import_v47.z.object({
1447
+ prompt_tokens: import_v47.z.number(),
1448
+ completion_tokens: import_v47.z.number(),
1449
+ total_tokens: import_v47.z.number()
1444
1450
  });
1445
- var openaiCompletionResponseSchema = import_zod7.z.object({
1446
- id: import_zod7.z.string().nullish(),
1447
- created: import_zod7.z.number().nullish(),
1448
- model: import_zod7.z.string().nullish(),
1449
- choices: import_zod7.z.array(
1450
- import_zod7.z.object({
1451
- text: import_zod7.z.string(),
1452
- finish_reason: import_zod7.z.string(),
1453
- logprobs: import_zod7.z.object({
1454
- tokens: import_zod7.z.array(import_zod7.z.string()),
1455
- token_logprobs: import_zod7.z.array(import_zod7.z.number()),
1456
- top_logprobs: import_zod7.z.array(import_zod7.z.record(import_zod7.z.string(), import_zod7.z.number())).nullish()
1451
+ var openaiCompletionResponseSchema = import_v47.z.object({
1452
+ id: import_v47.z.string().nullish(),
1453
+ created: import_v47.z.number().nullish(),
1454
+ model: import_v47.z.string().nullish(),
1455
+ choices: import_v47.z.array(
1456
+ import_v47.z.object({
1457
+ text: import_v47.z.string(),
1458
+ finish_reason: import_v47.z.string(),
1459
+ logprobs: import_v47.z.object({
1460
+ tokens: import_v47.z.array(import_v47.z.string()),
1461
+ token_logprobs: import_v47.z.array(import_v47.z.number()),
1462
+ top_logprobs: import_v47.z.array(import_v47.z.record(import_v47.z.string(), import_v47.z.number())).nullish()
1457
1463
  }).nullish()
1458
1464
  })
1459
1465
  ),
1460
1466
  usage: usageSchema.nullish()
1461
1467
  });
1462
- var openaiCompletionChunkSchema = import_zod7.z.union([
1463
- import_zod7.z.object({
1464
- id: import_zod7.z.string().nullish(),
1465
- created: import_zod7.z.number().nullish(),
1466
- model: import_zod7.z.string().nullish(),
1467
- choices: import_zod7.z.array(
1468
- import_zod7.z.object({
1469
- text: import_zod7.z.string(),
1470
- finish_reason: import_zod7.z.string().nullish(),
1471
- index: import_zod7.z.number(),
1472
- logprobs: import_zod7.z.object({
1473
- tokens: import_zod7.z.array(import_zod7.z.string()),
1474
- token_logprobs: import_zod7.z.array(import_zod7.z.number()),
1475
- top_logprobs: import_zod7.z.array(import_zod7.z.record(import_zod7.z.string(), import_zod7.z.number())).nullish()
1468
+ var openaiCompletionChunkSchema = import_v47.z.union([
1469
+ import_v47.z.object({
1470
+ id: import_v47.z.string().nullish(),
1471
+ created: import_v47.z.number().nullish(),
1472
+ model: import_v47.z.string().nullish(),
1473
+ choices: import_v47.z.array(
1474
+ import_v47.z.object({
1475
+ text: import_v47.z.string(),
1476
+ finish_reason: import_v47.z.string().nullish(),
1477
+ index: import_v47.z.number(),
1478
+ logprobs: import_v47.z.object({
1479
+ tokens: import_v47.z.array(import_v47.z.string()),
1480
+ token_logprobs: import_v47.z.array(import_v47.z.number()),
1481
+ top_logprobs: import_v47.z.array(import_v47.z.record(import_v47.z.string(), import_v47.z.number())).nullish()
1476
1482
  }).nullish()
1477
1483
  })
1478
1484
  ),
@@ -1484,21 +1490,21 @@ var openaiCompletionChunkSchema = import_zod7.z.union([
1484
1490
  // src/openai-embedding-model.ts
1485
1491
  var import_provider5 = require("@ai-sdk/provider");
1486
1492
  var import_provider_utils7 = require("@ai-sdk/provider-utils");
1487
- var import_zod9 = require("zod");
1493
+ var import_v49 = require("zod/v4");
1488
1494
 
1489
1495
  // src/openai-embedding-options.ts
1490
- var import_zod8 = require("zod");
1491
- var openaiEmbeddingProviderOptions = import_zod8.z.object({
1496
+ var import_v48 = require("zod/v4");
1497
+ var openaiEmbeddingProviderOptions = import_v48.z.object({
1492
1498
  /**
1493
1499
  The number of dimensions the resulting output embeddings should have.
1494
1500
  Only supported in text-embedding-3 and later models.
1495
1501
  */
1496
- dimensions: import_zod8.z.number().optional(),
1502
+ dimensions: import_v48.z.number().optional(),
1497
1503
  /**
1498
1504
  A unique identifier representing your end-user, which can help OpenAI to
1499
1505
  monitor and detect abuse. Learn more.
1500
1506
  */
1501
- user: import_zod8.z.string().optional()
1507
+ user: import_v48.z.string().optional()
1502
1508
  });
1503
1509
 
1504
1510
  // src/openai-embedding-model.ts
@@ -1564,14 +1570,14 @@ var OpenAIEmbeddingModel = class {
1564
1570
  };
1565
1571
  }
1566
1572
  };
1567
- var openaiTextEmbeddingResponseSchema = import_zod9.z.object({
1568
- data: import_zod9.z.array(import_zod9.z.object({ embedding: import_zod9.z.array(import_zod9.z.number()) })),
1569
- usage: import_zod9.z.object({ prompt_tokens: import_zod9.z.number() }).nullish()
1573
+ var openaiTextEmbeddingResponseSchema = import_v49.z.object({
1574
+ data: import_v49.z.array(import_v49.z.object({ embedding: import_v49.z.array(import_v49.z.number()) })),
1575
+ usage: import_v49.z.object({ prompt_tokens: import_v49.z.number() }).nullish()
1570
1576
  });
1571
1577
 
1572
1578
  // src/openai-image-model.ts
1573
1579
  var import_provider_utils8 = require("@ai-sdk/provider-utils");
1574
- var import_zod10 = require("zod");
1580
+ var import_v410 = require("zod/v4");
1575
1581
 
1576
1582
  // src/openai-image-settings.ts
1577
1583
  var modelMaxImagesPerCall = {
@@ -1659,9 +1665,9 @@ var OpenAIImageModel = class {
1659
1665
  };
1660
1666
  }
1661
1667
  };
1662
- var openaiImageResponseSchema = import_zod10.z.object({
1663
- data: import_zod10.z.array(
1664
- import_zod10.z.object({ b64_json: import_zod10.z.string(), revised_prompt: import_zod10.z.string().optional() })
1668
+ var openaiImageResponseSchema = import_v410.z.object({
1669
+ data: import_v410.z.array(
1670
+ import_v410.z.object({ b64_json: import_v410.z.string(), revised_prompt: import_v410.z.string().optional() })
1665
1671
  )
1666
1672
  });
1667
1673
 
@@ -1673,33 +1679,33 @@ var openaiTools = {
1673
1679
 
1674
1680
  // src/openai-transcription-model.ts
1675
1681
  var import_provider_utils9 = require("@ai-sdk/provider-utils");
1676
- var import_zod12 = require("zod");
1682
+ var import_v412 = require("zod/v4");
1677
1683
 
1678
1684
  // src/openai-transcription-options.ts
1679
- var import_zod11 = require("zod");
1680
- var openAITranscriptionProviderOptions = import_zod11.z.object({
1685
+ var import_v411 = require("zod/v4");
1686
+ var openAITranscriptionProviderOptions = import_v411.z.object({
1681
1687
  /**
1682
1688
  * Additional information to include in the transcription response.
1683
1689
  */
1684
- include: import_zod11.z.array(import_zod11.z.string()).optional(),
1690
+ include: import_v411.z.array(import_v411.z.string()).optional(),
1685
1691
  /**
1686
1692
  * The language of the input audio in ISO-639-1 format.
1687
1693
  */
1688
- language: import_zod11.z.string().optional(),
1694
+ language: import_v411.z.string().optional(),
1689
1695
  /**
1690
1696
  * An optional text to guide the model's style or continue a previous audio segment.
1691
1697
  */
1692
- prompt: import_zod11.z.string().optional(),
1698
+ prompt: import_v411.z.string().optional(),
1693
1699
  /**
1694
1700
  * The sampling temperature, between 0 and 1.
1695
1701
  * @default 0
1696
1702
  */
1697
- temperature: import_zod11.z.number().min(0).max(1).default(0).optional(),
1703
+ temperature: import_v411.z.number().min(0).max(1).default(0).optional(),
1698
1704
  /**
1699
1705
  * The timestamp granularities to populate for this transcription.
1700
1706
  * @default ['segment']
1701
1707
  */
1702
- timestampGranularities: import_zod11.z.array(import_zod11.z.enum(["word", "segment"])).default(["segment"]).optional()
1708
+ timestampGranularities: import_v411.z.array(import_v411.z.enum(["word", "segment"])).default(["segment"]).optional()
1703
1709
  });
1704
1710
 
1705
1711
  // src/openai-transcription-model.ts
@@ -1847,22 +1853,22 @@ var OpenAITranscriptionModel = class {
1847
1853
  };
1848
1854
  }
1849
1855
  };
1850
- var openaiTranscriptionResponseSchema = import_zod12.z.object({
1851
- text: import_zod12.z.string(),
1852
- language: import_zod12.z.string().nullish(),
1853
- duration: import_zod12.z.number().nullish(),
1854
- words: import_zod12.z.array(
1855
- import_zod12.z.object({
1856
- word: import_zod12.z.string(),
1857
- start: import_zod12.z.number(),
1858
- end: import_zod12.z.number()
1856
+ var openaiTranscriptionResponseSchema = import_v412.z.object({
1857
+ text: import_v412.z.string(),
1858
+ language: import_v412.z.string().nullish(),
1859
+ duration: import_v412.z.number().nullish(),
1860
+ words: import_v412.z.array(
1861
+ import_v412.z.object({
1862
+ word: import_v412.z.string(),
1863
+ start: import_v412.z.number(),
1864
+ end: import_v412.z.number()
1859
1865
  })
1860
1866
  ).nullish()
1861
1867
  });
1862
1868
 
1863
1869
  // src/responses/openai-responses-language-model.ts
1864
1870
  var import_provider_utils10 = require("@ai-sdk/provider-utils");
1865
- var import_zod13 = require("zod");
1871
+ var import_v413 = require("zod/v4");
1866
1872
 
1867
1873
  // src/responses/convert-to-openai-responses-messages.ts
1868
1874
  var import_provider6 = require("@ai-sdk/provider");
@@ -2028,7 +2034,7 @@ var import_provider7 = require("@ai-sdk/provider");
2028
2034
  function prepareResponsesTools({
2029
2035
  tools,
2030
2036
  toolChoice,
2031
- strict
2037
+ strictJsonSchema
2032
2038
  }) {
2033
2039
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
2034
2040
  const toolWarnings = [];
@@ -2044,7 +2050,7 @@ function prepareResponsesTools({
2044
2050
  name: tool.name,
2045
2051
  description: tool.description,
2046
2052
  parameters: tool.inputSchema,
2047
- strict: strict ? true : void 0
2053
+ strict: strictJsonSchema
2048
2054
  });
2049
2055
  break;
2050
2056
  case "provider-defined":
@@ -2152,7 +2158,7 @@ var OpenAIResponsesLanguageModel = class {
2152
2158
  providerOptions,
2153
2159
  schema: openaiResponsesProviderOptionsSchema
2154
2160
  });
2155
- const isStrict = (_a = openaiOptions == null ? void 0 : openaiOptions.strictSchemas) != null ? _a : true;
2161
+ const strictJsonSchema = (_a = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _a : false;
2156
2162
  const baseArgs = {
2157
2163
  model: this.modelId,
2158
2164
  input: messages,
@@ -2163,7 +2169,7 @@ var OpenAIResponsesLanguageModel = class {
2163
2169
  text: {
2164
2170
  format: responseFormat.schema != null ? {
2165
2171
  type: "json_schema",
2166
- strict: isStrict,
2172
+ strict: strictJsonSchema,
2167
2173
  name: (_b = responseFormat.name) != null ? _b : "response",
2168
2174
  description: responseFormat.description,
2169
2175
  schema: responseFormat.schema
@@ -2226,7 +2232,7 @@ var OpenAIResponsesLanguageModel = class {
2226
2232
  } = prepareResponsesTools({
2227
2233
  tools,
2228
2234
  toolChoice,
2229
- strict: isStrict
2235
+ strictJsonSchema
2230
2236
  });
2231
2237
  return {
2232
2238
  args: {
@@ -2253,59 +2259,59 @@ var OpenAIResponsesLanguageModel = class {
2253
2259
  body,
2254
2260
  failedResponseHandler: openaiFailedResponseHandler,
2255
2261
  successfulResponseHandler: (0, import_provider_utils10.createJsonResponseHandler)(
2256
- import_zod13.z.object({
2257
- id: import_zod13.z.string(),
2258
- created_at: import_zod13.z.number(),
2259
- model: import_zod13.z.string(),
2260
- output: import_zod13.z.array(
2261
- import_zod13.z.discriminatedUnion("type", [
2262
- import_zod13.z.object({
2263
- type: import_zod13.z.literal("message"),
2264
- role: import_zod13.z.literal("assistant"),
2265
- content: import_zod13.z.array(
2266
- import_zod13.z.object({
2267
- type: import_zod13.z.literal("output_text"),
2268
- text: import_zod13.z.string(),
2269
- annotations: import_zod13.z.array(
2270
- import_zod13.z.object({
2271
- type: import_zod13.z.literal("url_citation"),
2272
- start_index: import_zod13.z.number(),
2273
- end_index: import_zod13.z.number(),
2274
- url: import_zod13.z.string(),
2275
- title: import_zod13.z.string()
2262
+ import_v413.z.object({
2263
+ id: import_v413.z.string(),
2264
+ created_at: import_v413.z.number(),
2265
+ model: import_v413.z.string(),
2266
+ output: import_v413.z.array(
2267
+ import_v413.z.discriminatedUnion("type", [
2268
+ import_v413.z.object({
2269
+ type: import_v413.z.literal("message"),
2270
+ role: import_v413.z.literal("assistant"),
2271
+ content: import_v413.z.array(
2272
+ import_v413.z.object({
2273
+ type: import_v413.z.literal("output_text"),
2274
+ text: import_v413.z.string(),
2275
+ annotations: import_v413.z.array(
2276
+ import_v413.z.object({
2277
+ type: import_v413.z.literal("url_citation"),
2278
+ start_index: import_v413.z.number(),
2279
+ end_index: import_v413.z.number(),
2280
+ url: import_v413.z.string(),
2281
+ title: import_v413.z.string()
2276
2282
  })
2277
2283
  )
2278
2284
  })
2279
2285
  )
2280
2286
  }),
2281
- import_zod13.z.object({
2282
- type: import_zod13.z.literal("function_call"),
2283
- call_id: import_zod13.z.string(),
2284
- name: import_zod13.z.string(),
2285
- arguments: import_zod13.z.string()
2287
+ import_v413.z.object({
2288
+ type: import_v413.z.literal("function_call"),
2289
+ call_id: import_v413.z.string(),
2290
+ name: import_v413.z.string(),
2291
+ arguments: import_v413.z.string()
2286
2292
  }),
2287
- import_zod13.z.object({
2288
- type: import_zod13.z.literal("web_search_call"),
2289
- id: import_zod13.z.string(),
2290
- status: import_zod13.z.string().optional()
2293
+ import_v413.z.object({
2294
+ type: import_v413.z.literal("web_search_call"),
2295
+ id: import_v413.z.string(),
2296
+ status: import_v413.z.string().optional()
2291
2297
  }),
2292
- import_zod13.z.object({
2293
- type: import_zod13.z.literal("computer_call"),
2294
- id: import_zod13.z.string(),
2295
- status: import_zod13.z.string().optional()
2298
+ import_v413.z.object({
2299
+ type: import_v413.z.literal("computer_call"),
2300
+ id: import_v413.z.string(),
2301
+ status: import_v413.z.string().optional()
2296
2302
  }),
2297
- import_zod13.z.object({
2298
- type: import_zod13.z.literal("reasoning"),
2299
- summary: import_zod13.z.array(
2300
- import_zod13.z.object({
2301
- type: import_zod13.z.literal("summary_text"),
2302
- text: import_zod13.z.string()
2303
+ import_v413.z.object({
2304
+ type: import_v413.z.literal("reasoning"),
2305
+ summary: import_v413.z.array(
2306
+ import_v413.z.object({
2307
+ type: import_v413.z.literal("summary_text"),
2308
+ text: import_v413.z.string()
2303
2309
  })
2304
2310
  )
2305
2311
  })
2306
2312
  ])
2307
2313
  ),
2308
- incomplete_details: import_zod13.z.object({ reason: import_zod13.z.string() }).nullable(),
2314
+ incomplete_details: import_v413.z.object({ reason: import_v413.z.string() }).nullable(),
2309
2315
  usage: usageSchema2
2310
2316
  })
2311
2317
  ),
@@ -2646,124 +2652,124 @@ var OpenAIResponsesLanguageModel = class {
2646
2652
  };
2647
2653
  }
2648
2654
  };
2649
- var usageSchema2 = import_zod13.z.object({
2650
- input_tokens: import_zod13.z.number(),
2651
- input_tokens_details: import_zod13.z.object({ cached_tokens: import_zod13.z.number().nullish() }).nullish(),
2652
- output_tokens: import_zod13.z.number(),
2653
- output_tokens_details: import_zod13.z.object({ reasoning_tokens: import_zod13.z.number().nullish() }).nullish()
2655
+ var usageSchema2 = import_v413.z.object({
2656
+ input_tokens: import_v413.z.number(),
2657
+ input_tokens_details: import_v413.z.object({ cached_tokens: import_v413.z.number().nullish() }).nullish(),
2658
+ output_tokens: import_v413.z.number(),
2659
+ output_tokens_details: import_v413.z.object({ reasoning_tokens: import_v413.z.number().nullish() }).nullish()
2654
2660
  });
2655
- var textDeltaChunkSchema = import_zod13.z.object({
2656
- type: import_zod13.z.literal("response.output_text.delta"),
2657
- item_id: import_zod13.z.string(),
2658
- delta: import_zod13.z.string()
2661
+ var textDeltaChunkSchema = import_v413.z.object({
2662
+ type: import_v413.z.literal("response.output_text.delta"),
2663
+ item_id: import_v413.z.string(),
2664
+ delta: import_v413.z.string()
2659
2665
  });
2660
- var responseFinishedChunkSchema = import_zod13.z.object({
2661
- type: import_zod13.z.enum(["response.completed", "response.incomplete"]),
2662
- response: import_zod13.z.object({
2663
- incomplete_details: import_zod13.z.object({ reason: import_zod13.z.string() }).nullish(),
2666
+ var responseFinishedChunkSchema = import_v413.z.object({
2667
+ type: import_v413.z.enum(["response.completed", "response.incomplete"]),
2668
+ response: import_v413.z.object({
2669
+ incomplete_details: import_v413.z.object({ reason: import_v413.z.string() }).nullish(),
2664
2670
  usage: usageSchema2
2665
2671
  })
2666
2672
  });
2667
- var responseCreatedChunkSchema = import_zod13.z.object({
2668
- type: import_zod13.z.literal("response.created"),
2669
- response: import_zod13.z.object({
2670
- id: import_zod13.z.string(),
2671
- created_at: import_zod13.z.number(),
2672
- model: import_zod13.z.string()
2673
+ var responseCreatedChunkSchema = import_v413.z.object({
2674
+ type: import_v413.z.literal("response.created"),
2675
+ response: import_v413.z.object({
2676
+ id: import_v413.z.string(),
2677
+ created_at: import_v413.z.number(),
2678
+ model: import_v413.z.string()
2673
2679
  })
2674
2680
  });
2675
- var responseOutputItemAddedSchema = import_zod13.z.object({
2676
- type: import_zod13.z.literal("response.output_item.added"),
2677
- output_index: import_zod13.z.number(),
2678
- item: import_zod13.z.discriminatedUnion("type", [
2679
- import_zod13.z.object({
2680
- type: import_zod13.z.literal("message"),
2681
- id: import_zod13.z.string()
2681
+ var responseOutputItemAddedSchema = import_v413.z.object({
2682
+ type: import_v413.z.literal("response.output_item.added"),
2683
+ output_index: import_v413.z.number(),
2684
+ item: import_v413.z.discriminatedUnion("type", [
2685
+ import_v413.z.object({
2686
+ type: import_v413.z.literal("message"),
2687
+ id: import_v413.z.string()
2682
2688
  }),
2683
- import_zod13.z.object({
2684
- type: import_zod13.z.literal("reasoning"),
2685
- id: import_zod13.z.string()
2689
+ import_v413.z.object({
2690
+ type: import_v413.z.literal("reasoning"),
2691
+ id: import_v413.z.string()
2686
2692
  }),
2687
- import_zod13.z.object({
2688
- type: import_zod13.z.literal("function_call"),
2689
- id: import_zod13.z.string(),
2690
- call_id: import_zod13.z.string(),
2691
- name: import_zod13.z.string(),
2692
- arguments: import_zod13.z.string()
2693
+ import_v413.z.object({
2694
+ type: import_v413.z.literal("function_call"),
2695
+ id: import_v413.z.string(),
2696
+ call_id: import_v413.z.string(),
2697
+ name: import_v413.z.string(),
2698
+ arguments: import_v413.z.string()
2693
2699
  }),
2694
- import_zod13.z.object({
2695
- type: import_zod13.z.literal("web_search_call"),
2696
- id: import_zod13.z.string(),
2697
- status: import_zod13.z.string()
2700
+ import_v413.z.object({
2701
+ type: import_v413.z.literal("web_search_call"),
2702
+ id: import_v413.z.string(),
2703
+ status: import_v413.z.string()
2698
2704
  }),
2699
- import_zod13.z.object({
2700
- type: import_zod13.z.literal("computer_call"),
2701
- id: import_zod13.z.string(),
2702
- status: import_zod13.z.string()
2705
+ import_v413.z.object({
2706
+ type: import_v413.z.literal("computer_call"),
2707
+ id: import_v413.z.string(),
2708
+ status: import_v413.z.string()
2703
2709
  })
2704
2710
  ])
2705
2711
  });
2706
- var responseOutputItemDoneSchema = import_zod13.z.object({
2707
- type: import_zod13.z.literal("response.output_item.done"),
2708
- output_index: import_zod13.z.number(),
2709
- item: import_zod13.z.discriminatedUnion("type", [
2710
- import_zod13.z.object({
2711
- type: import_zod13.z.literal("message"),
2712
- id: import_zod13.z.string()
2712
+ var responseOutputItemDoneSchema = import_v413.z.object({
2713
+ type: import_v413.z.literal("response.output_item.done"),
2714
+ output_index: import_v413.z.number(),
2715
+ item: import_v413.z.discriminatedUnion("type", [
2716
+ import_v413.z.object({
2717
+ type: import_v413.z.literal("message"),
2718
+ id: import_v413.z.string()
2713
2719
  }),
2714
- import_zod13.z.object({
2715
- type: import_zod13.z.literal("reasoning"),
2716
- id: import_zod13.z.string()
2720
+ import_v413.z.object({
2721
+ type: import_v413.z.literal("reasoning"),
2722
+ id: import_v413.z.string()
2717
2723
  }),
2718
- import_zod13.z.object({
2719
- type: import_zod13.z.literal("function_call"),
2720
- id: import_zod13.z.string(),
2721
- call_id: import_zod13.z.string(),
2722
- name: import_zod13.z.string(),
2723
- arguments: import_zod13.z.string(),
2724
- status: import_zod13.z.literal("completed")
2724
+ import_v413.z.object({
2725
+ type: import_v413.z.literal("function_call"),
2726
+ id: import_v413.z.string(),
2727
+ call_id: import_v413.z.string(),
2728
+ name: import_v413.z.string(),
2729
+ arguments: import_v413.z.string(),
2730
+ status: import_v413.z.literal("completed")
2725
2731
  }),
2726
- import_zod13.z.object({
2727
- type: import_zod13.z.literal("web_search_call"),
2728
- id: import_zod13.z.string(),
2729
- status: import_zod13.z.literal("completed")
2732
+ import_v413.z.object({
2733
+ type: import_v413.z.literal("web_search_call"),
2734
+ id: import_v413.z.string(),
2735
+ status: import_v413.z.literal("completed")
2730
2736
  }),
2731
- import_zod13.z.object({
2732
- type: import_zod13.z.literal("computer_call"),
2733
- id: import_zod13.z.string(),
2734
- status: import_zod13.z.literal("completed")
2737
+ import_v413.z.object({
2738
+ type: import_v413.z.literal("computer_call"),
2739
+ id: import_v413.z.string(),
2740
+ status: import_v413.z.literal("completed")
2735
2741
  })
2736
2742
  ])
2737
2743
  });
2738
- var responseFunctionCallArgumentsDeltaSchema = import_zod13.z.object({
2739
- type: import_zod13.z.literal("response.function_call_arguments.delta"),
2740
- item_id: import_zod13.z.string(),
2741
- output_index: import_zod13.z.number(),
2742
- delta: import_zod13.z.string()
2744
+ var responseFunctionCallArgumentsDeltaSchema = import_v413.z.object({
2745
+ type: import_v413.z.literal("response.function_call_arguments.delta"),
2746
+ item_id: import_v413.z.string(),
2747
+ output_index: import_v413.z.number(),
2748
+ delta: import_v413.z.string()
2743
2749
  });
2744
- var responseAnnotationAddedSchema = import_zod13.z.object({
2745
- type: import_zod13.z.literal("response.output_text.annotation.added"),
2746
- annotation: import_zod13.z.object({
2747
- type: import_zod13.z.literal("url_citation"),
2748
- url: import_zod13.z.string(),
2749
- title: import_zod13.z.string()
2750
+ var responseAnnotationAddedSchema = import_v413.z.object({
2751
+ type: import_v413.z.literal("response.output_text.annotation.added"),
2752
+ annotation: import_v413.z.object({
2753
+ type: import_v413.z.literal("url_citation"),
2754
+ url: import_v413.z.string(),
2755
+ title: import_v413.z.string()
2750
2756
  })
2751
2757
  });
2752
- var responseReasoningSummaryTextDeltaSchema = import_zod13.z.object({
2753
- type: import_zod13.z.literal("response.reasoning_summary_text.delta"),
2754
- item_id: import_zod13.z.string(),
2755
- output_index: import_zod13.z.number(),
2756
- summary_index: import_zod13.z.number(),
2757
- delta: import_zod13.z.string()
2758
+ var responseReasoningSummaryTextDeltaSchema = import_v413.z.object({
2759
+ type: import_v413.z.literal("response.reasoning_summary_text.delta"),
2760
+ item_id: import_v413.z.string(),
2761
+ output_index: import_v413.z.number(),
2762
+ summary_index: import_v413.z.number(),
2763
+ delta: import_v413.z.string()
2758
2764
  });
2759
- var responseReasoningSummaryPartDoneSchema = import_zod13.z.object({
2760
- type: import_zod13.z.literal("response.reasoning_summary_part.done"),
2761
- item_id: import_zod13.z.string(),
2762
- output_index: import_zod13.z.number(),
2763
- summary_index: import_zod13.z.number(),
2764
- part: import_zod13.z.unknown().nullish()
2765
+ var responseReasoningSummaryPartDoneSchema = import_v413.z.object({
2766
+ type: import_v413.z.literal("response.reasoning_summary_part.done"),
2767
+ item_id: import_v413.z.string(),
2768
+ output_index: import_v413.z.number(),
2769
+ summary_index: import_v413.z.number(),
2770
+ part: import_v413.z.unknown().nullish()
2765
2771
  });
2766
- var openaiResponsesChunkSchema = import_zod13.z.union([
2772
+ var openaiResponsesChunkSchema = import_v413.z.union([
2767
2773
  textDeltaChunkSchema,
2768
2774
  responseFinishedChunkSchema,
2769
2775
  responseCreatedChunkSchema,
@@ -2773,7 +2779,7 @@ var openaiResponsesChunkSchema = import_zod13.z.union([
2773
2779
  responseAnnotationAddedSchema,
2774
2780
  responseReasoningSummaryTextDeltaSchema,
2775
2781
  responseReasoningSummaryPartDoneSchema,
2776
- import_zod13.z.object({ type: import_zod13.z.string() }).passthrough()
2782
+ import_v413.z.object({ type: import_v413.z.string() }).passthrough()
2777
2783
  // fallback for unknown chunks
2778
2784
  ]);
2779
2785
  function isTextDeltaChunk(chunk) {
@@ -2824,25 +2830,25 @@ function getResponsesModelConfig(modelId) {
2824
2830
  function supportsFlexProcessing2(modelId) {
2825
2831
  return modelId.startsWith("o3") || modelId.startsWith("o4-mini");
2826
2832
  }
2827
- var openaiResponsesProviderOptionsSchema = import_zod13.z.object({
2828
- metadata: import_zod13.z.any().nullish(),
2829
- parallelToolCalls: import_zod13.z.boolean().nullish(),
2830
- previousResponseId: import_zod13.z.string().nullish(),
2831
- store: import_zod13.z.boolean().nullish(),
2832
- user: import_zod13.z.string().nullish(),
2833
- reasoningEffort: import_zod13.z.string().nullish(),
2834
- strictSchemas: import_zod13.z.boolean().nullish(),
2835
- instructions: import_zod13.z.string().nullish(),
2836
- reasoningSummary: import_zod13.z.string().nullish(),
2837
- serviceTier: import_zod13.z.enum(["auto", "flex"]).nullish()
2833
+ var openaiResponsesProviderOptionsSchema = import_v413.z.object({
2834
+ metadata: import_v413.z.any().nullish(),
2835
+ parallelToolCalls: import_v413.z.boolean().nullish(),
2836
+ previousResponseId: import_v413.z.string().nullish(),
2837
+ store: import_v413.z.boolean().nullish(),
2838
+ user: import_v413.z.string().nullish(),
2839
+ reasoningEffort: import_v413.z.string().nullish(),
2840
+ strictJsonSchema: import_v413.z.boolean().nullish(),
2841
+ instructions: import_v413.z.string().nullish(),
2842
+ reasoningSummary: import_v413.z.string().nullish(),
2843
+ serviceTier: import_v413.z.enum(["auto", "flex"]).nullish()
2838
2844
  });
2839
2845
 
2840
2846
  // src/openai-speech-model.ts
2841
2847
  var import_provider_utils11 = require("@ai-sdk/provider-utils");
2842
- var import_zod14 = require("zod");
2843
- var OpenAIProviderOptionsSchema = import_zod14.z.object({
2844
- instructions: import_zod14.z.string().nullish(),
2845
- speed: import_zod14.z.number().min(0.25).max(4).default(1).nullish()
2848
+ var import_v414 = require("zod/v4");
2849
+ var OpenAIProviderOptionsSchema = import_v414.z.object({
2850
+ instructions: import_v414.z.string().nullish(),
2851
+ speed: import_v414.z.number().min(0.25).max(4).default(1).nullish()
2846
2852
  });
2847
2853
  var OpenAISpeechModel = class {
2848
2854
  constructor(modelId, config) {