@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.
@@ -39,7 +39,7 @@ module.exports = __toCommonJS(internal_exports);
39
39
  // src/openai-chat-language-model.ts
40
40
  var import_provider3 = require("@ai-sdk/provider");
41
41
  var import_provider_utils5 = require("@ai-sdk/provider-utils");
42
- var import_zod5 = require("zod");
42
+ var import_v45 = require("zod/v4");
43
43
 
44
44
  // src/convert-to-openai-chat-messages.ts
45
45
  var import_provider = require("@ai-sdk/provider");
@@ -250,15 +250,15 @@ function mapOpenAIFinishReason(finishReason) {
250
250
  }
251
251
 
252
252
  // src/openai-chat-options.ts
253
- var import_zod = require("zod");
254
- var openaiProviderOptions = import_zod.z.object({
253
+ var import_v4 = require("zod/v4");
254
+ var openaiProviderOptions = import_v4.z.object({
255
255
  /**
256
256
  * Modify the likelihood of specified tokens appearing in the completion.
257
257
  *
258
258
  * Accepts a JSON object that maps tokens (specified by their token ID in
259
259
  * the GPT tokenizer) to an associated bias value from -100 to 100.
260
260
  */
261
- logitBias: import_zod.z.record(import_zod.z.coerce.number(), import_zod.z.number()).optional(),
261
+ logitBias: import_v4.z.record(import_v4.z.coerce.number(), import_v4.z.number()).optional(),
262
262
  /**
263
263
  * Return the log probabilities of the tokens.
264
264
  *
@@ -268,63 +268,69 @@ var openaiProviderOptions = import_zod.z.object({
268
268
  * Setting to a number will return the log probabilities of the top n
269
269
  * tokens that were generated.
270
270
  */
271
- logprobs: import_zod.z.union([import_zod.z.boolean(), import_zod.z.number()]).optional(),
271
+ logprobs: import_v4.z.union([import_v4.z.boolean(), import_v4.z.number()]).optional(),
272
272
  /**
273
273
  * Whether to enable parallel function calling during tool use. Default to true.
274
274
  */
275
- parallelToolCalls: import_zod.z.boolean().optional(),
275
+ parallelToolCalls: import_v4.z.boolean().optional(),
276
276
  /**
277
277
  * A unique identifier representing your end-user, which can help OpenAI to
278
278
  * monitor and detect abuse.
279
279
  */
280
- user: import_zod.z.string().optional(),
280
+ user: import_v4.z.string().optional(),
281
281
  /**
282
282
  * Reasoning effort for reasoning models. Defaults to `medium`.
283
283
  */
284
- reasoningEffort: import_zod.z.enum(["low", "medium", "high"]).optional(),
284
+ reasoningEffort: import_v4.z.enum(["low", "medium", "high"]).optional(),
285
285
  /**
286
286
  * Maximum number of completion tokens to generate. Useful for reasoning models.
287
287
  */
288
- maxCompletionTokens: import_zod.z.number().optional(),
288
+ maxCompletionTokens: import_v4.z.number().optional(),
289
289
  /**
290
290
  * Whether to enable persistence in responses API.
291
291
  */
292
- store: import_zod.z.boolean().optional(),
292
+ store: import_v4.z.boolean().optional(),
293
293
  /**
294
294
  * Metadata to associate with the request.
295
295
  */
296
- metadata: import_zod.z.record(import_zod.z.string()).optional(),
296
+ metadata: import_v4.z.record(import_v4.z.string().max(64), import_v4.z.string().max(512)).optional(),
297
297
  /**
298
298
  * Parameters for prediction mode.
299
299
  */
300
- prediction: import_zod.z.record(import_zod.z.any()).optional(),
300
+ prediction: import_v4.z.record(import_v4.z.string(), import_v4.z.any()).optional(),
301
301
  /**
302
302
  * Whether to use structured outputs.
303
303
  *
304
304
  * @default true
305
305
  */
306
- structuredOutputs: import_zod.z.boolean().optional(),
306
+ structuredOutputs: import_v4.z.boolean().optional(),
307
307
  /**
308
308
  * Service tier for the request. Set to 'flex' for 50% cheaper processing
309
309
  * at the cost of increased latency. Only available for o3 and o4-mini models.
310
310
  *
311
311
  * @default 'auto'
312
312
  */
313
- serviceTier: import_zod.z.enum(["auto", "flex"]).optional()
313
+ serviceTier: import_v4.z.enum(["auto", "flex"]).optional(),
314
+ /**
315
+ * Whether to use strict JSON schema validation.
316
+ *
317
+ * @default true
318
+ */
319
+ strictJsonSchema: import_v4.z.boolean().optional()
314
320
  });
315
321
 
316
322
  // src/openai-error.ts
317
- var import_zod2 = require("zod");
323
+ var import_v42 = require("zod/v4");
318
324
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
319
- var openaiErrorDataSchema = import_zod2.z.object({
320
- error: import_zod2.z.object({
321
- message: import_zod2.z.string(),
325
+ var openaiErrorDataSchema = import_v42.z.object({
326
+ error: import_v42.z.object({
327
+ message: import_v42.z.string(),
322
328
  // The additional information below is handled loosely to support
323
329
  // OpenAI-compatible providers that have slightly different error
324
330
  // responses:
325
- type: import_zod2.z.string().nullish(),
326
- param: import_zod2.z.any().nullish(),
327
- code: import_zod2.z.union([import_zod2.z.string(), import_zod2.z.number()]).nullish()
331
+ type: import_v42.z.string().nullish(),
332
+ param: import_v42.z.any().nullish(),
333
+ code: import_v42.z.union([import_v42.z.string(), import_v42.z.number()]).nullish()
328
334
  })
329
335
  });
330
336
  var openaiFailedResponseHandler = (0, import_provider_utils2.createJsonErrorResponseHandler)({
@@ -337,77 +343,78 @@ var import_provider2 = require("@ai-sdk/provider");
337
343
 
338
344
  // src/tool/file-search.ts
339
345
  var import_provider_utils3 = require("@ai-sdk/provider-utils");
340
- var import_zod3 = require("zod");
341
- var fileSearchArgsSchema = import_zod3.z.object({
346
+ var import_v43 = require("zod/v4");
347
+ var fileSearchArgsSchema = import_v43.z.object({
342
348
  /**
343
349
  * List of vector store IDs to search through. If not provided, searches all available vector stores.
344
350
  */
345
- vectorStoreIds: import_zod3.z.array(import_zod3.z.string()).optional(),
351
+ vectorStoreIds: import_v43.z.array(import_v43.z.string()).optional(),
346
352
  /**
347
353
  * Maximum number of search results to return. Defaults to 10.
348
354
  */
349
- maxResults: import_zod3.z.number().optional(),
355
+ maxResults: import_v43.z.number().optional(),
350
356
  /**
351
357
  * Type of search to perform. Defaults to 'auto'.
352
358
  */
353
- searchType: import_zod3.z.enum(["auto", "keyword", "semantic"]).optional()
359
+ searchType: import_v43.z.enum(["auto", "keyword", "semantic"]).optional()
354
360
  });
355
361
  var fileSearch = (0, import_provider_utils3.createProviderDefinedToolFactory)({
356
362
  id: "openai.file_search",
357
363
  name: "file_search",
358
- inputSchema: import_zod3.z.object({
359
- query: import_zod3.z.string()
364
+ inputSchema: import_v43.z.object({
365
+ query: import_v43.z.string()
360
366
  })
361
367
  });
362
368
 
363
369
  // src/tool/web-search-preview.ts
364
370
  var import_provider_utils4 = require("@ai-sdk/provider-utils");
365
- var import_zod4 = require("zod");
366
- var webSearchPreviewArgsSchema = import_zod4.z.object({
371
+ var import_v44 = require("zod/v4");
372
+ var webSearchPreviewArgsSchema = import_v44.z.object({
367
373
  /**
368
374
  * Search context size to use for the web search.
369
375
  * - high: Most comprehensive context, highest cost, slower response
370
376
  * - medium: Balanced context, cost, and latency (default)
371
377
  * - low: Least context, lowest cost, fastest response
372
378
  */
373
- searchContextSize: import_zod4.z.enum(["low", "medium", "high"]).optional(),
379
+ searchContextSize: import_v44.z.enum(["low", "medium", "high"]).optional(),
374
380
  /**
375
381
  * User location information to provide geographically relevant search results.
376
382
  */
377
- userLocation: import_zod4.z.object({
383
+ userLocation: import_v44.z.object({
378
384
  /**
379
385
  * Type of location (always 'approximate')
380
386
  */
381
- type: import_zod4.z.literal("approximate"),
387
+ type: import_v44.z.literal("approximate"),
382
388
  /**
383
389
  * Two-letter ISO country code (e.g., 'US', 'GB')
384
390
  */
385
- country: import_zod4.z.string().optional(),
391
+ country: import_v44.z.string().optional(),
386
392
  /**
387
393
  * City name (free text, e.g., 'Minneapolis')
388
394
  */
389
- city: import_zod4.z.string().optional(),
395
+ city: import_v44.z.string().optional(),
390
396
  /**
391
397
  * Region name (free text, e.g., 'Minnesota')
392
398
  */
393
- region: import_zod4.z.string().optional(),
399
+ region: import_v44.z.string().optional(),
394
400
  /**
395
401
  * IANA timezone (e.g., 'America/Chicago')
396
402
  */
397
- timezone: import_zod4.z.string().optional()
403
+ timezone: import_v44.z.string().optional()
398
404
  }).optional()
399
405
  });
400
406
  var webSearchPreview = (0, import_provider_utils4.createProviderDefinedToolFactory)({
401
407
  id: "openai.web_search_preview",
402
408
  name: "web_search_preview",
403
- inputSchema: import_zod4.z.object({})
409
+ inputSchema: import_v44.z.object({})
404
410
  });
405
411
 
406
412
  // src/openai-prepare-tools.ts
407
413
  function prepareTools({
408
414
  tools,
409
415
  toolChoice,
410
- structuredOutputs
416
+ structuredOutputs,
417
+ strictJsonSchema
411
418
  }) {
412
419
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
413
420
  const toolWarnings = [];
@@ -424,7 +431,7 @@ function prepareTools({
424
431
  name: tool.name,
425
432
  description: tool.description,
426
433
  parameters: tool.inputSchema,
427
- strict: structuredOutputs ? true : void 0
434
+ strict: structuredOutputs ? strictJsonSchema : void 0
428
435
  }
429
436
  });
430
437
  break;
@@ -516,7 +523,7 @@ var OpenAIChatLanguageModel = class {
516
523
  toolChoice,
517
524
  providerOptions
518
525
  }) {
519
- var _a, _b, _c;
526
+ var _a, _b, _c, _d;
520
527
  const warnings = [];
521
528
  const openaiOptions = (_a = await (0, import_provider_utils5.parseProviderOptions)({
522
529
  provider: "openai",
@@ -544,6 +551,7 @@ var OpenAIChatLanguageModel = class {
544
551
  }
545
552
  );
546
553
  warnings.push(...messageWarnings);
554
+ const strictJsonSchema = (_c = openaiOptions.strictJsonSchema) != null ? _c : false;
547
555
  const baseArgs = {
548
556
  // model id:
549
557
  model: this.modelId,
@@ -559,18 +567,15 @@ var OpenAIChatLanguageModel = class {
559
567
  top_p: topP,
560
568
  frequency_penalty: frequencyPenalty,
561
569
  presence_penalty: presencePenalty,
562
- response_format: (responseFormat == null ? void 0 : responseFormat.type) === "json" ? (
563
- // TODO convert into provider option
564
- structuredOutputs && responseFormat.schema != null ? {
565
- type: "json_schema",
566
- json_schema: {
567
- schema: responseFormat.schema,
568
- strict: true,
569
- name: (_c = responseFormat.name) != null ? _c : "response",
570
- description: responseFormat.description
571
- }
572
- } : { type: "json_object" }
573
- ) : void 0,
570
+ response_format: (responseFormat == null ? void 0 : responseFormat.type) === "json" ? structuredOutputs && responseFormat.schema != null ? {
571
+ type: "json_schema",
572
+ json_schema: {
573
+ schema: responseFormat.schema,
574
+ strict: strictJsonSchema,
575
+ name: (_d = responseFormat.name) != null ? _d : "response",
576
+ description: responseFormat.description
577
+ }
578
+ } : { type: "json_object" } : void 0,
574
579
  stop: stopSequences,
575
580
  seed,
576
581
  // openai specific settings:
@@ -669,7 +674,8 @@ var OpenAIChatLanguageModel = class {
669
674
  } = prepareTools({
670
675
  tools,
671
676
  toolChoice,
672
- structuredOutputs
677
+ structuredOutputs,
678
+ strictJsonSchema
673
679
  });
674
680
  return {
675
681
  args: {
@@ -951,97 +957,97 @@ var OpenAIChatLanguageModel = class {
951
957
  };
952
958
  }
953
959
  };
954
- var openaiTokenUsageSchema = import_zod5.z.object({
955
- prompt_tokens: import_zod5.z.number().nullish(),
956
- completion_tokens: import_zod5.z.number().nullish(),
957
- total_tokens: import_zod5.z.number().nullish(),
958
- prompt_tokens_details: import_zod5.z.object({
959
- cached_tokens: import_zod5.z.number().nullish()
960
+ var openaiTokenUsageSchema = import_v45.z.object({
961
+ prompt_tokens: import_v45.z.number().nullish(),
962
+ completion_tokens: import_v45.z.number().nullish(),
963
+ total_tokens: import_v45.z.number().nullish(),
964
+ prompt_tokens_details: import_v45.z.object({
965
+ cached_tokens: import_v45.z.number().nullish()
960
966
  }).nullish(),
961
- completion_tokens_details: import_zod5.z.object({
962
- reasoning_tokens: import_zod5.z.number().nullish(),
963
- accepted_prediction_tokens: import_zod5.z.number().nullish(),
964
- rejected_prediction_tokens: import_zod5.z.number().nullish()
967
+ completion_tokens_details: import_v45.z.object({
968
+ reasoning_tokens: import_v45.z.number().nullish(),
969
+ accepted_prediction_tokens: import_v45.z.number().nullish(),
970
+ rejected_prediction_tokens: import_v45.z.number().nullish()
965
971
  }).nullish()
966
972
  }).nullish();
967
- var openaiChatResponseSchema = import_zod5.z.object({
968
- id: import_zod5.z.string().nullish(),
969
- created: import_zod5.z.number().nullish(),
970
- model: import_zod5.z.string().nullish(),
971
- choices: import_zod5.z.array(
972
- import_zod5.z.object({
973
- message: import_zod5.z.object({
974
- role: import_zod5.z.literal("assistant").nullish(),
975
- content: import_zod5.z.string().nullish(),
976
- tool_calls: import_zod5.z.array(
977
- import_zod5.z.object({
978
- id: import_zod5.z.string().nullish(),
979
- type: import_zod5.z.literal("function"),
980
- function: import_zod5.z.object({
981
- name: import_zod5.z.string(),
982
- arguments: import_zod5.z.string()
973
+ var openaiChatResponseSchema = import_v45.z.object({
974
+ id: import_v45.z.string().nullish(),
975
+ created: import_v45.z.number().nullish(),
976
+ model: import_v45.z.string().nullish(),
977
+ choices: import_v45.z.array(
978
+ import_v45.z.object({
979
+ message: import_v45.z.object({
980
+ role: import_v45.z.literal("assistant").nullish(),
981
+ content: import_v45.z.string().nullish(),
982
+ tool_calls: import_v45.z.array(
983
+ import_v45.z.object({
984
+ id: import_v45.z.string().nullish(),
985
+ type: import_v45.z.literal("function"),
986
+ function: import_v45.z.object({
987
+ name: import_v45.z.string(),
988
+ arguments: import_v45.z.string()
983
989
  })
984
990
  })
985
991
  ).nullish()
986
992
  }),
987
- index: import_zod5.z.number(),
988
- logprobs: import_zod5.z.object({
989
- content: import_zod5.z.array(
990
- import_zod5.z.object({
991
- token: import_zod5.z.string(),
992
- logprob: import_zod5.z.number(),
993
- top_logprobs: import_zod5.z.array(
994
- import_zod5.z.object({
995
- token: import_zod5.z.string(),
996
- logprob: import_zod5.z.number()
993
+ index: import_v45.z.number(),
994
+ logprobs: import_v45.z.object({
995
+ content: import_v45.z.array(
996
+ import_v45.z.object({
997
+ token: import_v45.z.string(),
998
+ logprob: import_v45.z.number(),
999
+ top_logprobs: import_v45.z.array(
1000
+ import_v45.z.object({
1001
+ token: import_v45.z.string(),
1002
+ logprob: import_v45.z.number()
997
1003
  })
998
1004
  )
999
1005
  })
1000
1006
  ).nullish()
1001
1007
  }).nullish(),
1002
- finish_reason: import_zod5.z.string().nullish()
1008
+ finish_reason: import_v45.z.string().nullish()
1003
1009
  })
1004
1010
  ),
1005
1011
  usage: openaiTokenUsageSchema
1006
1012
  });
1007
- var openaiChatChunkSchema = import_zod5.z.union([
1008
- import_zod5.z.object({
1009
- id: import_zod5.z.string().nullish(),
1010
- created: import_zod5.z.number().nullish(),
1011
- model: import_zod5.z.string().nullish(),
1012
- choices: import_zod5.z.array(
1013
- import_zod5.z.object({
1014
- delta: import_zod5.z.object({
1015
- role: import_zod5.z.enum(["assistant"]).nullish(),
1016
- content: import_zod5.z.string().nullish(),
1017
- tool_calls: import_zod5.z.array(
1018
- import_zod5.z.object({
1019
- index: import_zod5.z.number(),
1020
- id: import_zod5.z.string().nullish(),
1021
- type: import_zod5.z.literal("function").nullish(),
1022
- function: import_zod5.z.object({
1023
- name: import_zod5.z.string().nullish(),
1024
- arguments: import_zod5.z.string().nullish()
1013
+ var openaiChatChunkSchema = import_v45.z.union([
1014
+ import_v45.z.object({
1015
+ id: import_v45.z.string().nullish(),
1016
+ created: import_v45.z.number().nullish(),
1017
+ model: import_v45.z.string().nullish(),
1018
+ choices: import_v45.z.array(
1019
+ import_v45.z.object({
1020
+ delta: import_v45.z.object({
1021
+ role: import_v45.z.enum(["assistant"]).nullish(),
1022
+ content: import_v45.z.string().nullish(),
1023
+ tool_calls: import_v45.z.array(
1024
+ import_v45.z.object({
1025
+ index: import_v45.z.number(),
1026
+ id: import_v45.z.string().nullish(),
1027
+ type: import_v45.z.literal("function").nullish(),
1028
+ function: import_v45.z.object({
1029
+ name: import_v45.z.string().nullish(),
1030
+ arguments: import_v45.z.string().nullish()
1025
1031
  })
1026
1032
  })
1027
1033
  ).nullish()
1028
1034
  }).nullish(),
1029
- logprobs: import_zod5.z.object({
1030
- content: import_zod5.z.array(
1031
- import_zod5.z.object({
1032
- token: import_zod5.z.string(),
1033
- logprob: import_zod5.z.number(),
1034
- top_logprobs: import_zod5.z.array(
1035
- import_zod5.z.object({
1036
- token: import_zod5.z.string(),
1037
- logprob: import_zod5.z.number()
1035
+ logprobs: import_v45.z.object({
1036
+ content: import_v45.z.array(
1037
+ import_v45.z.object({
1038
+ token: import_v45.z.string(),
1039
+ logprob: import_v45.z.number(),
1040
+ top_logprobs: import_v45.z.array(
1041
+ import_v45.z.object({
1042
+ token: import_v45.z.string(),
1043
+ logprob: import_v45.z.number()
1038
1044
  })
1039
1045
  )
1040
1046
  })
1041
1047
  ).nullish()
1042
1048
  }).nullish(),
1043
- finish_reason: import_zod5.z.string().nullish(),
1044
- index: import_zod5.z.number()
1049
+ finish_reason: import_v45.z.string().nullish(),
1050
+ index: import_v45.z.number()
1045
1051
  })
1046
1052
  ),
1047
1053
  usage: openaiTokenUsageSchema
@@ -1096,7 +1102,7 @@ var reasoningModels = {
1096
1102
 
1097
1103
  // src/openai-completion-language-model.ts
1098
1104
  var import_provider_utils6 = require("@ai-sdk/provider-utils");
1099
- var import_zod7 = require("zod");
1105
+ var import_v47 = require("zod/v4");
1100
1106
 
1101
1107
  // src/convert-to-openai-completion-prompt.ts
1102
1108
  var import_provider4 = require("@ai-sdk/provider");
@@ -1174,12 +1180,12 @@ ${user}:`]
1174
1180
  }
1175
1181
 
1176
1182
  // src/openai-completion-options.ts
1177
- var import_zod6 = require("zod");
1178
- var openaiCompletionProviderOptions = import_zod6.z.object({
1183
+ var import_v46 = require("zod/v4");
1184
+ var openaiCompletionProviderOptions = import_v46.z.object({
1179
1185
  /**
1180
1186
  Echo back the prompt in addition to the completion.
1181
1187
  */
1182
- echo: import_zod6.z.boolean().optional(),
1188
+ echo: import_v46.z.boolean().optional(),
1183
1189
  /**
1184
1190
  Modify the likelihood of specified tokens appearing in the completion.
1185
1191
 
@@ -1194,16 +1200,16 @@ var openaiCompletionProviderOptions = import_zod6.z.object({
1194
1200
  As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
1195
1201
  token from being generated.
1196
1202
  */
1197
- logitBias: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.number()).optional(),
1203
+ logitBias: import_v46.z.record(import_v46.z.string(), import_v46.z.number()).optional(),
1198
1204
  /**
1199
1205
  The suffix that comes after a completion of inserted text.
1200
1206
  */
1201
- suffix: import_zod6.z.string().optional(),
1207
+ suffix: import_v46.z.string().optional(),
1202
1208
  /**
1203
1209
  A unique identifier representing your end-user, which can help OpenAI to
1204
1210
  monitor and detect abuse. Learn more.
1205
1211
  */
1206
- user: import_zod6.z.string().optional(),
1212
+ user: import_v46.z.string().optional(),
1207
1213
  /**
1208
1214
  Return the log probabilities of the tokens. Including logprobs will increase
1209
1215
  the response size and can slow down response times. However, it can
@@ -1213,7 +1219,7 @@ var openaiCompletionProviderOptions = import_zod6.z.object({
1213
1219
  Setting to a number will return the log probabilities of the top n
1214
1220
  tokens that were generated.
1215
1221
  */
1216
- logprobs: import_zod6.z.union([import_zod6.z.boolean(), import_zod6.z.number()]).optional()
1222
+ logprobs: import_v46.z.union([import_v46.z.boolean(), import_v46.z.number()]).optional()
1217
1223
  });
1218
1224
 
1219
1225
  // src/openai-completion-language-model.ts
@@ -1445,42 +1451,42 @@ var OpenAICompletionLanguageModel = class {
1445
1451
  };
1446
1452
  }
1447
1453
  };
1448
- var usageSchema = import_zod7.z.object({
1449
- prompt_tokens: import_zod7.z.number(),
1450
- completion_tokens: import_zod7.z.number(),
1451
- total_tokens: import_zod7.z.number()
1454
+ var usageSchema = import_v47.z.object({
1455
+ prompt_tokens: import_v47.z.number(),
1456
+ completion_tokens: import_v47.z.number(),
1457
+ total_tokens: import_v47.z.number()
1452
1458
  });
1453
- var openaiCompletionResponseSchema = import_zod7.z.object({
1454
- id: import_zod7.z.string().nullish(),
1455
- created: import_zod7.z.number().nullish(),
1456
- model: import_zod7.z.string().nullish(),
1457
- choices: import_zod7.z.array(
1458
- import_zod7.z.object({
1459
- text: import_zod7.z.string(),
1460
- finish_reason: import_zod7.z.string(),
1461
- logprobs: import_zod7.z.object({
1462
- tokens: import_zod7.z.array(import_zod7.z.string()),
1463
- token_logprobs: import_zod7.z.array(import_zod7.z.number()),
1464
- top_logprobs: import_zod7.z.array(import_zod7.z.record(import_zod7.z.string(), import_zod7.z.number())).nullish()
1459
+ var openaiCompletionResponseSchema = import_v47.z.object({
1460
+ id: import_v47.z.string().nullish(),
1461
+ created: import_v47.z.number().nullish(),
1462
+ model: import_v47.z.string().nullish(),
1463
+ choices: import_v47.z.array(
1464
+ import_v47.z.object({
1465
+ text: import_v47.z.string(),
1466
+ finish_reason: import_v47.z.string(),
1467
+ logprobs: import_v47.z.object({
1468
+ tokens: import_v47.z.array(import_v47.z.string()),
1469
+ token_logprobs: import_v47.z.array(import_v47.z.number()),
1470
+ top_logprobs: import_v47.z.array(import_v47.z.record(import_v47.z.string(), import_v47.z.number())).nullish()
1465
1471
  }).nullish()
1466
1472
  })
1467
1473
  ),
1468
1474
  usage: usageSchema.nullish()
1469
1475
  });
1470
- var openaiCompletionChunkSchema = import_zod7.z.union([
1471
- import_zod7.z.object({
1472
- id: import_zod7.z.string().nullish(),
1473
- created: import_zod7.z.number().nullish(),
1474
- model: import_zod7.z.string().nullish(),
1475
- choices: import_zod7.z.array(
1476
- import_zod7.z.object({
1477
- text: import_zod7.z.string(),
1478
- finish_reason: import_zod7.z.string().nullish(),
1479
- index: import_zod7.z.number(),
1480
- logprobs: import_zod7.z.object({
1481
- tokens: import_zod7.z.array(import_zod7.z.string()),
1482
- token_logprobs: import_zod7.z.array(import_zod7.z.number()),
1483
- top_logprobs: import_zod7.z.array(import_zod7.z.record(import_zod7.z.string(), import_zod7.z.number())).nullish()
1476
+ var openaiCompletionChunkSchema = import_v47.z.union([
1477
+ import_v47.z.object({
1478
+ id: import_v47.z.string().nullish(),
1479
+ created: import_v47.z.number().nullish(),
1480
+ model: import_v47.z.string().nullish(),
1481
+ choices: import_v47.z.array(
1482
+ import_v47.z.object({
1483
+ text: import_v47.z.string(),
1484
+ finish_reason: import_v47.z.string().nullish(),
1485
+ index: import_v47.z.number(),
1486
+ logprobs: import_v47.z.object({
1487
+ tokens: import_v47.z.array(import_v47.z.string()),
1488
+ token_logprobs: import_v47.z.array(import_v47.z.number()),
1489
+ top_logprobs: import_v47.z.array(import_v47.z.record(import_v47.z.string(), import_v47.z.number())).nullish()
1484
1490
  }).nullish()
1485
1491
  })
1486
1492
  ),
@@ -1492,21 +1498,21 @@ var openaiCompletionChunkSchema = import_zod7.z.union([
1492
1498
  // src/openai-embedding-model.ts
1493
1499
  var import_provider5 = require("@ai-sdk/provider");
1494
1500
  var import_provider_utils7 = require("@ai-sdk/provider-utils");
1495
- var import_zod9 = require("zod");
1501
+ var import_v49 = require("zod/v4");
1496
1502
 
1497
1503
  // src/openai-embedding-options.ts
1498
- var import_zod8 = require("zod");
1499
- var openaiEmbeddingProviderOptions = import_zod8.z.object({
1504
+ var import_v48 = require("zod/v4");
1505
+ var openaiEmbeddingProviderOptions = import_v48.z.object({
1500
1506
  /**
1501
1507
  The number of dimensions the resulting output embeddings should have.
1502
1508
  Only supported in text-embedding-3 and later models.
1503
1509
  */
1504
- dimensions: import_zod8.z.number().optional(),
1510
+ dimensions: import_v48.z.number().optional(),
1505
1511
  /**
1506
1512
  A unique identifier representing your end-user, which can help OpenAI to
1507
1513
  monitor and detect abuse. Learn more.
1508
1514
  */
1509
- user: import_zod8.z.string().optional()
1515
+ user: import_v48.z.string().optional()
1510
1516
  });
1511
1517
 
1512
1518
  // src/openai-embedding-model.ts
@@ -1572,14 +1578,14 @@ var OpenAIEmbeddingModel = class {
1572
1578
  };
1573
1579
  }
1574
1580
  };
1575
- var openaiTextEmbeddingResponseSchema = import_zod9.z.object({
1576
- data: import_zod9.z.array(import_zod9.z.object({ embedding: import_zod9.z.array(import_zod9.z.number()) })),
1577
- usage: import_zod9.z.object({ prompt_tokens: import_zod9.z.number() }).nullish()
1581
+ var openaiTextEmbeddingResponseSchema = import_v49.z.object({
1582
+ data: import_v49.z.array(import_v49.z.object({ embedding: import_v49.z.array(import_v49.z.number()) })),
1583
+ usage: import_v49.z.object({ prompt_tokens: import_v49.z.number() }).nullish()
1578
1584
  });
1579
1585
 
1580
1586
  // src/openai-image-model.ts
1581
1587
  var import_provider_utils8 = require("@ai-sdk/provider-utils");
1582
- var import_zod10 = require("zod");
1588
+ var import_v410 = require("zod/v4");
1583
1589
 
1584
1590
  // src/openai-image-settings.ts
1585
1591
  var modelMaxImagesPerCall = {
@@ -1667,41 +1673,41 @@ var OpenAIImageModel = class {
1667
1673
  };
1668
1674
  }
1669
1675
  };
1670
- var openaiImageResponseSchema = import_zod10.z.object({
1671
- data: import_zod10.z.array(
1672
- import_zod10.z.object({ b64_json: import_zod10.z.string(), revised_prompt: import_zod10.z.string().optional() })
1676
+ var openaiImageResponseSchema = import_v410.z.object({
1677
+ data: import_v410.z.array(
1678
+ import_v410.z.object({ b64_json: import_v410.z.string(), revised_prompt: import_v410.z.string().optional() })
1673
1679
  )
1674
1680
  });
1675
1681
 
1676
1682
  // src/openai-transcription-model.ts
1677
1683
  var import_provider_utils9 = require("@ai-sdk/provider-utils");
1678
- var import_zod12 = require("zod");
1684
+ var import_v412 = require("zod/v4");
1679
1685
 
1680
1686
  // src/openai-transcription-options.ts
1681
- var import_zod11 = require("zod");
1682
- var openAITranscriptionProviderOptions = import_zod11.z.object({
1687
+ var import_v411 = require("zod/v4");
1688
+ var openAITranscriptionProviderOptions = import_v411.z.object({
1683
1689
  /**
1684
1690
  * Additional information to include in the transcription response.
1685
1691
  */
1686
- include: import_zod11.z.array(import_zod11.z.string()).optional(),
1692
+ include: import_v411.z.array(import_v411.z.string()).optional(),
1687
1693
  /**
1688
1694
  * The language of the input audio in ISO-639-1 format.
1689
1695
  */
1690
- language: import_zod11.z.string().optional(),
1696
+ language: import_v411.z.string().optional(),
1691
1697
  /**
1692
1698
  * An optional text to guide the model's style or continue a previous audio segment.
1693
1699
  */
1694
- prompt: import_zod11.z.string().optional(),
1700
+ prompt: import_v411.z.string().optional(),
1695
1701
  /**
1696
1702
  * The sampling temperature, between 0 and 1.
1697
1703
  * @default 0
1698
1704
  */
1699
- temperature: import_zod11.z.number().min(0).max(1).default(0).optional(),
1705
+ temperature: import_v411.z.number().min(0).max(1).default(0).optional(),
1700
1706
  /**
1701
1707
  * The timestamp granularities to populate for this transcription.
1702
1708
  * @default ['segment']
1703
1709
  */
1704
- timestampGranularities: import_zod11.z.array(import_zod11.z.enum(["word", "segment"])).default(["segment"]).optional()
1710
+ timestampGranularities: import_v411.z.array(import_v411.z.enum(["word", "segment"])).default(["segment"]).optional()
1705
1711
  });
1706
1712
 
1707
1713
  // src/openai-transcription-model.ts
@@ -1849,25 +1855,25 @@ var OpenAITranscriptionModel = class {
1849
1855
  };
1850
1856
  }
1851
1857
  };
1852
- var openaiTranscriptionResponseSchema = import_zod12.z.object({
1853
- text: import_zod12.z.string(),
1854
- language: import_zod12.z.string().nullish(),
1855
- duration: import_zod12.z.number().nullish(),
1856
- words: import_zod12.z.array(
1857
- import_zod12.z.object({
1858
- word: import_zod12.z.string(),
1859
- start: import_zod12.z.number(),
1860
- end: import_zod12.z.number()
1858
+ var openaiTranscriptionResponseSchema = import_v412.z.object({
1859
+ text: import_v412.z.string(),
1860
+ language: import_v412.z.string().nullish(),
1861
+ duration: import_v412.z.number().nullish(),
1862
+ words: import_v412.z.array(
1863
+ import_v412.z.object({
1864
+ word: import_v412.z.string(),
1865
+ start: import_v412.z.number(),
1866
+ end: import_v412.z.number()
1861
1867
  })
1862
1868
  ).nullish()
1863
1869
  });
1864
1870
 
1865
1871
  // src/openai-speech-model.ts
1866
1872
  var import_provider_utils10 = require("@ai-sdk/provider-utils");
1867
- var import_zod13 = require("zod");
1868
- var OpenAIProviderOptionsSchema = import_zod13.z.object({
1869
- instructions: import_zod13.z.string().nullish(),
1870
- speed: import_zod13.z.number().min(0.25).max(4).default(1).nullish()
1873
+ var import_v413 = require("zod/v4");
1874
+ var OpenAIProviderOptionsSchema = import_v413.z.object({
1875
+ instructions: import_v413.z.string().nullish(),
1876
+ speed: import_v413.z.number().min(0.25).max(4).default(1).nullish()
1871
1877
  });
1872
1878
  var OpenAISpeechModel = class {
1873
1879
  constructor(modelId, config) {
@@ -1971,7 +1977,7 @@ var OpenAISpeechModel = class {
1971
1977
 
1972
1978
  // src/responses/openai-responses-language-model.ts
1973
1979
  var import_provider_utils11 = require("@ai-sdk/provider-utils");
1974
- var import_zod14 = require("zod");
1980
+ var import_v414 = require("zod/v4");
1975
1981
 
1976
1982
  // src/responses/convert-to-openai-responses-messages.ts
1977
1983
  var import_provider6 = require("@ai-sdk/provider");
@@ -2137,7 +2143,7 @@ var import_provider7 = require("@ai-sdk/provider");
2137
2143
  function prepareResponsesTools({
2138
2144
  tools,
2139
2145
  toolChoice,
2140
- strict
2146
+ strictJsonSchema
2141
2147
  }) {
2142
2148
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
2143
2149
  const toolWarnings = [];
@@ -2153,7 +2159,7 @@ function prepareResponsesTools({
2153
2159
  name: tool.name,
2154
2160
  description: tool.description,
2155
2161
  parameters: tool.inputSchema,
2156
- strict: strict ? true : void 0
2162
+ strict: strictJsonSchema
2157
2163
  });
2158
2164
  break;
2159
2165
  case "provider-defined":
@@ -2261,7 +2267,7 @@ var OpenAIResponsesLanguageModel = class {
2261
2267
  providerOptions,
2262
2268
  schema: openaiResponsesProviderOptionsSchema
2263
2269
  });
2264
- const isStrict = (_a = openaiOptions == null ? void 0 : openaiOptions.strictSchemas) != null ? _a : true;
2270
+ const strictJsonSchema = (_a = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _a : false;
2265
2271
  const baseArgs = {
2266
2272
  model: this.modelId,
2267
2273
  input: messages,
@@ -2272,7 +2278,7 @@ var OpenAIResponsesLanguageModel = class {
2272
2278
  text: {
2273
2279
  format: responseFormat.schema != null ? {
2274
2280
  type: "json_schema",
2275
- strict: isStrict,
2281
+ strict: strictJsonSchema,
2276
2282
  name: (_b = responseFormat.name) != null ? _b : "response",
2277
2283
  description: responseFormat.description,
2278
2284
  schema: responseFormat.schema
@@ -2335,7 +2341,7 @@ var OpenAIResponsesLanguageModel = class {
2335
2341
  } = prepareResponsesTools({
2336
2342
  tools,
2337
2343
  toolChoice,
2338
- strict: isStrict
2344
+ strictJsonSchema
2339
2345
  });
2340
2346
  return {
2341
2347
  args: {
@@ -2362,59 +2368,59 @@ var OpenAIResponsesLanguageModel = class {
2362
2368
  body,
2363
2369
  failedResponseHandler: openaiFailedResponseHandler,
2364
2370
  successfulResponseHandler: (0, import_provider_utils11.createJsonResponseHandler)(
2365
- import_zod14.z.object({
2366
- id: import_zod14.z.string(),
2367
- created_at: import_zod14.z.number(),
2368
- model: import_zod14.z.string(),
2369
- output: import_zod14.z.array(
2370
- import_zod14.z.discriminatedUnion("type", [
2371
- import_zod14.z.object({
2372
- type: import_zod14.z.literal("message"),
2373
- role: import_zod14.z.literal("assistant"),
2374
- content: import_zod14.z.array(
2375
- import_zod14.z.object({
2376
- type: import_zod14.z.literal("output_text"),
2377
- text: import_zod14.z.string(),
2378
- annotations: import_zod14.z.array(
2379
- import_zod14.z.object({
2380
- type: import_zod14.z.literal("url_citation"),
2381
- start_index: import_zod14.z.number(),
2382
- end_index: import_zod14.z.number(),
2383
- url: import_zod14.z.string(),
2384
- title: import_zod14.z.string()
2371
+ import_v414.z.object({
2372
+ id: import_v414.z.string(),
2373
+ created_at: import_v414.z.number(),
2374
+ model: import_v414.z.string(),
2375
+ output: import_v414.z.array(
2376
+ import_v414.z.discriminatedUnion("type", [
2377
+ import_v414.z.object({
2378
+ type: import_v414.z.literal("message"),
2379
+ role: import_v414.z.literal("assistant"),
2380
+ content: import_v414.z.array(
2381
+ import_v414.z.object({
2382
+ type: import_v414.z.literal("output_text"),
2383
+ text: import_v414.z.string(),
2384
+ annotations: import_v414.z.array(
2385
+ import_v414.z.object({
2386
+ type: import_v414.z.literal("url_citation"),
2387
+ start_index: import_v414.z.number(),
2388
+ end_index: import_v414.z.number(),
2389
+ url: import_v414.z.string(),
2390
+ title: import_v414.z.string()
2385
2391
  })
2386
2392
  )
2387
2393
  })
2388
2394
  )
2389
2395
  }),
2390
- import_zod14.z.object({
2391
- type: import_zod14.z.literal("function_call"),
2392
- call_id: import_zod14.z.string(),
2393
- name: import_zod14.z.string(),
2394
- arguments: import_zod14.z.string()
2396
+ import_v414.z.object({
2397
+ type: import_v414.z.literal("function_call"),
2398
+ call_id: import_v414.z.string(),
2399
+ name: import_v414.z.string(),
2400
+ arguments: import_v414.z.string()
2395
2401
  }),
2396
- import_zod14.z.object({
2397
- type: import_zod14.z.literal("web_search_call"),
2398
- id: import_zod14.z.string(),
2399
- status: import_zod14.z.string().optional()
2402
+ import_v414.z.object({
2403
+ type: import_v414.z.literal("web_search_call"),
2404
+ id: import_v414.z.string(),
2405
+ status: import_v414.z.string().optional()
2400
2406
  }),
2401
- import_zod14.z.object({
2402
- type: import_zod14.z.literal("computer_call"),
2403
- id: import_zod14.z.string(),
2404
- status: import_zod14.z.string().optional()
2407
+ import_v414.z.object({
2408
+ type: import_v414.z.literal("computer_call"),
2409
+ id: import_v414.z.string(),
2410
+ status: import_v414.z.string().optional()
2405
2411
  }),
2406
- import_zod14.z.object({
2407
- type: import_zod14.z.literal("reasoning"),
2408
- summary: import_zod14.z.array(
2409
- import_zod14.z.object({
2410
- type: import_zod14.z.literal("summary_text"),
2411
- text: import_zod14.z.string()
2412
+ import_v414.z.object({
2413
+ type: import_v414.z.literal("reasoning"),
2414
+ summary: import_v414.z.array(
2415
+ import_v414.z.object({
2416
+ type: import_v414.z.literal("summary_text"),
2417
+ text: import_v414.z.string()
2412
2418
  })
2413
2419
  )
2414
2420
  })
2415
2421
  ])
2416
2422
  ),
2417
- incomplete_details: import_zod14.z.object({ reason: import_zod14.z.string() }).nullable(),
2423
+ incomplete_details: import_v414.z.object({ reason: import_v414.z.string() }).nullable(),
2418
2424
  usage: usageSchema2
2419
2425
  })
2420
2426
  ),
@@ -2755,124 +2761,124 @@ var OpenAIResponsesLanguageModel = class {
2755
2761
  };
2756
2762
  }
2757
2763
  };
2758
- var usageSchema2 = import_zod14.z.object({
2759
- input_tokens: import_zod14.z.number(),
2760
- input_tokens_details: import_zod14.z.object({ cached_tokens: import_zod14.z.number().nullish() }).nullish(),
2761
- output_tokens: import_zod14.z.number(),
2762
- output_tokens_details: import_zod14.z.object({ reasoning_tokens: import_zod14.z.number().nullish() }).nullish()
2764
+ var usageSchema2 = import_v414.z.object({
2765
+ input_tokens: import_v414.z.number(),
2766
+ input_tokens_details: import_v414.z.object({ cached_tokens: import_v414.z.number().nullish() }).nullish(),
2767
+ output_tokens: import_v414.z.number(),
2768
+ output_tokens_details: import_v414.z.object({ reasoning_tokens: import_v414.z.number().nullish() }).nullish()
2763
2769
  });
2764
- var textDeltaChunkSchema = import_zod14.z.object({
2765
- type: import_zod14.z.literal("response.output_text.delta"),
2766
- item_id: import_zod14.z.string(),
2767
- delta: import_zod14.z.string()
2770
+ var textDeltaChunkSchema = import_v414.z.object({
2771
+ type: import_v414.z.literal("response.output_text.delta"),
2772
+ item_id: import_v414.z.string(),
2773
+ delta: import_v414.z.string()
2768
2774
  });
2769
- var responseFinishedChunkSchema = import_zod14.z.object({
2770
- type: import_zod14.z.enum(["response.completed", "response.incomplete"]),
2771
- response: import_zod14.z.object({
2772
- incomplete_details: import_zod14.z.object({ reason: import_zod14.z.string() }).nullish(),
2775
+ var responseFinishedChunkSchema = import_v414.z.object({
2776
+ type: import_v414.z.enum(["response.completed", "response.incomplete"]),
2777
+ response: import_v414.z.object({
2778
+ incomplete_details: import_v414.z.object({ reason: import_v414.z.string() }).nullish(),
2773
2779
  usage: usageSchema2
2774
2780
  })
2775
2781
  });
2776
- var responseCreatedChunkSchema = import_zod14.z.object({
2777
- type: import_zod14.z.literal("response.created"),
2778
- response: import_zod14.z.object({
2779
- id: import_zod14.z.string(),
2780
- created_at: import_zod14.z.number(),
2781
- model: import_zod14.z.string()
2782
+ var responseCreatedChunkSchema = import_v414.z.object({
2783
+ type: import_v414.z.literal("response.created"),
2784
+ response: import_v414.z.object({
2785
+ id: import_v414.z.string(),
2786
+ created_at: import_v414.z.number(),
2787
+ model: import_v414.z.string()
2782
2788
  })
2783
2789
  });
2784
- var responseOutputItemAddedSchema = import_zod14.z.object({
2785
- type: import_zod14.z.literal("response.output_item.added"),
2786
- output_index: import_zod14.z.number(),
2787
- item: import_zod14.z.discriminatedUnion("type", [
2788
- import_zod14.z.object({
2789
- type: import_zod14.z.literal("message"),
2790
- id: import_zod14.z.string()
2790
+ var responseOutputItemAddedSchema = import_v414.z.object({
2791
+ type: import_v414.z.literal("response.output_item.added"),
2792
+ output_index: import_v414.z.number(),
2793
+ item: import_v414.z.discriminatedUnion("type", [
2794
+ import_v414.z.object({
2795
+ type: import_v414.z.literal("message"),
2796
+ id: import_v414.z.string()
2791
2797
  }),
2792
- import_zod14.z.object({
2793
- type: import_zod14.z.literal("reasoning"),
2794
- id: import_zod14.z.string()
2798
+ import_v414.z.object({
2799
+ type: import_v414.z.literal("reasoning"),
2800
+ id: import_v414.z.string()
2795
2801
  }),
2796
- import_zod14.z.object({
2797
- type: import_zod14.z.literal("function_call"),
2798
- id: import_zod14.z.string(),
2799
- call_id: import_zod14.z.string(),
2800
- name: import_zod14.z.string(),
2801
- arguments: import_zod14.z.string()
2802
+ import_v414.z.object({
2803
+ type: import_v414.z.literal("function_call"),
2804
+ id: import_v414.z.string(),
2805
+ call_id: import_v414.z.string(),
2806
+ name: import_v414.z.string(),
2807
+ arguments: import_v414.z.string()
2802
2808
  }),
2803
- import_zod14.z.object({
2804
- type: import_zod14.z.literal("web_search_call"),
2805
- id: import_zod14.z.string(),
2806
- status: import_zod14.z.string()
2809
+ import_v414.z.object({
2810
+ type: import_v414.z.literal("web_search_call"),
2811
+ id: import_v414.z.string(),
2812
+ status: import_v414.z.string()
2807
2813
  }),
2808
- import_zod14.z.object({
2809
- type: import_zod14.z.literal("computer_call"),
2810
- id: import_zod14.z.string(),
2811
- status: import_zod14.z.string()
2814
+ import_v414.z.object({
2815
+ type: import_v414.z.literal("computer_call"),
2816
+ id: import_v414.z.string(),
2817
+ status: import_v414.z.string()
2812
2818
  })
2813
2819
  ])
2814
2820
  });
2815
- var responseOutputItemDoneSchema = import_zod14.z.object({
2816
- type: import_zod14.z.literal("response.output_item.done"),
2817
- output_index: import_zod14.z.number(),
2818
- item: import_zod14.z.discriminatedUnion("type", [
2819
- import_zod14.z.object({
2820
- type: import_zod14.z.literal("message"),
2821
- id: import_zod14.z.string()
2821
+ var responseOutputItemDoneSchema = import_v414.z.object({
2822
+ type: import_v414.z.literal("response.output_item.done"),
2823
+ output_index: import_v414.z.number(),
2824
+ item: import_v414.z.discriminatedUnion("type", [
2825
+ import_v414.z.object({
2826
+ type: import_v414.z.literal("message"),
2827
+ id: import_v414.z.string()
2822
2828
  }),
2823
- import_zod14.z.object({
2824
- type: import_zod14.z.literal("reasoning"),
2825
- id: import_zod14.z.string()
2829
+ import_v414.z.object({
2830
+ type: import_v414.z.literal("reasoning"),
2831
+ id: import_v414.z.string()
2826
2832
  }),
2827
- import_zod14.z.object({
2828
- type: import_zod14.z.literal("function_call"),
2829
- id: import_zod14.z.string(),
2830
- call_id: import_zod14.z.string(),
2831
- name: import_zod14.z.string(),
2832
- arguments: import_zod14.z.string(),
2833
- status: import_zod14.z.literal("completed")
2833
+ import_v414.z.object({
2834
+ type: import_v414.z.literal("function_call"),
2835
+ id: import_v414.z.string(),
2836
+ call_id: import_v414.z.string(),
2837
+ name: import_v414.z.string(),
2838
+ arguments: import_v414.z.string(),
2839
+ status: import_v414.z.literal("completed")
2834
2840
  }),
2835
- import_zod14.z.object({
2836
- type: import_zod14.z.literal("web_search_call"),
2837
- id: import_zod14.z.string(),
2838
- status: import_zod14.z.literal("completed")
2841
+ import_v414.z.object({
2842
+ type: import_v414.z.literal("web_search_call"),
2843
+ id: import_v414.z.string(),
2844
+ status: import_v414.z.literal("completed")
2839
2845
  }),
2840
- import_zod14.z.object({
2841
- type: import_zod14.z.literal("computer_call"),
2842
- id: import_zod14.z.string(),
2843
- status: import_zod14.z.literal("completed")
2846
+ import_v414.z.object({
2847
+ type: import_v414.z.literal("computer_call"),
2848
+ id: import_v414.z.string(),
2849
+ status: import_v414.z.literal("completed")
2844
2850
  })
2845
2851
  ])
2846
2852
  });
2847
- var responseFunctionCallArgumentsDeltaSchema = import_zod14.z.object({
2848
- type: import_zod14.z.literal("response.function_call_arguments.delta"),
2849
- item_id: import_zod14.z.string(),
2850
- output_index: import_zod14.z.number(),
2851
- delta: import_zod14.z.string()
2853
+ var responseFunctionCallArgumentsDeltaSchema = import_v414.z.object({
2854
+ type: import_v414.z.literal("response.function_call_arguments.delta"),
2855
+ item_id: import_v414.z.string(),
2856
+ output_index: import_v414.z.number(),
2857
+ delta: import_v414.z.string()
2852
2858
  });
2853
- var responseAnnotationAddedSchema = import_zod14.z.object({
2854
- type: import_zod14.z.literal("response.output_text.annotation.added"),
2855
- annotation: import_zod14.z.object({
2856
- type: import_zod14.z.literal("url_citation"),
2857
- url: import_zod14.z.string(),
2858
- title: import_zod14.z.string()
2859
+ var responseAnnotationAddedSchema = import_v414.z.object({
2860
+ type: import_v414.z.literal("response.output_text.annotation.added"),
2861
+ annotation: import_v414.z.object({
2862
+ type: import_v414.z.literal("url_citation"),
2863
+ url: import_v414.z.string(),
2864
+ title: import_v414.z.string()
2859
2865
  })
2860
2866
  });
2861
- var responseReasoningSummaryTextDeltaSchema = import_zod14.z.object({
2862
- type: import_zod14.z.literal("response.reasoning_summary_text.delta"),
2863
- item_id: import_zod14.z.string(),
2864
- output_index: import_zod14.z.number(),
2865
- summary_index: import_zod14.z.number(),
2866
- delta: import_zod14.z.string()
2867
+ var responseReasoningSummaryTextDeltaSchema = import_v414.z.object({
2868
+ type: import_v414.z.literal("response.reasoning_summary_text.delta"),
2869
+ item_id: import_v414.z.string(),
2870
+ output_index: import_v414.z.number(),
2871
+ summary_index: import_v414.z.number(),
2872
+ delta: import_v414.z.string()
2867
2873
  });
2868
- var responseReasoningSummaryPartDoneSchema = import_zod14.z.object({
2869
- type: import_zod14.z.literal("response.reasoning_summary_part.done"),
2870
- item_id: import_zod14.z.string(),
2871
- output_index: import_zod14.z.number(),
2872
- summary_index: import_zod14.z.number(),
2873
- part: import_zod14.z.unknown().nullish()
2874
+ var responseReasoningSummaryPartDoneSchema = import_v414.z.object({
2875
+ type: import_v414.z.literal("response.reasoning_summary_part.done"),
2876
+ item_id: import_v414.z.string(),
2877
+ output_index: import_v414.z.number(),
2878
+ summary_index: import_v414.z.number(),
2879
+ part: import_v414.z.unknown().nullish()
2874
2880
  });
2875
- var openaiResponsesChunkSchema = import_zod14.z.union([
2881
+ var openaiResponsesChunkSchema = import_v414.z.union([
2876
2882
  textDeltaChunkSchema,
2877
2883
  responseFinishedChunkSchema,
2878
2884
  responseCreatedChunkSchema,
@@ -2882,7 +2888,7 @@ var openaiResponsesChunkSchema = import_zod14.z.union([
2882
2888
  responseAnnotationAddedSchema,
2883
2889
  responseReasoningSummaryTextDeltaSchema,
2884
2890
  responseReasoningSummaryPartDoneSchema,
2885
- import_zod14.z.object({ type: import_zod14.z.string() }).passthrough()
2891
+ import_v414.z.object({ type: import_v414.z.string() }).passthrough()
2886
2892
  // fallback for unknown chunks
2887
2893
  ]);
2888
2894
  function isTextDeltaChunk(chunk) {
@@ -2933,17 +2939,17 @@ function getResponsesModelConfig(modelId) {
2933
2939
  function supportsFlexProcessing2(modelId) {
2934
2940
  return modelId.startsWith("o3") || modelId.startsWith("o4-mini");
2935
2941
  }
2936
- var openaiResponsesProviderOptionsSchema = import_zod14.z.object({
2937
- metadata: import_zod14.z.any().nullish(),
2938
- parallelToolCalls: import_zod14.z.boolean().nullish(),
2939
- previousResponseId: import_zod14.z.string().nullish(),
2940
- store: import_zod14.z.boolean().nullish(),
2941
- user: import_zod14.z.string().nullish(),
2942
- reasoningEffort: import_zod14.z.string().nullish(),
2943
- strictSchemas: import_zod14.z.boolean().nullish(),
2944
- instructions: import_zod14.z.string().nullish(),
2945
- reasoningSummary: import_zod14.z.string().nullish(),
2946
- serviceTier: import_zod14.z.enum(["auto", "flex"]).nullish()
2942
+ var openaiResponsesProviderOptionsSchema = import_v414.z.object({
2943
+ metadata: import_v414.z.any().nullish(),
2944
+ parallelToolCalls: import_v414.z.boolean().nullish(),
2945
+ previousResponseId: import_v414.z.string().nullish(),
2946
+ store: import_v414.z.boolean().nullish(),
2947
+ user: import_v414.z.string().nullish(),
2948
+ reasoningEffort: import_v414.z.string().nullish(),
2949
+ strictJsonSchema: import_v414.z.boolean().nullish(),
2950
+ instructions: import_v414.z.string().nullish(),
2951
+ reasoningSummary: import_v414.z.string().nullish(),
2952
+ serviceTier: import_v414.z.enum(["auto", "flex"]).nullish()
2947
2953
  });
2948
2954
  // Annotate the CommonJS export names for ESM import in node:
2949
2955
  0 && (module.exports = {