@ai-sdk/openai 2.0.46 → 2.0.48

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.
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
 
30
20
  // src/internal/index.ts
@@ -63,17 +53,17 @@ var import_provider3 = require("@ai-sdk/provider");
63
53
  var import_provider_utils5 = require("@ai-sdk/provider-utils");
64
54
 
65
55
  // src/openai-error.ts
66
- var z = __toESM(require("zod/v4"));
56
+ var import_v4 = require("zod/v4");
67
57
  var import_provider_utils = require("@ai-sdk/provider-utils");
68
- var openaiErrorDataSchema = z.object({
69
- error: z.object({
70
- message: z.string(),
58
+ var openaiErrorDataSchema = import_v4.z.object({
59
+ error: import_v4.z.object({
60
+ message: import_v4.z.string(),
71
61
  // The additional information below is handled loosely to support
72
62
  // OpenAI-compatible providers that have slightly different error
73
63
  // responses:
74
- type: z.string().nullish(),
75
- param: z.any().nullish(),
76
- code: z.union([z.string(), z.number()]).nullish()
64
+ type: import_v4.z.string().nullish(),
65
+ param: import_v4.z.any().nullish(),
66
+ code: import_v4.z.union([import_v4.z.string(), import_v4.z.number()]).nullish()
77
67
  })
78
68
  });
79
69
  var openaiFailedResponseHandler = (0, import_provider_utils.createJsonErrorResponseHandler)({
@@ -291,67 +281,67 @@ function mapOpenAIFinishReason(finishReason) {
291
281
 
292
282
  // src/chat/openai-chat-api.ts
293
283
  var import_provider_utils3 = require("@ai-sdk/provider-utils");
294
- var z2 = __toESM(require("zod/v4"));
284
+ var import_v42 = require("zod/v4");
295
285
  var openaiChatResponseSchema = (0, import_provider_utils3.lazyValidator)(
296
286
  () => (0, import_provider_utils3.zodSchema)(
297
- z2.object({
298
- id: z2.string().nullish(),
299
- created: z2.number().nullish(),
300
- model: z2.string().nullish(),
301
- choices: z2.array(
302
- z2.object({
303
- message: z2.object({
304
- role: z2.literal("assistant").nullish(),
305
- content: z2.string().nullish(),
306
- tool_calls: z2.array(
307
- z2.object({
308
- id: z2.string().nullish(),
309
- type: z2.literal("function"),
310
- function: z2.object({
311
- name: z2.string(),
312
- arguments: z2.string()
287
+ import_v42.z.object({
288
+ id: import_v42.z.string().nullish(),
289
+ created: import_v42.z.number().nullish(),
290
+ model: import_v42.z.string().nullish(),
291
+ choices: import_v42.z.array(
292
+ import_v42.z.object({
293
+ message: import_v42.z.object({
294
+ role: import_v42.z.literal("assistant").nullish(),
295
+ content: import_v42.z.string().nullish(),
296
+ tool_calls: import_v42.z.array(
297
+ import_v42.z.object({
298
+ id: import_v42.z.string().nullish(),
299
+ type: import_v42.z.literal("function"),
300
+ function: import_v42.z.object({
301
+ name: import_v42.z.string(),
302
+ arguments: import_v42.z.string()
313
303
  })
314
304
  })
315
305
  ).nullish(),
316
- annotations: z2.array(
317
- z2.object({
318
- type: z2.literal("url_citation"),
319
- start_index: z2.number(),
320
- end_index: z2.number(),
321
- url: z2.string(),
322
- title: z2.string()
306
+ annotations: import_v42.z.array(
307
+ import_v42.z.object({
308
+ type: import_v42.z.literal("url_citation"),
309
+ start_index: import_v42.z.number(),
310
+ end_index: import_v42.z.number(),
311
+ url: import_v42.z.string(),
312
+ title: import_v42.z.string()
323
313
  })
324
314
  ).nullish()
325
315
  }),
326
- index: z2.number(),
327
- logprobs: z2.object({
328
- content: z2.array(
329
- z2.object({
330
- token: z2.string(),
331
- logprob: z2.number(),
332
- top_logprobs: z2.array(
333
- z2.object({
334
- token: z2.string(),
335
- logprob: z2.number()
316
+ index: import_v42.z.number(),
317
+ logprobs: import_v42.z.object({
318
+ content: import_v42.z.array(
319
+ import_v42.z.object({
320
+ token: import_v42.z.string(),
321
+ logprob: import_v42.z.number(),
322
+ top_logprobs: import_v42.z.array(
323
+ import_v42.z.object({
324
+ token: import_v42.z.string(),
325
+ logprob: import_v42.z.number()
336
326
  })
337
327
  )
338
328
  })
339
329
  ).nullish()
340
330
  }).nullish(),
341
- finish_reason: z2.string().nullish()
331
+ finish_reason: import_v42.z.string().nullish()
342
332
  })
343
333
  ),
344
- usage: z2.object({
345
- prompt_tokens: z2.number().nullish(),
346
- completion_tokens: z2.number().nullish(),
347
- total_tokens: z2.number().nullish(),
348
- prompt_tokens_details: z2.object({
349
- cached_tokens: z2.number().nullish()
334
+ usage: import_v42.z.object({
335
+ prompt_tokens: import_v42.z.number().nullish(),
336
+ completion_tokens: import_v42.z.number().nullish(),
337
+ total_tokens: import_v42.z.number().nullish(),
338
+ prompt_tokens_details: import_v42.z.object({
339
+ cached_tokens: import_v42.z.number().nullish()
350
340
  }).nullish(),
351
- completion_tokens_details: z2.object({
352
- reasoning_tokens: z2.number().nullish(),
353
- accepted_prediction_tokens: z2.number().nullish(),
354
- rejected_prediction_tokens: z2.number().nullish()
341
+ completion_tokens_details: import_v42.z.object({
342
+ reasoning_tokens: import_v42.z.number().nullish(),
343
+ accepted_prediction_tokens: import_v42.z.number().nullish(),
344
+ rejected_prediction_tokens: import_v42.z.number().nullish()
355
345
  }).nullish()
356
346
  }).nullish()
357
347
  })
@@ -359,66 +349,66 @@ var openaiChatResponseSchema = (0, import_provider_utils3.lazyValidator)(
359
349
  );
360
350
  var openaiChatChunkSchema = (0, import_provider_utils3.lazyValidator)(
361
351
  () => (0, import_provider_utils3.zodSchema)(
362
- z2.union([
363
- z2.object({
364
- id: z2.string().nullish(),
365
- created: z2.number().nullish(),
366
- model: z2.string().nullish(),
367
- choices: z2.array(
368
- z2.object({
369
- delta: z2.object({
370
- role: z2.enum(["assistant"]).nullish(),
371
- content: z2.string().nullish(),
372
- tool_calls: z2.array(
373
- z2.object({
374
- index: z2.number(),
375
- id: z2.string().nullish(),
376
- type: z2.literal("function").nullish(),
377
- function: z2.object({
378
- name: z2.string().nullish(),
379
- arguments: z2.string().nullish()
352
+ import_v42.z.union([
353
+ import_v42.z.object({
354
+ id: import_v42.z.string().nullish(),
355
+ created: import_v42.z.number().nullish(),
356
+ model: import_v42.z.string().nullish(),
357
+ choices: import_v42.z.array(
358
+ import_v42.z.object({
359
+ delta: import_v42.z.object({
360
+ role: import_v42.z.enum(["assistant"]).nullish(),
361
+ content: import_v42.z.string().nullish(),
362
+ tool_calls: import_v42.z.array(
363
+ import_v42.z.object({
364
+ index: import_v42.z.number(),
365
+ id: import_v42.z.string().nullish(),
366
+ type: import_v42.z.literal("function").nullish(),
367
+ function: import_v42.z.object({
368
+ name: import_v42.z.string().nullish(),
369
+ arguments: import_v42.z.string().nullish()
380
370
  })
381
371
  })
382
372
  ).nullish(),
383
- annotations: z2.array(
384
- z2.object({
385
- type: z2.literal("url_citation"),
386
- start_index: z2.number(),
387
- end_index: z2.number(),
388
- url: z2.string(),
389
- title: z2.string()
373
+ annotations: import_v42.z.array(
374
+ import_v42.z.object({
375
+ type: import_v42.z.literal("url_citation"),
376
+ start_index: import_v42.z.number(),
377
+ end_index: import_v42.z.number(),
378
+ url: import_v42.z.string(),
379
+ title: import_v42.z.string()
390
380
  })
391
381
  ).nullish()
392
382
  }).nullish(),
393
- logprobs: z2.object({
394
- content: z2.array(
395
- z2.object({
396
- token: z2.string(),
397
- logprob: z2.number(),
398
- top_logprobs: z2.array(
399
- z2.object({
400
- token: z2.string(),
401
- logprob: z2.number()
383
+ logprobs: import_v42.z.object({
384
+ content: import_v42.z.array(
385
+ import_v42.z.object({
386
+ token: import_v42.z.string(),
387
+ logprob: import_v42.z.number(),
388
+ top_logprobs: import_v42.z.array(
389
+ import_v42.z.object({
390
+ token: import_v42.z.string(),
391
+ logprob: import_v42.z.number()
402
392
  })
403
393
  )
404
394
  })
405
395
  ).nullish()
406
396
  }).nullish(),
407
- finish_reason: z2.string().nullish(),
408
- index: z2.number()
397
+ finish_reason: import_v42.z.string().nullish(),
398
+ index: import_v42.z.number()
409
399
  })
410
400
  ),
411
- usage: z2.object({
412
- prompt_tokens: z2.number().nullish(),
413
- completion_tokens: z2.number().nullish(),
414
- total_tokens: z2.number().nullish(),
415
- prompt_tokens_details: z2.object({
416
- cached_tokens: z2.number().nullish()
401
+ usage: import_v42.z.object({
402
+ prompt_tokens: import_v42.z.number().nullish(),
403
+ completion_tokens: import_v42.z.number().nullish(),
404
+ total_tokens: import_v42.z.number().nullish(),
405
+ prompt_tokens_details: import_v42.z.object({
406
+ cached_tokens: import_v42.z.number().nullish()
417
407
  }).nullish(),
418
- completion_tokens_details: z2.object({
419
- reasoning_tokens: z2.number().nullish(),
420
- accepted_prediction_tokens: z2.number().nullish(),
421
- rejected_prediction_tokens: z2.number().nullish()
408
+ completion_tokens_details: import_v42.z.object({
409
+ reasoning_tokens: import_v42.z.number().nullish(),
410
+ accepted_prediction_tokens: import_v42.z.number().nullish(),
411
+ rejected_prediction_tokens: import_v42.z.number().nullish()
422
412
  }).nullish()
423
413
  }).nullish()
424
414
  }),
@@ -429,17 +419,17 @@ var openaiChatChunkSchema = (0, import_provider_utils3.lazyValidator)(
429
419
 
430
420
  // src/chat/openai-chat-options.ts
431
421
  var import_provider_utils4 = require("@ai-sdk/provider-utils");
432
- var z3 = __toESM(require("zod/v4"));
422
+ var import_v43 = require("zod/v4");
433
423
  var openaiChatLanguageModelOptions = (0, import_provider_utils4.lazyValidator)(
434
424
  () => (0, import_provider_utils4.zodSchema)(
435
- z3.object({
425
+ import_v43.z.object({
436
426
  /**
437
427
  * Modify the likelihood of specified tokens appearing in the completion.
438
428
  *
439
429
  * Accepts a JSON object that maps tokens (specified by their token ID in
440
430
  * the GPT tokenizer) to an associated bias value from -100 to 100.
441
431
  */
442
- logitBias: z3.record(z3.coerce.number(), z3.number()).optional(),
432
+ logitBias: import_v43.z.record(import_v43.z.coerce.number(), import_v43.z.number()).optional(),
443
433
  /**
444
434
  * Return the log probabilities of the tokens.
445
435
  *
@@ -449,42 +439,42 @@ var openaiChatLanguageModelOptions = (0, import_provider_utils4.lazyValidator)(
449
439
  * Setting to a number will return the log probabilities of the top n
450
440
  * tokens that were generated.
451
441
  */
452
- logprobs: z3.union([z3.boolean(), z3.number()]).optional(),
442
+ logprobs: import_v43.z.union([import_v43.z.boolean(), import_v43.z.number()]).optional(),
453
443
  /**
454
444
  * Whether to enable parallel function calling during tool use. Default to true.
455
445
  */
456
- parallelToolCalls: z3.boolean().optional(),
446
+ parallelToolCalls: import_v43.z.boolean().optional(),
457
447
  /**
458
448
  * A unique identifier representing your end-user, which can help OpenAI to
459
449
  * monitor and detect abuse.
460
450
  */
461
- user: z3.string().optional(),
451
+ user: import_v43.z.string().optional(),
462
452
  /**
463
453
  * Reasoning effort for reasoning models. Defaults to `medium`.
464
454
  */
465
- reasoningEffort: z3.enum(["minimal", "low", "medium", "high"]).optional(),
455
+ reasoningEffort: import_v43.z.enum(["minimal", "low", "medium", "high"]).optional(),
466
456
  /**
467
457
  * Maximum number of completion tokens to generate. Useful for reasoning models.
468
458
  */
469
- maxCompletionTokens: z3.number().optional(),
459
+ maxCompletionTokens: import_v43.z.number().optional(),
470
460
  /**
471
461
  * Whether to enable persistence in responses API.
472
462
  */
473
- store: z3.boolean().optional(),
463
+ store: import_v43.z.boolean().optional(),
474
464
  /**
475
465
  * Metadata to associate with the request.
476
466
  */
477
- metadata: z3.record(z3.string().max(64), z3.string().max(512)).optional(),
467
+ metadata: import_v43.z.record(import_v43.z.string().max(64), import_v43.z.string().max(512)).optional(),
478
468
  /**
479
469
  * Parameters for prediction mode.
480
470
  */
481
- prediction: z3.record(z3.string(), z3.any()).optional(),
471
+ prediction: import_v43.z.record(import_v43.z.string(), import_v43.z.any()).optional(),
482
472
  /**
483
473
  * Whether to use structured outputs.
484
474
  *
485
475
  * @default true
486
476
  */
487
- structuredOutputs: z3.boolean().optional(),
477
+ structuredOutputs: import_v43.z.boolean().optional(),
488
478
  /**
489
479
  * Service tier for the request.
490
480
  * - 'auto': Default service tier. The request will be processed with the service tier configured in the
@@ -495,23 +485,23 @@ var openaiChatLanguageModelOptions = (0, import_provider_utils4.lazyValidator)(
495
485
  *
496
486
  * @default 'auto'
497
487
  */
498
- serviceTier: z3.enum(["auto", "flex", "priority", "default"]).optional(),
488
+ serviceTier: import_v43.z.enum(["auto", "flex", "priority", "default"]).optional(),
499
489
  /**
500
490
  * Whether to use strict JSON schema validation.
501
491
  *
502
492
  * @default false
503
493
  */
504
- strictJsonSchema: z3.boolean().optional(),
494
+ strictJsonSchema: import_v43.z.boolean().optional(),
505
495
  /**
506
496
  * Controls the verbosity of the model's responses.
507
497
  * Lower values will result in more concise responses, while higher values will result in more verbose responses.
508
498
  */
509
- textVerbosity: z3.enum(["low", "medium", "high"]).optional(),
499
+ textVerbosity: import_v43.z.enum(["low", "medium", "high"]).optional(),
510
500
  /**
511
501
  * A cache key for prompt caching. Allows manual control over prompt caching behavior.
512
502
  * Useful for improving cache hit rates and working around automatic caching issues.
513
503
  */
514
- promptCacheKey: z3.string().optional(),
504
+ promptCacheKey: import_v43.z.string().optional(),
515
505
  /**
516
506
  * A stable identifier used to help detect users of your application
517
507
  * that may be violating OpenAI's usage policies. The IDs should be a
@@ -519,7 +509,7 @@ var openaiChatLanguageModelOptions = (0, import_provider_utils4.lazyValidator)(
519
509
  * username or email address, in order to avoid sending us any identifying
520
510
  * information.
521
511
  */
522
- safetyIdentifier: z3.string().optional()
512
+ safetyIdentifier: import_v43.z.string().optional()
523
513
  })
524
514
  )
525
515
  );
@@ -1236,56 +1226,56 @@ function mapOpenAIFinishReason2(finishReason) {
1236
1226
  }
1237
1227
 
1238
1228
  // src/completion/openai-completion-api.ts
1239
- var z4 = __toESM(require("zod/v4"));
1229
+ var import_v44 = require("zod/v4");
1240
1230
  var import_provider_utils6 = require("@ai-sdk/provider-utils");
1241
1231
  var openaiCompletionResponseSchema = (0, import_provider_utils6.lazyValidator)(
1242
1232
  () => (0, import_provider_utils6.zodSchema)(
1243
- z4.object({
1244
- id: z4.string().nullish(),
1245
- created: z4.number().nullish(),
1246
- model: z4.string().nullish(),
1247
- choices: z4.array(
1248
- z4.object({
1249
- text: z4.string(),
1250
- finish_reason: z4.string(),
1251
- logprobs: z4.object({
1252
- tokens: z4.array(z4.string()),
1253
- token_logprobs: z4.array(z4.number()),
1254
- top_logprobs: z4.array(z4.record(z4.string(), z4.number())).nullish()
1233
+ import_v44.z.object({
1234
+ id: import_v44.z.string().nullish(),
1235
+ created: import_v44.z.number().nullish(),
1236
+ model: import_v44.z.string().nullish(),
1237
+ choices: import_v44.z.array(
1238
+ import_v44.z.object({
1239
+ text: import_v44.z.string(),
1240
+ finish_reason: import_v44.z.string(),
1241
+ logprobs: import_v44.z.object({
1242
+ tokens: import_v44.z.array(import_v44.z.string()),
1243
+ token_logprobs: import_v44.z.array(import_v44.z.number()),
1244
+ top_logprobs: import_v44.z.array(import_v44.z.record(import_v44.z.string(), import_v44.z.number())).nullish()
1255
1245
  }).nullish()
1256
1246
  })
1257
1247
  ),
1258
- usage: z4.object({
1259
- prompt_tokens: z4.number(),
1260
- completion_tokens: z4.number(),
1261
- total_tokens: z4.number()
1248
+ usage: import_v44.z.object({
1249
+ prompt_tokens: import_v44.z.number(),
1250
+ completion_tokens: import_v44.z.number(),
1251
+ total_tokens: import_v44.z.number()
1262
1252
  }).nullish()
1263
1253
  })
1264
1254
  )
1265
1255
  );
1266
1256
  var openaiCompletionChunkSchema = (0, import_provider_utils6.lazyValidator)(
1267
1257
  () => (0, import_provider_utils6.zodSchema)(
1268
- z4.union([
1269
- z4.object({
1270
- id: z4.string().nullish(),
1271
- created: z4.number().nullish(),
1272
- model: z4.string().nullish(),
1273
- choices: z4.array(
1274
- z4.object({
1275
- text: z4.string(),
1276
- finish_reason: z4.string().nullish(),
1277
- index: z4.number(),
1278
- logprobs: z4.object({
1279
- tokens: z4.array(z4.string()),
1280
- token_logprobs: z4.array(z4.number()),
1281
- top_logprobs: z4.array(z4.record(z4.string(), z4.number())).nullish()
1258
+ import_v44.z.union([
1259
+ import_v44.z.object({
1260
+ id: import_v44.z.string().nullish(),
1261
+ created: import_v44.z.number().nullish(),
1262
+ model: import_v44.z.string().nullish(),
1263
+ choices: import_v44.z.array(
1264
+ import_v44.z.object({
1265
+ text: import_v44.z.string(),
1266
+ finish_reason: import_v44.z.string().nullish(),
1267
+ index: import_v44.z.number(),
1268
+ logprobs: import_v44.z.object({
1269
+ tokens: import_v44.z.array(import_v44.z.string()),
1270
+ token_logprobs: import_v44.z.array(import_v44.z.number()),
1271
+ top_logprobs: import_v44.z.array(import_v44.z.record(import_v44.z.string(), import_v44.z.number())).nullish()
1282
1272
  }).nullish()
1283
1273
  })
1284
1274
  ),
1285
- usage: z4.object({
1286
- prompt_tokens: z4.number(),
1287
- completion_tokens: z4.number(),
1288
- total_tokens: z4.number()
1275
+ usage: import_v44.z.object({
1276
+ prompt_tokens: import_v44.z.number(),
1277
+ completion_tokens: import_v44.z.number(),
1278
+ total_tokens: import_v44.z.number()
1289
1279
  }).nullish()
1290
1280
  }),
1291
1281
  openaiErrorDataSchema
@@ -1295,14 +1285,14 @@ var openaiCompletionChunkSchema = (0, import_provider_utils6.lazyValidator)(
1295
1285
 
1296
1286
  // src/completion/openai-completion-options.ts
1297
1287
  var import_provider_utils7 = require("@ai-sdk/provider-utils");
1298
- var z5 = __toESM(require("zod/v4"));
1288
+ var import_v45 = require("zod/v4");
1299
1289
  var openaiCompletionProviderOptions = (0, import_provider_utils7.lazyValidator)(
1300
1290
  () => (0, import_provider_utils7.zodSchema)(
1301
- z5.object({
1291
+ import_v45.z.object({
1302
1292
  /**
1303
1293
  Echo back the prompt in addition to the completion.
1304
1294
  */
1305
- echo: z5.boolean().optional(),
1295
+ echo: import_v45.z.boolean().optional(),
1306
1296
  /**
1307
1297
  Modify the likelihood of specified tokens appearing in the completion.
1308
1298
 
@@ -1317,16 +1307,16 @@ var openaiCompletionProviderOptions = (0, import_provider_utils7.lazyValidator)(
1317
1307
  As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
1318
1308
  token from being generated.
1319
1309
  */
1320
- logitBias: z5.record(z5.string(), z5.number()).optional(),
1310
+ logitBias: import_v45.z.record(import_v45.z.string(), import_v45.z.number()).optional(),
1321
1311
  /**
1322
1312
  The suffix that comes after a completion of inserted text.
1323
1313
  */
1324
- suffix: z5.string().optional(),
1314
+ suffix: import_v45.z.string().optional(),
1325
1315
  /**
1326
1316
  A unique identifier representing your end-user, which can help OpenAI to
1327
1317
  monitor and detect abuse. Learn more.
1328
1318
  */
1329
- user: z5.string().optional(),
1319
+ user: import_v45.z.string().optional(),
1330
1320
  /**
1331
1321
  Return the log probabilities of the tokens. Including logprobs will increase
1332
1322
  the response size and can slow down response times. However, it can
@@ -1336,7 +1326,7 @@ var openaiCompletionProviderOptions = (0, import_provider_utils7.lazyValidator)(
1336
1326
  Setting to a number will return the log probabilities of the top n
1337
1327
  tokens that were generated.
1338
1328
  */
1339
- logprobs: z5.union([z5.boolean(), z5.number()]).optional()
1329
+ logprobs: import_v45.z.union([import_v45.z.boolean(), import_v45.z.number()]).optional()
1340
1330
  })
1341
1331
  )
1342
1332
  );
@@ -1577,32 +1567,32 @@ var import_provider_utils11 = require("@ai-sdk/provider-utils");
1577
1567
 
1578
1568
  // src/embedding/openai-embedding-options.ts
1579
1569
  var import_provider_utils9 = require("@ai-sdk/provider-utils");
1580
- var z6 = __toESM(require("zod/v4"));
1570
+ var import_v46 = require("zod/v4");
1581
1571
  var openaiEmbeddingProviderOptions = (0, import_provider_utils9.lazyValidator)(
1582
1572
  () => (0, import_provider_utils9.zodSchema)(
1583
- z6.object({
1573
+ import_v46.z.object({
1584
1574
  /**
1585
1575
  The number of dimensions the resulting output embeddings should have.
1586
1576
  Only supported in text-embedding-3 and later models.
1587
1577
  */
1588
- dimensions: z6.number().optional(),
1578
+ dimensions: import_v46.z.number().optional(),
1589
1579
  /**
1590
1580
  A unique identifier representing your end-user, which can help OpenAI to
1591
1581
  monitor and detect abuse. Learn more.
1592
1582
  */
1593
- user: z6.string().optional()
1583
+ user: import_v46.z.string().optional()
1594
1584
  })
1595
1585
  )
1596
1586
  );
1597
1587
 
1598
1588
  // src/embedding/openai-embedding-api.ts
1599
1589
  var import_provider_utils10 = require("@ai-sdk/provider-utils");
1600
- var z7 = __toESM(require("zod/v4"));
1590
+ var import_v47 = require("zod/v4");
1601
1591
  var openaiTextEmbeddingResponseSchema = (0, import_provider_utils10.lazyValidator)(
1602
1592
  () => (0, import_provider_utils10.zodSchema)(
1603
- z7.object({
1604
- data: z7.array(z7.object({ embedding: z7.array(z7.number()) })),
1605
- usage: z7.object({ prompt_tokens: z7.number() }).nullish()
1593
+ import_v47.z.object({
1594
+ data: import_v47.z.array(import_v47.z.object({ embedding: import_v47.z.array(import_v47.z.number()) })),
1595
+ usage: import_v47.z.object({ prompt_tokens: import_v47.z.number() }).nullish()
1606
1596
  })
1607
1597
  )
1608
1598
  );
@@ -1676,14 +1666,14 @@ var import_provider_utils13 = require("@ai-sdk/provider-utils");
1676
1666
 
1677
1667
  // src/image/openai-image-api.ts
1678
1668
  var import_provider_utils12 = require("@ai-sdk/provider-utils");
1679
- var z8 = __toESM(require("zod/v4"));
1669
+ var import_v48 = require("zod/v4");
1680
1670
  var openaiImageResponseSchema = (0, import_provider_utils12.lazyValidator)(
1681
1671
  () => (0, import_provider_utils12.zodSchema)(
1682
- z8.object({
1683
- data: z8.array(
1684
- z8.object({
1685
- b64_json: z8.string(),
1686
- revised_prompt: z8.string().optional()
1672
+ import_v48.z.object({
1673
+ data: import_v48.z.array(
1674
+ import_v48.z.object({
1675
+ b64_json: import_v48.z.string(),
1676
+ revised_prompt: import_v48.z.string().optional()
1687
1677
  })
1688
1678
  )
1689
1679
  })
@@ -1786,32 +1776,32 @@ var import_provider_utils16 = require("@ai-sdk/provider-utils");
1786
1776
 
1787
1777
  // src/transcription/openai-transcription-api.ts
1788
1778
  var import_provider_utils14 = require("@ai-sdk/provider-utils");
1789
- var z9 = __toESM(require("zod/v4"));
1779
+ var import_v49 = require("zod/v4");
1790
1780
  var openaiTranscriptionResponseSchema = (0, import_provider_utils14.lazyValidator)(
1791
1781
  () => (0, import_provider_utils14.zodSchema)(
1792
- z9.object({
1793
- text: z9.string(),
1794
- language: z9.string().nullish(),
1795
- duration: z9.number().nullish(),
1796
- words: z9.array(
1797
- z9.object({
1798
- word: z9.string(),
1799
- start: z9.number(),
1800
- end: z9.number()
1782
+ import_v49.z.object({
1783
+ text: import_v49.z.string(),
1784
+ language: import_v49.z.string().nullish(),
1785
+ duration: import_v49.z.number().nullish(),
1786
+ words: import_v49.z.array(
1787
+ import_v49.z.object({
1788
+ word: import_v49.z.string(),
1789
+ start: import_v49.z.number(),
1790
+ end: import_v49.z.number()
1801
1791
  })
1802
1792
  ).nullish(),
1803
- segments: z9.array(
1804
- z9.object({
1805
- id: z9.number(),
1806
- seek: z9.number(),
1807
- start: z9.number(),
1808
- end: z9.number(),
1809
- text: z9.string(),
1810
- tokens: z9.array(z9.number()),
1811
- temperature: z9.number(),
1812
- avg_logprob: z9.number(),
1813
- compression_ratio: z9.number(),
1814
- no_speech_prob: z9.number()
1793
+ segments: import_v49.z.array(
1794
+ import_v49.z.object({
1795
+ id: import_v49.z.number(),
1796
+ seek: import_v49.z.number(),
1797
+ start: import_v49.z.number(),
1798
+ end: import_v49.z.number(),
1799
+ text: import_v49.z.string(),
1800
+ tokens: import_v49.z.array(import_v49.z.number()),
1801
+ temperature: import_v49.z.number(),
1802
+ avg_logprob: import_v49.z.number(),
1803
+ compression_ratio: import_v49.z.number(),
1804
+ no_speech_prob: import_v49.z.number()
1815
1805
  })
1816
1806
  ).nullish()
1817
1807
  })
@@ -1820,32 +1810,32 @@ var openaiTranscriptionResponseSchema = (0, import_provider_utils14.lazyValidato
1820
1810
 
1821
1811
  // src/transcription/openai-transcription-options.ts
1822
1812
  var import_provider_utils15 = require("@ai-sdk/provider-utils");
1823
- var z10 = __toESM(require("zod/v4"));
1813
+ var import_v410 = require("zod/v4");
1824
1814
  var openAITranscriptionProviderOptions = (0, import_provider_utils15.lazyValidator)(
1825
1815
  () => (0, import_provider_utils15.zodSchema)(
1826
- z10.object({
1816
+ import_v410.z.object({
1827
1817
  /**
1828
1818
  * Additional information to include in the transcription response.
1829
1819
  */
1830
- include: z10.array(z10.string()).optional(),
1820
+ include: import_v410.z.array(import_v410.z.string()).optional(),
1831
1821
  /**
1832
1822
  * The language of the input audio in ISO-639-1 format.
1833
1823
  */
1834
- language: z10.string().optional(),
1824
+ language: import_v410.z.string().optional(),
1835
1825
  /**
1836
1826
  * An optional text to guide the model's style or continue a previous audio segment.
1837
1827
  */
1838
- prompt: z10.string().optional(),
1828
+ prompt: import_v410.z.string().optional(),
1839
1829
  /**
1840
1830
  * The sampling temperature, between 0 and 1.
1841
1831
  * @default 0
1842
1832
  */
1843
- temperature: z10.number().min(0).max(1).default(0).optional(),
1833
+ temperature: import_v410.z.number().min(0).max(1).default(0).optional(),
1844
1834
  /**
1845
1835
  * The timestamp granularities to populate for this transcription.
1846
1836
  * @default ['segment']
1847
1837
  */
1848
- timestampGranularities: z10.array(z10.enum(["word", "segment"])).default(["segment"]).optional()
1838
+ timestampGranularities: import_v410.z.array(import_v410.z.enum(["word", "segment"])).default(["segment"]).optional()
1849
1839
  })
1850
1840
  )
1851
1841
  );
@@ -2022,12 +2012,12 @@ var import_provider_utils18 = require("@ai-sdk/provider-utils");
2022
2012
 
2023
2013
  // src/speech/openai-speech-options.ts
2024
2014
  var import_provider_utils17 = require("@ai-sdk/provider-utils");
2025
- var z11 = __toESM(require("zod/v4"));
2015
+ var import_v411 = require("zod/v4");
2026
2016
  var openaiSpeechProviderOptionsSchema = (0, import_provider_utils17.lazyValidator)(
2027
2017
  () => (0, import_provider_utils17.zodSchema)(
2028
- z11.object({
2029
- instructions: z11.string().nullish(),
2030
- speed: z11.number().min(0.25).max(4).default(1).nullish()
2018
+ import_v411.z.object({
2019
+ instructions: import_v411.z.string().nullish(),
2020
+ speed: import_v411.z.number().min(0.25).max(4).default(1).nullish()
2031
2021
  })
2032
2022
  )
2033
2023
  );
@@ -2140,27 +2130,27 @@ var import_provider_utils29 = require("@ai-sdk/provider-utils");
2140
2130
  // src/responses/convert-to-openai-responses-input.ts
2141
2131
  var import_provider6 = require("@ai-sdk/provider");
2142
2132
  var import_provider_utils20 = require("@ai-sdk/provider-utils");
2143
- var z13 = __toESM(require("zod/v4"));
2133
+ var import_v413 = require("zod/v4");
2144
2134
 
2145
2135
  // src/tool/local-shell.ts
2146
2136
  var import_provider_utils19 = require("@ai-sdk/provider-utils");
2147
- var z12 = __toESM(require("zod/v4"));
2137
+ var import_v412 = require("zod/v4");
2148
2138
  var localShellInputSchema = (0, import_provider_utils19.lazySchema)(
2149
2139
  () => (0, import_provider_utils19.zodSchema)(
2150
- z12.object({
2151
- action: z12.object({
2152
- type: z12.literal("exec"),
2153
- command: z12.array(z12.string()),
2154
- timeoutMs: z12.number().optional(),
2155
- user: z12.string().optional(),
2156
- workingDirectory: z12.string().optional(),
2157
- env: z12.record(z12.string(), z12.string()).optional()
2140
+ import_v412.z.object({
2141
+ action: import_v412.z.object({
2142
+ type: import_v412.z.literal("exec"),
2143
+ command: import_v412.z.array(import_v412.z.string()),
2144
+ timeoutMs: import_v412.z.number().optional(),
2145
+ user: import_v412.z.string().optional(),
2146
+ workingDirectory: import_v412.z.string().optional(),
2147
+ env: import_v412.z.record(import_v412.z.string(), import_v412.z.string()).optional()
2158
2148
  })
2159
2149
  })
2160
2150
  )
2161
2151
  );
2162
2152
  var localShellOutputSchema = (0, import_provider_utils19.lazySchema)(
2163
- () => (0, import_provider_utils19.zodSchema)(z12.object({ output: z12.string() }))
2153
+ () => (0, import_provider_utils19.zodSchema)(import_v412.z.object({ output: import_v412.z.string() }))
2164
2154
  );
2165
2155
  var localShell = (0, import_provider_utils19.createProviderDefinedToolFactoryWithOutputSchema)({
2166
2156
  id: "openai.local_shell",
@@ -2391,11 +2381,29 @@ async function convertToOpenAIResponsesInput({
2391
2381
  case "error-text":
2392
2382
  contentValue = output.value;
2393
2383
  break;
2394
- case "content":
2395
2384
  case "json":
2396
2385
  case "error-json":
2397
2386
  contentValue = JSON.stringify(output.value);
2398
2387
  break;
2388
+ case "content":
2389
+ contentValue = output.value.map((item) => {
2390
+ switch (item.type) {
2391
+ case "text": {
2392
+ return { type: "input_text", text: item.text };
2393
+ }
2394
+ case "media": {
2395
+ return item.mediaType.startsWith("image/") ? {
2396
+ type: "input_image",
2397
+ image_url: `data:${item.mediaType};base64,${item.data}`
2398
+ } : {
2399
+ type: "input_file",
2400
+ filename: "data",
2401
+ file_data: `data:${item.mediaType};base64,${item.data}`
2402
+ };
2403
+ }
2404
+ }
2405
+ });
2406
+ break;
2399
2407
  }
2400
2408
  input.push({
2401
2409
  type: "function_call_output",
@@ -2413,9 +2421,9 @@ async function convertToOpenAIResponsesInput({
2413
2421
  }
2414
2422
  return { input, warnings };
2415
2423
  }
2416
- var openaiResponsesReasoningProviderOptionsSchema = z13.object({
2417
- itemId: z13.string().nullish(),
2418
- reasoningEncryptedContent: z13.string().nullish()
2424
+ var openaiResponsesReasoningProviderOptionsSchema = import_v413.z.object({
2425
+ itemId: import_v413.z.string().nullish(),
2426
+ reasoningEncryptedContent: import_v413.z.string().nullish()
2419
2427
  });
2420
2428
 
2421
2429
  // src/responses/map-openai-responses-finish-reason.ts
@@ -2438,260 +2446,260 @@ function mapOpenAIResponseFinishReason({
2438
2446
 
2439
2447
  // src/responses/openai-responses-api.ts
2440
2448
  var import_provider_utils21 = require("@ai-sdk/provider-utils");
2441
- var z14 = __toESM(require("zod/v4"));
2449
+ var import_v414 = require("zod/v4");
2442
2450
  var openaiResponsesChunkSchema = (0, import_provider_utils21.lazyValidator)(
2443
2451
  () => (0, import_provider_utils21.zodSchema)(
2444
- z14.union([
2445
- z14.object({
2446
- type: z14.literal("response.output_text.delta"),
2447
- item_id: z14.string(),
2448
- delta: z14.string(),
2449
- logprobs: z14.array(
2450
- z14.object({
2451
- token: z14.string(),
2452
- logprob: z14.number(),
2453
- top_logprobs: z14.array(
2454
- z14.object({
2455
- token: z14.string(),
2456
- logprob: z14.number()
2452
+ import_v414.z.union([
2453
+ import_v414.z.object({
2454
+ type: import_v414.z.literal("response.output_text.delta"),
2455
+ item_id: import_v414.z.string(),
2456
+ delta: import_v414.z.string(),
2457
+ logprobs: import_v414.z.array(
2458
+ import_v414.z.object({
2459
+ token: import_v414.z.string(),
2460
+ logprob: import_v414.z.number(),
2461
+ top_logprobs: import_v414.z.array(
2462
+ import_v414.z.object({
2463
+ token: import_v414.z.string(),
2464
+ logprob: import_v414.z.number()
2457
2465
  })
2458
2466
  )
2459
2467
  })
2460
2468
  ).nullish()
2461
2469
  }),
2462
- z14.object({
2463
- type: z14.enum(["response.completed", "response.incomplete"]),
2464
- response: z14.object({
2465
- incomplete_details: z14.object({ reason: z14.string() }).nullish(),
2466
- usage: z14.object({
2467
- input_tokens: z14.number(),
2468
- input_tokens_details: z14.object({ cached_tokens: z14.number().nullish() }).nullish(),
2469
- output_tokens: z14.number(),
2470
- output_tokens_details: z14.object({ reasoning_tokens: z14.number().nullish() }).nullish()
2470
+ import_v414.z.object({
2471
+ type: import_v414.z.enum(["response.completed", "response.incomplete"]),
2472
+ response: import_v414.z.object({
2473
+ incomplete_details: import_v414.z.object({ reason: import_v414.z.string() }).nullish(),
2474
+ usage: import_v414.z.object({
2475
+ input_tokens: import_v414.z.number(),
2476
+ input_tokens_details: import_v414.z.object({ cached_tokens: import_v414.z.number().nullish() }).nullish(),
2477
+ output_tokens: import_v414.z.number(),
2478
+ output_tokens_details: import_v414.z.object({ reasoning_tokens: import_v414.z.number().nullish() }).nullish()
2471
2479
  }),
2472
- service_tier: z14.string().nullish()
2480
+ service_tier: import_v414.z.string().nullish()
2473
2481
  })
2474
2482
  }),
2475
- z14.object({
2476
- type: z14.literal("response.created"),
2477
- response: z14.object({
2478
- id: z14.string(),
2479
- created_at: z14.number(),
2480
- model: z14.string(),
2481
- service_tier: z14.string().nullish()
2483
+ import_v414.z.object({
2484
+ type: import_v414.z.literal("response.created"),
2485
+ response: import_v414.z.object({
2486
+ id: import_v414.z.string(),
2487
+ created_at: import_v414.z.number(),
2488
+ model: import_v414.z.string(),
2489
+ service_tier: import_v414.z.string().nullish()
2482
2490
  })
2483
2491
  }),
2484
- z14.object({
2485
- type: z14.literal("response.output_item.added"),
2486
- output_index: z14.number(),
2487
- item: z14.discriminatedUnion("type", [
2488
- z14.object({
2489
- type: z14.literal("message"),
2490
- id: z14.string()
2492
+ import_v414.z.object({
2493
+ type: import_v414.z.literal("response.output_item.added"),
2494
+ output_index: import_v414.z.number(),
2495
+ item: import_v414.z.discriminatedUnion("type", [
2496
+ import_v414.z.object({
2497
+ type: import_v414.z.literal("message"),
2498
+ id: import_v414.z.string()
2491
2499
  }),
2492
- z14.object({
2493
- type: z14.literal("reasoning"),
2494
- id: z14.string(),
2495
- encrypted_content: z14.string().nullish()
2500
+ import_v414.z.object({
2501
+ type: import_v414.z.literal("reasoning"),
2502
+ id: import_v414.z.string(),
2503
+ encrypted_content: import_v414.z.string().nullish()
2496
2504
  }),
2497
- z14.object({
2498
- type: z14.literal("function_call"),
2499
- id: z14.string(),
2500
- call_id: z14.string(),
2501
- name: z14.string(),
2502
- arguments: z14.string()
2505
+ import_v414.z.object({
2506
+ type: import_v414.z.literal("function_call"),
2507
+ id: import_v414.z.string(),
2508
+ call_id: import_v414.z.string(),
2509
+ name: import_v414.z.string(),
2510
+ arguments: import_v414.z.string()
2503
2511
  }),
2504
- z14.object({
2505
- type: z14.literal("web_search_call"),
2506
- id: z14.string(),
2507
- status: z14.string(),
2508
- action: z14.object({
2509
- type: z14.literal("search"),
2510
- query: z14.string().optional()
2512
+ import_v414.z.object({
2513
+ type: import_v414.z.literal("web_search_call"),
2514
+ id: import_v414.z.string(),
2515
+ status: import_v414.z.string(),
2516
+ action: import_v414.z.object({
2517
+ type: import_v414.z.literal("search"),
2518
+ query: import_v414.z.string().optional()
2511
2519
  }).nullish()
2512
2520
  }),
2513
- z14.object({
2514
- type: z14.literal("computer_call"),
2515
- id: z14.string(),
2516
- status: z14.string()
2521
+ import_v414.z.object({
2522
+ type: import_v414.z.literal("computer_call"),
2523
+ id: import_v414.z.string(),
2524
+ status: import_v414.z.string()
2517
2525
  }),
2518
- z14.object({
2519
- type: z14.literal("file_search_call"),
2520
- id: z14.string()
2526
+ import_v414.z.object({
2527
+ type: import_v414.z.literal("file_search_call"),
2528
+ id: import_v414.z.string()
2521
2529
  }),
2522
- z14.object({
2523
- type: z14.literal("image_generation_call"),
2524
- id: z14.string()
2530
+ import_v414.z.object({
2531
+ type: import_v414.z.literal("image_generation_call"),
2532
+ id: import_v414.z.string()
2525
2533
  }),
2526
- z14.object({
2527
- type: z14.literal("code_interpreter_call"),
2528
- id: z14.string(),
2529
- container_id: z14.string(),
2530
- code: z14.string().nullable(),
2531
- outputs: z14.array(
2532
- z14.discriminatedUnion("type", [
2533
- z14.object({ type: z14.literal("logs"), logs: z14.string() }),
2534
- z14.object({ type: z14.literal("image"), url: z14.string() })
2534
+ import_v414.z.object({
2535
+ type: import_v414.z.literal("code_interpreter_call"),
2536
+ id: import_v414.z.string(),
2537
+ container_id: import_v414.z.string(),
2538
+ code: import_v414.z.string().nullable(),
2539
+ outputs: import_v414.z.array(
2540
+ import_v414.z.discriminatedUnion("type", [
2541
+ import_v414.z.object({ type: import_v414.z.literal("logs"), logs: import_v414.z.string() }),
2542
+ import_v414.z.object({ type: import_v414.z.literal("image"), url: import_v414.z.string() })
2535
2543
  ])
2536
2544
  ).nullable(),
2537
- status: z14.string()
2545
+ status: import_v414.z.string()
2538
2546
  })
2539
2547
  ])
2540
2548
  }),
2541
- z14.object({
2542
- type: z14.literal("response.output_item.done"),
2543
- output_index: z14.number(),
2544
- item: z14.discriminatedUnion("type", [
2545
- z14.object({
2546
- type: z14.literal("message"),
2547
- id: z14.string()
2549
+ import_v414.z.object({
2550
+ type: import_v414.z.literal("response.output_item.done"),
2551
+ output_index: import_v414.z.number(),
2552
+ item: import_v414.z.discriminatedUnion("type", [
2553
+ import_v414.z.object({
2554
+ type: import_v414.z.literal("message"),
2555
+ id: import_v414.z.string()
2548
2556
  }),
2549
- z14.object({
2550
- type: z14.literal("reasoning"),
2551
- id: z14.string(),
2552
- encrypted_content: z14.string().nullish()
2557
+ import_v414.z.object({
2558
+ type: import_v414.z.literal("reasoning"),
2559
+ id: import_v414.z.string(),
2560
+ encrypted_content: import_v414.z.string().nullish()
2553
2561
  }),
2554
- z14.object({
2555
- type: z14.literal("function_call"),
2556
- id: z14.string(),
2557
- call_id: z14.string(),
2558
- name: z14.string(),
2559
- arguments: z14.string(),
2560
- status: z14.literal("completed")
2562
+ import_v414.z.object({
2563
+ type: import_v414.z.literal("function_call"),
2564
+ id: import_v414.z.string(),
2565
+ call_id: import_v414.z.string(),
2566
+ name: import_v414.z.string(),
2567
+ arguments: import_v414.z.string(),
2568
+ status: import_v414.z.literal("completed")
2561
2569
  }),
2562
- z14.object({
2563
- type: z14.literal("code_interpreter_call"),
2564
- id: z14.string(),
2565
- code: z14.string().nullable(),
2566
- container_id: z14.string(),
2567
- outputs: z14.array(
2568
- z14.discriminatedUnion("type", [
2569
- z14.object({ type: z14.literal("logs"), logs: z14.string() }),
2570
- z14.object({ type: z14.literal("image"), url: z14.string() })
2570
+ import_v414.z.object({
2571
+ type: import_v414.z.literal("code_interpreter_call"),
2572
+ id: import_v414.z.string(),
2573
+ code: import_v414.z.string().nullable(),
2574
+ container_id: import_v414.z.string(),
2575
+ outputs: import_v414.z.array(
2576
+ import_v414.z.discriminatedUnion("type", [
2577
+ import_v414.z.object({ type: import_v414.z.literal("logs"), logs: import_v414.z.string() }),
2578
+ import_v414.z.object({ type: import_v414.z.literal("image"), url: import_v414.z.string() })
2571
2579
  ])
2572
2580
  ).nullable()
2573
2581
  }),
2574
- z14.object({
2575
- type: z14.literal("image_generation_call"),
2576
- id: z14.string(),
2577
- result: z14.string()
2582
+ import_v414.z.object({
2583
+ type: import_v414.z.literal("image_generation_call"),
2584
+ id: import_v414.z.string(),
2585
+ result: import_v414.z.string()
2578
2586
  }),
2579
- z14.object({
2580
- type: z14.literal("web_search_call"),
2581
- id: z14.string(),
2582
- status: z14.string(),
2583
- action: z14.discriminatedUnion("type", [
2584
- z14.object({
2585
- type: z14.literal("search"),
2586
- query: z14.string().nullish()
2587
+ import_v414.z.object({
2588
+ type: import_v414.z.literal("web_search_call"),
2589
+ id: import_v414.z.string(),
2590
+ status: import_v414.z.string(),
2591
+ action: import_v414.z.discriminatedUnion("type", [
2592
+ import_v414.z.object({
2593
+ type: import_v414.z.literal("search"),
2594
+ query: import_v414.z.string().nullish()
2587
2595
  }),
2588
- z14.object({
2589
- type: z14.literal("open_page"),
2590
- url: z14.string()
2596
+ import_v414.z.object({
2597
+ type: import_v414.z.literal("open_page"),
2598
+ url: import_v414.z.string()
2591
2599
  }),
2592
- z14.object({
2593
- type: z14.literal("find"),
2594
- url: z14.string(),
2595
- pattern: z14.string()
2600
+ import_v414.z.object({
2601
+ type: import_v414.z.literal("find"),
2602
+ url: import_v414.z.string(),
2603
+ pattern: import_v414.z.string()
2596
2604
  })
2597
2605
  ]).nullish()
2598
2606
  }),
2599
- z14.object({
2600
- type: z14.literal("file_search_call"),
2601
- id: z14.string(),
2602
- queries: z14.array(z14.string()),
2603
- results: z14.array(
2604
- z14.object({
2605
- attributes: z14.record(z14.string(), z14.unknown()),
2606
- file_id: z14.string(),
2607
- filename: z14.string(),
2608
- score: z14.number(),
2609
- text: z14.string()
2607
+ import_v414.z.object({
2608
+ type: import_v414.z.literal("file_search_call"),
2609
+ id: import_v414.z.string(),
2610
+ queries: import_v414.z.array(import_v414.z.string()),
2611
+ results: import_v414.z.array(
2612
+ import_v414.z.object({
2613
+ attributes: import_v414.z.record(import_v414.z.string(), import_v414.z.unknown()),
2614
+ file_id: import_v414.z.string(),
2615
+ filename: import_v414.z.string(),
2616
+ score: import_v414.z.number(),
2617
+ text: import_v414.z.string()
2610
2618
  })
2611
2619
  ).nullish()
2612
2620
  }),
2613
- z14.object({
2614
- type: z14.literal("local_shell_call"),
2615
- id: z14.string(),
2616
- call_id: z14.string(),
2617
- action: z14.object({
2618
- type: z14.literal("exec"),
2619
- command: z14.array(z14.string()),
2620
- timeout_ms: z14.number().optional(),
2621
- user: z14.string().optional(),
2622
- working_directory: z14.string().optional(),
2623
- env: z14.record(z14.string(), z14.string()).optional()
2621
+ import_v414.z.object({
2622
+ type: import_v414.z.literal("local_shell_call"),
2623
+ id: import_v414.z.string(),
2624
+ call_id: import_v414.z.string(),
2625
+ action: import_v414.z.object({
2626
+ type: import_v414.z.literal("exec"),
2627
+ command: import_v414.z.array(import_v414.z.string()),
2628
+ timeout_ms: import_v414.z.number().optional(),
2629
+ user: import_v414.z.string().optional(),
2630
+ working_directory: import_v414.z.string().optional(),
2631
+ env: import_v414.z.record(import_v414.z.string(), import_v414.z.string()).optional()
2624
2632
  })
2625
2633
  }),
2626
- z14.object({
2627
- type: z14.literal("computer_call"),
2628
- id: z14.string(),
2629
- status: z14.literal("completed")
2634
+ import_v414.z.object({
2635
+ type: import_v414.z.literal("computer_call"),
2636
+ id: import_v414.z.string(),
2637
+ status: import_v414.z.literal("completed")
2630
2638
  })
2631
2639
  ])
2632
2640
  }),
2633
- z14.object({
2634
- type: z14.literal("response.function_call_arguments.delta"),
2635
- item_id: z14.string(),
2636
- output_index: z14.number(),
2637
- delta: z14.string()
2641
+ import_v414.z.object({
2642
+ type: import_v414.z.literal("response.function_call_arguments.delta"),
2643
+ item_id: import_v414.z.string(),
2644
+ output_index: import_v414.z.number(),
2645
+ delta: import_v414.z.string()
2638
2646
  }),
2639
- z14.object({
2640
- type: z14.literal("response.image_generation_call.partial_image"),
2641
- item_id: z14.string(),
2642
- output_index: z14.number(),
2643
- partial_image_b64: z14.string()
2647
+ import_v414.z.object({
2648
+ type: import_v414.z.literal("response.image_generation_call.partial_image"),
2649
+ item_id: import_v414.z.string(),
2650
+ output_index: import_v414.z.number(),
2651
+ partial_image_b64: import_v414.z.string()
2644
2652
  }),
2645
- z14.object({
2646
- type: z14.literal("response.code_interpreter_call_code.delta"),
2647
- item_id: z14.string(),
2648
- output_index: z14.number(),
2649
- delta: z14.string()
2653
+ import_v414.z.object({
2654
+ type: import_v414.z.literal("response.code_interpreter_call_code.delta"),
2655
+ item_id: import_v414.z.string(),
2656
+ output_index: import_v414.z.number(),
2657
+ delta: import_v414.z.string()
2650
2658
  }),
2651
- z14.object({
2652
- type: z14.literal("response.code_interpreter_call_code.done"),
2653
- item_id: z14.string(),
2654
- output_index: z14.number(),
2655
- code: z14.string()
2659
+ import_v414.z.object({
2660
+ type: import_v414.z.literal("response.code_interpreter_call_code.done"),
2661
+ item_id: import_v414.z.string(),
2662
+ output_index: import_v414.z.number(),
2663
+ code: import_v414.z.string()
2656
2664
  }),
2657
- z14.object({
2658
- type: z14.literal("response.output_text.annotation.added"),
2659
- annotation: z14.discriminatedUnion("type", [
2660
- z14.object({
2661
- type: z14.literal("url_citation"),
2662
- url: z14.string(),
2663
- title: z14.string()
2665
+ import_v414.z.object({
2666
+ type: import_v414.z.literal("response.output_text.annotation.added"),
2667
+ annotation: import_v414.z.discriminatedUnion("type", [
2668
+ import_v414.z.object({
2669
+ type: import_v414.z.literal("url_citation"),
2670
+ url: import_v414.z.string(),
2671
+ title: import_v414.z.string()
2664
2672
  }),
2665
- z14.object({
2666
- type: z14.literal("file_citation"),
2667
- file_id: z14.string(),
2668
- filename: z14.string().nullish(),
2669
- index: z14.number().nullish(),
2670
- start_index: z14.number().nullish(),
2671
- end_index: z14.number().nullish(),
2672
- quote: z14.string().nullish()
2673
+ import_v414.z.object({
2674
+ type: import_v414.z.literal("file_citation"),
2675
+ file_id: import_v414.z.string(),
2676
+ filename: import_v414.z.string().nullish(),
2677
+ index: import_v414.z.number().nullish(),
2678
+ start_index: import_v414.z.number().nullish(),
2679
+ end_index: import_v414.z.number().nullish(),
2680
+ quote: import_v414.z.string().nullish()
2673
2681
  })
2674
2682
  ])
2675
2683
  }),
2676
- z14.object({
2677
- type: z14.literal("response.reasoning_summary_part.added"),
2678
- item_id: z14.string(),
2679
- summary_index: z14.number()
2684
+ import_v414.z.object({
2685
+ type: import_v414.z.literal("response.reasoning_summary_part.added"),
2686
+ item_id: import_v414.z.string(),
2687
+ summary_index: import_v414.z.number()
2680
2688
  }),
2681
- z14.object({
2682
- type: z14.literal("response.reasoning_summary_text.delta"),
2683
- item_id: z14.string(),
2684
- summary_index: z14.number(),
2685
- delta: z14.string()
2689
+ import_v414.z.object({
2690
+ type: import_v414.z.literal("response.reasoning_summary_text.delta"),
2691
+ item_id: import_v414.z.string(),
2692
+ summary_index: import_v414.z.number(),
2693
+ delta: import_v414.z.string()
2686
2694
  }),
2687
- z14.object({
2688
- type: z14.literal("error"),
2689
- code: z14.string(),
2690
- message: z14.string(),
2691
- param: z14.string().nullish(),
2692
- sequence_number: z14.number()
2695
+ import_v414.z.object({
2696
+ type: import_v414.z.literal("error"),
2697
+ code: import_v414.z.string(),
2698
+ message: import_v414.z.string(),
2699
+ param: import_v414.z.string().nullish(),
2700
+ sequence_number: import_v414.z.number()
2693
2701
  }),
2694
- z14.object({ type: z14.string() }).loose().transform((value) => ({
2702
+ import_v414.z.object({ type: import_v414.z.string() }).loose().transform((value) => ({
2695
2703
  type: "unknown_chunk",
2696
2704
  message: value.type
2697
2705
  }))
@@ -2701,158 +2709,158 @@ var openaiResponsesChunkSchema = (0, import_provider_utils21.lazyValidator)(
2701
2709
  );
2702
2710
  var openaiResponsesResponseSchema = (0, import_provider_utils21.lazyValidator)(
2703
2711
  () => (0, import_provider_utils21.zodSchema)(
2704
- z14.object({
2705
- id: z14.string(),
2706
- created_at: z14.number(),
2707
- error: z14.object({
2708
- code: z14.string(),
2709
- message: z14.string()
2712
+ import_v414.z.object({
2713
+ id: import_v414.z.string(),
2714
+ created_at: import_v414.z.number(),
2715
+ error: import_v414.z.object({
2716
+ code: import_v414.z.string(),
2717
+ message: import_v414.z.string()
2710
2718
  }).nullish(),
2711
- model: z14.string(),
2712
- output: z14.array(
2713
- z14.discriminatedUnion("type", [
2714
- z14.object({
2715
- type: z14.literal("message"),
2716
- role: z14.literal("assistant"),
2717
- id: z14.string(),
2718
- content: z14.array(
2719
- z14.object({
2720
- type: z14.literal("output_text"),
2721
- text: z14.string(),
2722
- logprobs: z14.array(
2723
- z14.object({
2724
- token: z14.string(),
2725
- logprob: z14.number(),
2726
- top_logprobs: z14.array(
2727
- z14.object({
2728
- token: z14.string(),
2729
- logprob: z14.number()
2719
+ model: import_v414.z.string(),
2720
+ output: import_v414.z.array(
2721
+ import_v414.z.discriminatedUnion("type", [
2722
+ import_v414.z.object({
2723
+ type: import_v414.z.literal("message"),
2724
+ role: import_v414.z.literal("assistant"),
2725
+ id: import_v414.z.string(),
2726
+ content: import_v414.z.array(
2727
+ import_v414.z.object({
2728
+ type: import_v414.z.literal("output_text"),
2729
+ text: import_v414.z.string(),
2730
+ logprobs: import_v414.z.array(
2731
+ import_v414.z.object({
2732
+ token: import_v414.z.string(),
2733
+ logprob: import_v414.z.number(),
2734
+ top_logprobs: import_v414.z.array(
2735
+ import_v414.z.object({
2736
+ token: import_v414.z.string(),
2737
+ logprob: import_v414.z.number()
2730
2738
  })
2731
2739
  )
2732
2740
  })
2733
2741
  ).nullish(),
2734
- annotations: z14.array(
2735
- z14.discriminatedUnion("type", [
2736
- z14.object({
2737
- type: z14.literal("url_citation"),
2738
- start_index: z14.number(),
2739
- end_index: z14.number(),
2740
- url: z14.string(),
2741
- title: z14.string()
2742
+ annotations: import_v414.z.array(
2743
+ import_v414.z.discriminatedUnion("type", [
2744
+ import_v414.z.object({
2745
+ type: import_v414.z.literal("url_citation"),
2746
+ start_index: import_v414.z.number(),
2747
+ end_index: import_v414.z.number(),
2748
+ url: import_v414.z.string(),
2749
+ title: import_v414.z.string()
2742
2750
  }),
2743
- z14.object({
2744
- type: z14.literal("file_citation"),
2745
- file_id: z14.string(),
2746
- filename: z14.string().nullish(),
2747
- index: z14.number().nullish(),
2748
- start_index: z14.number().nullish(),
2749
- end_index: z14.number().nullish(),
2750
- quote: z14.string().nullish()
2751
+ import_v414.z.object({
2752
+ type: import_v414.z.literal("file_citation"),
2753
+ file_id: import_v414.z.string(),
2754
+ filename: import_v414.z.string().nullish(),
2755
+ index: import_v414.z.number().nullish(),
2756
+ start_index: import_v414.z.number().nullish(),
2757
+ end_index: import_v414.z.number().nullish(),
2758
+ quote: import_v414.z.string().nullish()
2751
2759
  }),
2752
- z14.object({
2753
- type: z14.literal("container_file_citation")
2760
+ import_v414.z.object({
2761
+ type: import_v414.z.literal("container_file_citation")
2754
2762
  })
2755
2763
  ])
2756
2764
  )
2757
2765
  })
2758
2766
  )
2759
2767
  }),
2760
- z14.object({
2761
- type: z14.literal("web_search_call"),
2762
- id: z14.string(),
2763
- status: z14.string(),
2764
- action: z14.discriminatedUnion("type", [
2765
- z14.object({
2766
- type: z14.literal("search"),
2767
- query: z14.string().nullish()
2768
+ import_v414.z.object({
2769
+ type: import_v414.z.literal("web_search_call"),
2770
+ id: import_v414.z.string(),
2771
+ status: import_v414.z.string(),
2772
+ action: import_v414.z.discriminatedUnion("type", [
2773
+ import_v414.z.object({
2774
+ type: import_v414.z.literal("search"),
2775
+ query: import_v414.z.string().nullish()
2768
2776
  }),
2769
- z14.object({
2770
- type: z14.literal("open_page"),
2771
- url: z14.string()
2777
+ import_v414.z.object({
2778
+ type: import_v414.z.literal("open_page"),
2779
+ url: import_v414.z.string()
2772
2780
  }),
2773
- z14.object({
2774
- type: z14.literal("find"),
2775
- url: z14.string(),
2776
- pattern: z14.string()
2781
+ import_v414.z.object({
2782
+ type: import_v414.z.literal("find"),
2783
+ url: import_v414.z.string(),
2784
+ pattern: import_v414.z.string()
2777
2785
  })
2778
2786
  ]).nullish()
2779
2787
  }),
2780
- z14.object({
2781
- type: z14.literal("file_search_call"),
2782
- id: z14.string(),
2783
- queries: z14.array(z14.string()),
2784
- results: z14.array(
2785
- z14.object({
2786
- attributes: z14.record(z14.string(), z14.unknown()),
2787
- file_id: z14.string(),
2788
- filename: z14.string(),
2789
- score: z14.number(),
2790
- text: z14.string()
2788
+ import_v414.z.object({
2789
+ type: import_v414.z.literal("file_search_call"),
2790
+ id: import_v414.z.string(),
2791
+ queries: import_v414.z.array(import_v414.z.string()),
2792
+ results: import_v414.z.array(
2793
+ import_v414.z.object({
2794
+ attributes: import_v414.z.record(import_v414.z.string(), import_v414.z.unknown()),
2795
+ file_id: import_v414.z.string(),
2796
+ filename: import_v414.z.string(),
2797
+ score: import_v414.z.number(),
2798
+ text: import_v414.z.string()
2791
2799
  })
2792
2800
  ).nullish()
2793
2801
  }),
2794
- z14.object({
2795
- type: z14.literal("code_interpreter_call"),
2796
- id: z14.string(),
2797
- code: z14.string().nullable(),
2798
- container_id: z14.string(),
2799
- outputs: z14.array(
2800
- z14.discriminatedUnion("type", [
2801
- z14.object({ type: z14.literal("logs"), logs: z14.string() }),
2802
- z14.object({ type: z14.literal("image"), url: z14.string() })
2802
+ import_v414.z.object({
2803
+ type: import_v414.z.literal("code_interpreter_call"),
2804
+ id: import_v414.z.string(),
2805
+ code: import_v414.z.string().nullable(),
2806
+ container_id: import_v414.z.string(),
2807
+ outputs: import_v414.z.array(
2808
+ import_v414.z.discriminatedUnion("type", [
2809
+ import_v414.z.object({ type: import_v414.z.literal("logs"), logs: import_v414.z.string() }),
2810
+ import_v414.z.object({ type: import_v414.z.literal("image"), url: import_v414.z.string() })
2803
2811
  ])
2804
2812
  ).nullable()
2805
2813
  }),
2806
- z14.object({
2807
- type: z14.literal("image_generation_call"),
2808
- id: z14.string(),
2809
- result: z14.string()
2814
+ import_v414.z.object({
2815
+ type: import_v414.z.literal("image_generation_call"),
2816
+ id: import_v414.z.string(),
2817
+ result: import_v414.z.string()
2810
2818
  }),
2811
- z14.object({
2812
- type: z14.literal("local_shell_call"),
2813
- id: z14.string(),
2814
- call_id: z14.string(),
2815
- action: z14.object({
2816
- type: z14.literal("exec"),
2817
- command: z14.array(z14.string()),
2818
- timeout_ms: z14.number().optional(),
2819
- user: z14.string().optional(),
2820
- working_directory: z14.string().optional(),
2821
- env: z14.record(z14.string(), z14.string()).optional()
2819
+ import_v414.z.object({
2820
+ type: import_v414.z.literal("local_shell_call"),
2821
+ id: import_v414.z.string(),
2822
+ call_id: import_v414.z.string(),
2823
+ action: import_v414.z.object({
2824
+ type: import_v414.z.literal("exec"),
2825
+ command: import_v414.z.array(import_v414.z.string()),
2826
+ timeout_ms: import_v414.z.number().optional(),
2827
+ user: import_v414.z.string().optional(),
2828
+ working_directory: import_v414.z.string().optional(),
2829
+ env: import_v414.z.record(import_v414.z.string(), import_v414.z.string()).optional()
2822
2830
  })
2823
2831
  }),
2824
- z14.object({
2825
- type: z14.literal("function_call"),
2826
- call_id: z14.string(),
2827
- name: z14.string(),
2828
- arguments: z14.string(),
2829
- id: z14.string()
2832
+ import_v414.z.object({
2833
+ type: import_v414.z.literal("function_call"),
2834
+ call_id: import_v414.z.string(),
2835
+ name: import_v414.z.string(),
2836
+ arguments: import_v414.z.string(),
2837
+ id: import_v414.z.string()
2830
2838
  }),
2831
- z14.object({
2832
- type: z14.literal("computer_call"),
2833
- id: z14.string(),
2834
- status: z14.string().optional()
2839
+ import_v414.z.object({
2840
+ type: import_v414.z.literal("computer_call"),
2841
+ id: import_v414.z.string(),
2842
+ status: import_v414.z.string().optional()
2835
2843
  }),
2836
- z14.object({
2837
- type: z14.literal("reasoning"),
2838
- id: z14.string(),
2839
- encrypted_content: z14.string().nullish(),
2840
- summary: z14.array(
2841
- z14.object({
2842
- type: z14.literal("summary_text"),
2843
- text: z14.string()
2844
+ import_v414.z.object({
2845
+ type: import_v414.z.literal("reasoning"),
2846
+ id: import_v414.z.string(),
2847
+ encrypted_content: import_v414.z.string().nullish(),
2848
+ summary: import_v414.z.array(
2849
+ import_v414.z.object({
2850
+ type: import_v414.z.literal("summary_text"),
2851
+ text: import_v414.z.string()
2844
2852
  })
2845
2853
  )
2846
2854
  })
2847
2855
  ])
2848
2856
  ),
2849
- service_tier: z14.string().nullish(),
2850
- incomplete_details: z14.object({ reason: z14.string() }).nullish(),
2851
- usage: z14.object({
2852
- input_tokens: z14.number(),
2853
- input_tokens_details: z14.object({ cached_tokens: z14.number().nullish() }).nullish(),
2854
- output_tokens: z14.number(),
2855
- output_tokens_details: z14.object({ reasoning_tokens: z14.number().nullish() }).nullish()
2857
+ service_tier: import_v414.z.string().nullish(),
2858
+ incomplete_details: import_v414.z.object({ reason: import_v414.z.string() }).nullish(),
2859
+ usage: import_v414.z.object({
2860
+ input_tokens: import_v414.z.number(),
2861
+ input_tokens_details: import_v414.z.object({ cached_tokens: import_v414.z.number().nullish() }).nullish(),
2862
+ output_tokens: import_v414.z.number(),
2863
+ output_tokens_details: import_v414.z.object({ reasoning_tokens: import_v414.z.number().nullish() }).nullish()
2856
2864
  })
2857
2865
  })
2858
2866
  )
@@ -2860,7 +2868,7 @@ var openaiResponsesResponseSchema = (0, import_provider_utils21.lazyValidator)(
2860
2868
 
2861
2869
  // src/responses/openai-responses-options.ts
2862
2870
  var import_provider_utils22 = require("@ai-sdk/provider-utils");
2863
- var z15 = __toESM(require("zod/v4"));
2871
+ var import_v415 = require("zod/v4");
2864
2872
  var TOP_LOGPROBS_MAX = 20;
2865
2873
  var openaiResponsesReasoningModelIds = [
2866
2874
  "o1",
@@ -2921,15 +2929,15 @@ var openaiResponsesModelIds = [
2921
2929
  ];
2922
2930
  var openaiResponsesProviderOptionsSchema = (0, import_provider_utils22.lazyValidator)(
2923
2931
  () => (0, import_provider_utils22.zodSchema)(
2924
- z15.object({
2925
- include: z15.array(
2926
- z15.enum([
2932
+ import_v415.z.object({
2933
+ include: import_v415.z.array(
2934
+ import_v415.z.enum([
2927
2935
  "reasoning.encrypted_content",
2928
2936
  "file_search_call.results",
2929
2937
  "message.output_text.logprobs"
2930
2938
  ])
2931
2939
  ).nullish(),
2932
- instructions: z15.string().nullish(),
2940
+ instructions: import_v415.z.string().nullish(),
2933
2941
  /**
2934
2942
  * Return the log probabilities of the tokens.
2935
2943
  *
@@ -2942,25 +2950,25 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils22.lazyValid
2942
2950
  * @see https://platform.openai.com/docs/api-reference/responses/create
2943
2951
  * @see https://cookbook.openai.com/examples/using_logprobs
2944
2952
  */
2945
- logprobs: z15.union([z15.boolean(), z15.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
2953
+ logprobs: import_v415.z.union([import_v415.z.boolean(), import_v415.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
2946
2954
  /**
2947
2955
  * The maximum number of total calls to built-in tools that can be processed in a response.
2948
2956
  * This maximum number applies across all built-in tool calls, not per individual tool.
2949
2957
  * Any further attempts to call a tool by the model will be ignored.
2950
2958
  */
2951
- maxToolCalls: z15.number().nullish(),
2952
- metadata: z15.any().nullish(),
2953
- parallelToolCalls: z15.boolean().nullish(),
2954
- previousResponseId: z15.string().nullish(),
2955
- promptCacheKey: z15.string().nullish(),
2956
- reasoningEffort: z15.string().nullish(),
2957
- reasoningSummary: z15.string().nullish(),
2958
- safetyIdentifier: z15.string().nullish(),
2959
- serviceTier: z15.enum(["auto", "flex", "priority", "default"]).nullish(),
2960
- store: z15.boolean().nullish(),
2961
- strictJsonSchema: z15.boolean().nullish(),
2962
- textVerbosity: z15.enum(["low", "medium", "high"]).nullish(),
2963
- user: z15.string().nullish()
2959
+ maxToolCalls: import_v415.z.number().nullish(),
2960
+ metadata: import_v415.z.any().nullish(),
2961
+ parallelToolCalls: import_v415.z.boolean().nullish(),
2962
+ previousResponseId: import_v415.z.string().nullish(),
2963
+ promptCacheKey: import_v415.z.string().nullish(),
2964
+ reasoningEffort: import_v415.z.string().nullish(),
2965
+ reasoningSummary: import_v415.z.string().nullish(),
2966
+ safetyIdentifier: import_v415.z.string().nullish(),
2967
+ serviceTier: import_v415.z.enum(["auto", "flex", "priority", "default"]).nullish(),
2968
+ store: import_v415.z.boolean().nullish(),
2969
+ strictJsonSchema: import_v415.z.boolean().nullish(),
2970
+ textVerbosity: import_v415.z.enum(["low", "medium", "high"]).nullish(),
2971
+ user: import_v415.z.string().nullish()
2964
2972
  })
2965
2973
  )
2966
2974
  );
@@ -2970,22 +2978,22 @@ var import_provider7 = require("@ai-sdk/provider");
2970
2978
 
2971
2979
  // src/tool/code-interpreter.ts
2972
2980
  var import_provider_utils23 = require("@ai-sdk/provider-utils");
2973
- var z16 = __toESM(require("zod/v4"));
2981
+ var import_v416 = require("zod/v4");
2974
2982
  var codeInterpreterInputSchema = (0, import_provider_utils23.lazySchema)(
2975
2983
  () => (0, import_provider_utils23.zodSchema)(
2976
- z16.object({
2977
- code: z16.string().nullish(),
2978
- containerId: z16.string()
2984
+ import_v416.z.object({
2985
+ code: import_v416.z.string().nullish(),
2986
+ containerId: import_v416.z.string()
2979
2987
  })
2980
2988
  )
2981
2989
  );
2982
2990
  var codeInterpreterOutputSchema = (0, import_provider_utils23.lazySchema)(
2983
2991
  () => (0, import_provider_utils23.zodSchema)(
2984
- z16.object({
2985
- outputs: z16.array(
2986
- z16.discriminatedUnion("type", [
2987
- z16.object({ type: z16.literal("logs"), logs: z16.string() }),
2988
- z16.object({ type: z16.literal("image"), url: z16.string() })
2992
+ import_v416.z.object({
2993
+ outputs: import_v416.z.array(
2994
+ import_v416.z.discriminatedUnion("type", [
2995
+ import_v416.z.object({ type: import_v416.z.literal("logs"), logs: import_v416.z.string() }),
2996
+ import_v416.z.object({ type: import_v416.z.literal("image"), url: import_v416.z.string() })
2989
2997
  ])
2990
2998
  ).nullish()
2991
2999
  })
@@ -2993,11 +3001,11 @@ var codeInterpreterOutputSchema = (0, import_provider_utils23.lazySchema)(
2993
3001
  );
2994
3002
  var codeInterpreterArgsSchema = (0, import_provider_utils23.lazySchema)(
2995
3003
  () => (0, import_provider_utils23.zodSchema)(
2996
- z16.object({
2997
- container: z16.union([
2998
- z16.string(),
2999
- z16.object({
3000
- fileIds: z16.array(z16.string()).optional()
3004
+ import_v416.z.object({
3005
+ container: import_v416.z.union([
3006
+ import_v416.z.string(),
3007
+ import_v416.z.object({
3008
+ fileIds: import_v416.z.array(import_v416.z.string()).optional()
3001
3009
  })
3002
3010
  ]).optional()
3003
3011
  })
@@ -3015,42 +3023,42 @@ var codeInterpreter = (args = {}) => {
3015
3023
 
3016
3024
  // src/tool/file-search.ts
3017
3025
  var import_provider_utils24 = require("@ai-sdk/provider-utils");
3018
- var z17 = __toESM(require("zod/v4"));
3019
- var comparisonFilterSchema = z17.object({
3020
- key: z17.string(),
3021
- type: z17.enum(["eq", "ne", "gt", "gte", "lt", "lte"]),
3022
- value: z17.union([z17.string(), z17.number(), z17.boolean()])
3026
+ var import_v417 = require("zod/v4");
3027
+ var comparisonFilterSchema = import_v417.z.object({
3028
+ key: import_v417.z.string(),
3029
+ type: import_v417.z.enum(["eq", "ne", "gt", "gte", "lt", "lte"]),
3030
+ value: import_v417.z.union([import_v417.z.string(), import_v417.z.number(), import_v417.z.boolean()])
3023
3031
  });
3024
- var compoundFilterSchema = z17.object({
3025
- type: z17.enum(["and", "or"]),
3026
- filters: z17.array(
3027
- z17.union([comparisonFilterSchema, z17.lazy(() => compoundFilterSchema)])
3032
+ var compoundFilterSchema = import_v417.z.object({
3033
+ type: import_v417.z.enum(["and", "or"]),
3034
+ filters: import_v417.z.array(
3035
+ import_v417.z.union([comparisonFilterSchema, import_v417.z.lazy(() => compoundFilterSchema)])
3028
3036
  )
3029
3037
  });
3030
3038
  var fileSearchArgsSchema = (0, import_provider_utils24.lazySchema)(
3031
3039
  () => (0, import_provider_utils24.zodSchema)(
3032
- z17.object({
3033
- vectorStoreIds: z17.array(z17.string()),
3034
- maxNumResults: z17.number().optional(),
3035
- ranking: z17.object({
3036
- ranker: z17.string().optional(),
3037
- scoreThreshold: z17.number().optional()
3040
+ import_v417.z.object({
3041
+ vectorStoreIds: import_v417.z.array(import_v417.z.string()),
3042
+ maxNumResults: import_v417.z.number().optional(),
3043
+ ranking: import_v417.z.object({
3044
+ ranker: import_v417.z.string().optional(),
3045
+ scoreThreshold: import_v417.z.number().optional()
3038
3046
  }).optional(),
3039
- filters: z17.union([comparisonFilterSchema, compoundFilterSchema]).optional()
3047
+ filters: import_v417.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
3040
3048
  })
3041
3049
  )
3042
3050
  );
3043
3051
  var fileSearchOutputSchema = (0, import_provider_utils24.lazySchema)(
3044
3052
  () => (0, import_provider_utils24.zodSchema)(
3045
- z17.object({
3046
- queries: z17.array(z17.string()),
3047
- results: z17.array(
3048
- z17.object({
3049
- attributes: z17.record(z17.string(), z17.unknown()),
3050
- fileId: z17.string(),
3051
- filename: z17.string(),
3052
- score: z17.number(),
3053
- text: z17.string()
3053
+ import_v417.z.object({
3054
+ queries: import_v417.z.array(import_v417.z.string()),
3055
+ results: import_v417.z.array(
3056
+ import_v417.z.object({
3057
+ attributes: import_v417.z.record(import_v417.z.string(), import_v417.z.unknown()),
3058
+ fileId: import_v417.z.string(),
3059
+ filename: import_v417.z.string(),
3060
+ score: import_v417.z.number(),
3061
+ text: import_v417.z.string()
3054
3062
  })
3055
3063
  ).nullable()
3056
3064
  })
@@ -3059,46 +3067,46 @@ var fileSearchOutputSchema = (0, import_provider_utils24.lazySchema)(
3059
3067
  var fileSearch = (0, import_provider_utils24.createProviderDefinedToolFactoryWithOutputSchema)({
3060
3068
  id: "openai.file_search",
3061
3069
  name: "file_search",
3062
- inputSchema: z17.object({}),
3070
+ inputSchema: import_v417.z.object({}),
3063
3071
  outputSchema: fileSearchOutputSchema
3064
3072
  });
3065
3073
 
3066
3074
  // src/tool/web-search.ts
3067
3075
  var import_provider_utils25 = require("@ai-sdk/provider-utils");
3068
- var z18 = __toESM(require("zod/v4"));
3076
+ var import_v418 = require("zod/v4");
3069
3077
  var webSearchArgsSchema = (0, import_provider_utils25.lazySchema)(
3070
3078
  () => (0, import_provider_utils25.zodSchema)(
3071
- z18.object({
3072
- filters: z18.object({
3073
- allowedDomains: z18.array(z18.string()).optional()
3079
+ import_v418.z.object({
3080
+ filters: import_v418.z.object({
3081
+ allowedDomains: import_v418.z.array(import_v418.z.string()).optional()
3074
3082
  }).optional(),
3075
- searchContextSize: z18.enum(["low", "medium", "high"]).optional(),
3076
- userLocation: z18.object({
3077
- type: z18.literal("approximate"),
3078
- country: z18.string().optional(),
3079
- city: z18.string().optional(),
3080
- region: z18.string().optional(),
3081
- timezone: z18.string().optional()
3083
+ searchContextSize: import_v418.z.enum(["low", "medium", "high"]).optional(),
3084
+ userLocation: import_v418.z.object({
3085
+ type: import_v418.z.literal("approximate"),
3086
+ country: import_v418.z.string().optional(),
3087
+ city: import_v418.z.string().optional(),
3088
+ region: import_v418.z.string().optional(),
3089
+ timezone: import_v418.z.string().optional()
3082
3090
  }).optional()
3083
3091
  })
3084
3092
  )
3085
3093
  );
3086
3094
  var webSearchInputSchema = (0, import_provider_utils25.lazySchema)(
3087
3095
  () => (0, import_provider_utils25.zodSchema)(
3088
- z18.object({
3089
- action: z18.discriminatedUnion("type", [
3090
- z18.object({
3091
- type: z18.literal("search"),
3092
- query: z18.string().nullish()
3096
+ import_v418.z.object({
3097
+ action: import_v418.z.discriminatedUnion("type", [
3098
+ import_v418.z.object({
3099
+ type: import_v418.z.literal("search"),
3100
+ query: import_v418.z.string().nullish()
3093
3101
  }),
3094
- z18.object({
3095
- type: z18.literal("open_page"),
3096
- url: z18.string()
3102
+ import_v418.z.object({
3103
+ type: import_v418.z.literal("open_page"),
3104
+ url: import_v418.z.string()
3097
3105
  }),
3098
- z18.object({
3099
- type: z18.literal("find"),
3100
- url: z18.string(),
3101
- pattern: z18.string()
3106
+ import_v418.z.object({
3107
+ type: import_v418.z.literal("find"),
3108
+ url: import_v418.z.string(),
3109
+ pattern: import_v418.z.string()
3102
3110
  })
3103
3111
  ]).nullish()
3104
3112
  })
@@ -3112,61 +3120,61 @@ var webSearchToolFactory = (0, import_provider_utils25.createProviderDefinedTool
3112
3120
 
3113
3121
  // src/tool/web-search-preview.ts
3114
3122
  var import_provider_utils26 = require("@ai-sdk/provider-utils");
3115
- var z19 = __toESM(require("zod/v4"));
3123
+ var import_v419 = require("zod/v4");
3116
3124
  var webSearchPreviewArgsSchema = (0, import_provider_utils26.lazySchema)(
3117
3125
  () => (0, import_provider_utils26.zodSchema)(
3118
- z19.object({
3126
+ import_v419.z.object({
3119
3127
  /**
3120
3128
  * Search context size to use for the web search.
3121
3129
  * - high: Most comprehensive context, highest cost, slower response
3122
3130
  * - medium: Balanced context, cost, and latency (default)
3123
3131
  * - low: Least context, lowest cost, fastest response
3124
3132
  */
3125
- searchContextSize: z19.enum(["low", "medium", "high"]).optional(),
3133
+ searchContextSize: import_v419.z.enum(["low", "medium", "high"]).optional(),
3126
3134
  /**
3127
3135
  * User location information to provide geographically relevant search results.
3128
3136
  */
3129
- userLocation: z19.object({
3137
+ userLocation: import_v419.z.object({
3130
3138
  /**
3131
3139
  * Type of location (always 'approximate')
3132
3140
  */
3133
- type: z19.literal("approximate"),
3141
+ type: import_v419.z.literal("approximate"),
3134
3142
  /**
3135
3143
  * Two-letter ISO country code (e.g., 'US', 'GB')
3136
3144
  */
3137
- country: z19.string().optional(),
3145
+ country: import_v419.z.string().optional(),
3138
3146
  /**
3139
3147
  * City name (free text, e.g., 'Minneapolis')
3140
3148
  */
3141
- city: z19.string().optional(),
3149
+ city: import_v419.z.string().optional(),
3142
3150
  /**
3143
3151
  * Region name (free text, e.g., 'Minnesota')
3144
3152
  */
3145
- region: z19.string().optional(),
3153
+ region: import_v419.z.string().optional(),
3146
3154
  /**
3147
3155
  * IANA timezone (e.g., 'America/Chicago')
3148
3156
  */
3149
- timezone: z19.string().optional()
3157
+ timezone: import_v419.z.string().optional()
3150
3158
  }).optional()
3151
3159
  })
3152
3160
  )
3153
3161
  );
3154
3162
  var webSearchPreviewInputSchema = (0, import_provider_utils26.lazySchema)(
3155
3163
  () => (0, import_provider_utils26.zodSchema)(
3156
- z19.object({
3157
- action: z19.discriminatedUnion("type", [
3158
- z19.object({
3159
- type: z19.literal("search"),
3160
- query: z19.string().nullish()
3164
+ import_v419.z.object({
3165
+ action: import_v419.z.discriminatedUnion("type", [
3166
+ import_v419.z.object({
3167
+ type: import_v419.z.literal("search"),
3168
+ query: import_v419.z.string().nullish()
3161
3169
  }),
3162
- z19.object({
3163
- type: z19.literal("open_page"),
3164
- url: z19.string()
3170
+ import_v419.z.object({
3171
+ type: import_v419.z.literal("open_page"),
3172
+ url: import_v419.z.string()
3165
3173
  }),
3166
- z19.object({
3167
- type: z19.literal("find"),
3168
- url: z19.string(),
3169
- pattern: z19.string()
3174
+ import_v419.z.object({
3175
+ type: import_v419.z.literal("find"),
3176
+ url: import_v419.z.string(),
3177
+ pattern: import_v419.z.string()
3170
3178
  })
3171
3179
  ]).nullish()
3172
3180
  })
@@ -3180,29 +3188,29 @@ var webSearchPreview = (0, import_provider_utils26.createProviderDefinedToolFact
3180
3188
 
3181
3189
  // src/tool/image-generation.ts
3182
3190
  var import_provider_utils27 = require("@ai-sdk/provider-utils");
3183
- var z20 = __toESM(require("zod/v4"));
3191
+ var import_v420 = require("zod/v4");
3184
3192
  var imageGenerationArgsSchema = (0, import_provider_utils27.lazySchema)(
3185
3193
  () => (0, import_provider_utils27.zodSchema)(
3186
- z20.object({
3187
- background: z20.enum(["auto", "opaque", "transparent"]).optional(),
3188
- inputFidelity: z20.enum(["low", "high"]).optional(),
3189
- inputImageMask: z20.object({
3190
- fileId: z20.string().optional(),
3191
- imageUrl: z20.string().optional()
3194
+ import_v420.z.object({
3195
+ background: import_v420.z.enum(["auto", "opaque", "transparent"]).optional(),
3196
+ inputFidelity: import_v420.z.enum(["low", "high"]).optional(),
3197
+ inputImageMask: import_v420.z.object({
3198
+ fileId: import_v420.z.string().optional(),
3199
+ imageUrl: import_v420.z.string().optional()
3192
3200
  }).optional(),
3193
- model: z20.string().optional(),
3194
- moderation: z20.enum(["auto"]).optional(),
3195
- outputCompression: z20.number().int().min(0).max(100).optional(),
3196
- outputFormat: z20.enum(["png", "jpeg", "webp"]).optional(),
3197
- partialImages: z20.number().int().min(0).max(3).optional(),
3198
- quality: z20.enum(["auto", "low", "medium", "high"]).optional(),
3199
- size: z20.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
3201
+ model: import_v420.z.string().optional(),
3202
+ moderation: import_v420.z.enum(["auto"]).optional(),
3203
+ outputCompression: import_v420.z.number().int().min(0).max(100).optional(),
3204
+ outputFormat: import_v420.z.enum(["png", "jpeg", "webp"]).optional(),
3205
+ partialImages: import_v420.z.number().int().min(0).max(3).optional(),
3206
+ quality: import_v420.z.enum(["auto", "low", "medium", "high"]).optional(),
3207
+ size: import_v420.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
3200
3208
  }).strict()
3201
3209
  )
3202
3210
  );
3203
- var imageGenerationInputSchema = (0, import_provider_utils27.lazySchema)(() => (0, import_provider_utils27.zodSchema)(z20.object({})));
3211
+ var imageGenerationInputSchema = (0, import_provider_utils27.lazySchema)(() => (0, import_provider_utils27.zodSchema)(import_v420.z.object({})));
3204
3212
  var imageGenerationOutputSchema = (0, import_provider_utils27.lazySchema)(
3205
- () => (0, import_provider_utils27.zodSchema)(z20.object({ result: z20.string() }))
3213
+ () => (0, import_provider_utils27.zodSchema)(import_v420.z.object({ result: import_v420.z.string() }))
3206
3214
  );
3207
3215
  var imageGenerationToolFactory = (0, import_provider_utils27.createProviderDefinedToolFactoryWithOutputSchema)({
3208
3216
  id: "openai.image_generation",