@ai-sdk/openai 2.0.25 → 2.0.26

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.
@@ -2167,7 +2167,7 @@ import {
2167
2167
  parseProviderOptions as parseProviderOptions7,
2168
2168
  postJsonToApi as postJsonToApi6
2169
2169
  } from "@ai-sdk/provider-utils";
2170
- import { z as z16 } from "zod/v4";
2170
+ import { z as z17 } from "zod/v4";
2171
2171
 
2172
2172
  // src/responses/convert-to-openai-responses-messages.ts
2173
2173
  import {
@@ -2372,18 +2372,18 @@ var openaiResponsesReasoningProviderOptionsSchema = z14.object({
2372
2372
  // src/responses/map-openai-responses-finish-reason.ts
2373
2373
  function mapOpenAIResponseFinishReason({
2374
2374
  finishReason,
2375
- hasToolCalls
2375
+ hasFunctionCall
2376
2376
  }) {
2377
2377
  switch (finishReason) {
2378
2378
  case void 0:
2379
2379
  case null:
2380
- return hasToolCalls ? "tool-calls" : "stop";
2380
+ return hasFunctionCall ? "tool-calls" : "stop";
2381
2381
  case "max_output_tokens":
2382
2382
  return "length";
2383
2383
  case "content_filter":
2384
2384
  return "content-filter";
2385
2385
  default:
2386
- return hasToolCalls ? "tool-calls" : "unknown";
2386
+ return hasFunctionCall ? "tool-calls" : "unknown";
2387
2387
  }
2388
2388
  }
2389
2389
 
@@ -2409,6 +2409,44 @@ var codeInterpreter = createProviderDefinedToolFactory3({
2409
2409
  inputSchema: z15.object({})
2410
2410
  });
2411
2411
 
2412
+ // src/tool/web-search.ts
2413
+ import { createProviderDefinedToolFactory as createProviderDefinedToolFactory4 } from "@ai-sdk/provider-utils";
2414
+ import { z as z16 } from "zod/v4";
2415
+ var webSearchArgsSchema = z16.object({
2416
+ filters: z16.object({
2417
+ allowedDomains: z16.array(z16.string()).optional()
2418
+ }).optional(),
2419
+ searchContextSize: z16.enum(["low", "medium", "high"]).optional(),
2420
+ userLocation: z16.object({
2421
+ type: z16.literal("approximate"),
2422
+ country: z16.string().optional(),
2423
+ city: z16.string().optional(),
2424
+ region: z16.string().optional(),
2425
+ timezone: z16.string().optional()
2426
+ }).optional()
2427
+ });
2428
+ var factory = createProviderDefinedToolFactory4({
2429
+ id: "openai.web_search",
2430
+ name: "web_search",
2431
+ inputSchema: z16.object({
2432
+ action: z16.discriminatedUnion("type", [
2433
+ z16.object({
2434
+ type: z16.literal("search"),
2435
+ query: z16.string().nullish()
2436
+ }),
2437
+ z16.object({
2438
+ type: z16.literal("open_page"),
2439
+ url: z16.string()
2440
+ }),
2441
+ z16.object({
2442
+ type: z16.literal("find"),
2443
+ url: z16.string(),
2444
+ pattern: z16.string()
2445
+ })
2446
+ ]).nullish()
2447
+ })
2448
+ });
2449
+
2412
2450
  // src/responses/openai-responses-prepare-tools.ts
2413
2451
  function prepareResponsesTools({
2414
2452
  tools,
@@ -2454,6 +2492,16 @@ function prepareResponsesTools({
2454
2492
  });
2455
2493
  break;
2456
2494
  }
2495
+ case "openai.web_search": {
2496
+ const args = webSearchArgsSchema.parse(tool.args);
2497
+ openaiTools.push({
2498
+ type: "web_search",
2499
+ filters: args.filters != null ? { allowed_domains: args.filters.allowedDomains } : void 0,
2500
+ search_context_size: args.searchContextSize,
2501
+ user_location: args.userLocation
2502
+ });
2503
+ break;
2504
+ }
2457
2505
  case "openai.code_interpreter": {
2458
2506
  const args = codeInterpreterArgsSchema.parse(tool.args);
2459
2507
  openaiTools.push({
@@ -2486,7 +2534,7 @@ function prepareResponsesTools({
2486
2534
  case "tool":
2487
2535
  return {
2488
2536
  tools: openaiTools,
2489
- toolChoice: toolChoice.toolName === "code_interpreter" || toolChoice.toolName === "file_search" || toolChoice.toolName === "web_search_preview" ? { type: toolChoice.toolName } : { type: "function", name: toolChoice.toolName },
2537
+ toolChoice: toolChoice.toolName === "code_interpreter" || toolChoice.toolName === "file_search" || toolChoice.toolName === "web_search_preview" || toolChoice.toolName === "web_search" ? { type: toolChoice.toolName } : { type: "function", name: toolChoice.toolName },
2490
2538
  toolWarnings
2491
2539
  };
2492
2540
  default: {
@@ -2499,35 +2547,35 @@ function prepareResponsesTools({
2499
2547
  }
2500
2548
 
2501
2549
  // src/responses/openai-responses-language-model.ts
2502
- var webSearchCallItem = z16.object({
2503
- type: z16.literal("web_search_call"),
2504
- id: z16.string(),
2505
- status: z16.string(),
2506
- action: z16.discriminatedUnion("type", [
2507
- z16.object({
2508
- type: z16.literal("search"),
2509
- query: z16.string().nullish()
2550
+ var webSearchCallItem = z17.object({
2551
+ type: z17.literal("web_search_call"),
2552
+ id: z17.string(),
2553
+ status: z17.string(),
2554
+ action: z17.discriminatedUnion("type", [
2555
+ z17.object({
2556
+ type: z17.literal("search"),
2557
+ query: z17.string().nullish()
2510
2558
  }),
2511
- z16.object({
2512
- type: z16.literal("open_page"),
2513
- url: z16.string()
2559
+ z17.object({
2560
+ type: z17.literal("open_page"),
2561
+ url: z17.string()
2514
2562
  }),
2515
- z16.object({
2516
- type: z16.literal("find"),
2517
- url: z16.string(),
2518
- pattern: z16.string()
2563
+ z17.object({
2564
+ type: z17.literal("find"),
2565
+ url: z17.string(),
2566
+ pattern: z17.string()
2519
2567
  })
2520
2568
  ]).nullish()
2521
2569
  });
2522
2570
  var TOP_LOGPROBS_MAX = 20;
2523
- var LOGPROBS_SCHEMA = z16.array(
2524
- z16.object({
2525
- token: z16.string(),
2526
- logprob: z16.number(),
2527
- top_logprobs: z16.array(
2528
- z16.object({
2529
- token: z16.string(),
2530
- logprob: z16.number()
2571
+ var LOGPROBS_SCHEMA = z17.array(
2572
+ z17.object({
2573
+ token: z17.string(),
2574
+ logprob: z17.number(),
2575
+ top_logprobs: z17.array(
2576
+ z17.object({
2577
+ token: z17.string(),
2578
+ logprob: z17.number()
2531
2579
  })
2532
2580
  )
2533
2581
  })
@@ -2731,92 +2779,92 @@ var OpenAIResponsesLanguageModel = class {
2731
2779
  body,
2732
2780
  failedResponseHandler: openaiFailedResponseHandler,
2733
2781
  successfulResponseHandler: createJsonResponseHandler6(
2734
- z16.object({
2735
- id: z16.string(),
2736
- created_at: z16.number(),
2737
- error: z16.object({
2738
- code: z16.string(),
2739
- message: z16.string()
2782
+ z17.object({
2783
+ id: z17.string(),
2784
+ created_at: z17.number(),
2785
+ error: z17.object({
2786
+ code: z17.string(),
2787
+ message: z17.string()
2740
2788
  }).nullish(),
2741
- model: z16.string(),
2742
- output: z16.array(
2743
- z16.discriminatedUnion("type", [
2744
- z16.object({
2745
- type: z16.literal("message"),
2746
- role: z16.literal("assistant"),
2747
- id: z16.string(),
2748
- content: z16.array(
2749
- z16.object({
2750
- type: z16.literal("output_text"),
2751
- text: z16.string(),
2789
+ model: z17.string(),
2790
+ output: z17.array(
2791
+ z17.discriminatedUnion("type", [
2792
+ z17.object({
2793
+ type: z17.literal("message"),
2794
+ role: z17.literal("assistant"),
2795
+ id: z17.string(),
2796
+ content: z17.array(
2797
+ z17.object({
2798
+ type: z17.literal("output_text"),
2799
+ text: z17.string(),
2752
2800
  logprobs: LOGPROBS_SCHEMA.nullish(),
2753
- annotations: z16.array(
2754
- z16.discriminatedUnion("type", [
2755
- z16.object({
2756
- type: z16.literal("url_citation"),
2757
- start_index: z16.number(),
2758
- end_index: z16.number(),
2759
- url: z16.string(),
2760
- title: z16.string()
2801
+ annotations: z17.array(
2802
+ z17.discriminatedUnion("type", [
2803
+ z17.object({
2804
+ type: z17.literal("url_citation"),
2805
+ start_index: z17.number(),
2806
+ end_index: z17.number(),
2807
+ url: z17.string(),
2808
+ title: z17.string()
2761
2809
  }),
2762
- z16.object({
2763
- type: z16.literal("file_citation"),
2764
- file_id: z16.string(),
2765
- filename: z16.string().nullish(),
2766
- index: z16.number().nullish(),
2767
- start_index: z16.number().nullish(),
2768
- end_index: z16.number().nullish(),
2769
- quote: z16.string().nullish()
2810
+ z17.object({
2811
+ type: z17.literal("file_citation"),
2812
+ file_id: z17.string(),
2813
+ filename: z17.string().nullish(),
2814
+ index: z17.number().nullish(),
2815
+ start_index: z17.number().nullish(),
2816
+ end_index: z17.number().nullish(),
2817
+ quote: z17.string().nullish()
2770
2818
  })
2771
2819
  ])
2772
2820
  )
2773
2821
  })
2774
2822
  )
2775
2823
  }),
2776
- z16.object({
2777
- type: z16.literal("function_call"),
2778
- call_id: z16.string(),
2779
- name: z16.string(),
2780
- arguments: z16.string(),
2781
- id: z16.string()
2824
+ z17.object({
2825
+ type: z17.literal("function_call"),
2826
+ call_id: z17.string(),
2827
+ name: z17.string(),
2828
+ arguments: z17.string(),
2829
+ id: z17.string()
2782
2830
  }),
2783
2831
  webSearchCallItem,
2784
- z16.object({
2785
- type: z16.literal("computer_call"),
2786
- id: z16.string(),
2787
- status: z16.string().optional()
2832
+ z17.object({
2833
+ type: z17.literal("computer_call"),
2834
+ id: z17.string(),
2835
+ status: z17.string().optional()
2788
2836
  }),
2789
- z16.object({
2790
- type: z16.literal("file_search_call"),
2791
- id: z16.string(),
2792
- status: z16.string().optional(),
2793
- queries: z16.array(z16.string()).nullish(),
2794
- results: z16.array(
2795
- z16.object({
2796
- attributes: z16.object({
2797
- file_id: z16.string(),
2798
- filename: z16.string(),
2799
- score: z16.number(),
2800
- text: z16.string()
2837
+ z17.object({
2838
+ type: z17.literal("file_search_call"),
2839
+ id: z17.string(),
2840
+ status: z17.string().optional(),
2841
+ queries: z17.array(z17.string()).nullish(),
2842
+ results: z17.array(
2843
+ z17.object({
2844
+ attributes: z17.object({
2845
+ file_id: z17.string(),
2846
+ filename: z17.string(),
2847
+ score: z17.number(),
2848
+ text: z17.string()
2801
2849
  })
2802
2850
  })
2803
2851
  ).nullish()
2804
2852
  }),
2805
- z16.object({
2806
- type: z16.literal("reasoning"),
2807
- id: z16.string(),
2808
- encrypted_content: z16.string().nullish(),
2809
- summary: z16.array(
2810
- z16.object({
2811
- type: z16.literal("summary_text"),
2812
- text: z16.string()
2853
+ z17.object({
2854
+ type: z17.literal("reasoning"),
2855
+ id: z17.string(),
2856
+ encrypted_content: z17.string().nullish(),
2857
+ summary: z17.array(
2858
+ z17.object({
2859
+ type: z17.literal("summary_text"),
2860
+ text: z17.string()
2813
2861
  })
2814
2862
  )
2815
2863
  })
2816
2864
  ])
2817
2865
  ),
2818
- service_tier: z16.string().nullish(),
2819
- incomplete_details: z16.object({ reason: z16.string() }).nullable(),
2866
+ service_tier: z17.string().nullish(),
2867
+ incomplete_details: z17.object({ reason: z17.string() }).nullable(),
2820
2868
  usage: usageSchema2
2821
2869
  })
2822
2870
  ),
@@ -2836,6 +2884,7 @@ var OpenAIResponsesLanguageModel = class {
2836
2884
  }
2837
2885
  const content = [];
2838
2886
  const logprobs = [];
2887
+ let hasFunctionCall = false;
2839
2888
  for (const part of response.output) {
2840
2889
  switch (part.type) {
2841
2890
  case "reasoning": {
@@ -2894,6 +2943,7 @@ var OpenAIResponsesLanguageModel = class {
2894
2943
  break;
2895
2944
  }
2896
2945
  case "function_call": {
2946
+ hasFunctionCall = true;
2897
2947
  content.push({
2898
2948
  type: "tool-call",
2899
2949
  toolCallId: part.call_id,
@@ -2981,7 +3031,7 @@ var OpenAIResponsesLanguageModel = class {
2981
3031
  content,
2982
3032
  finishReason: mapOpenAIResponseFinishReason({
2983
3033
  finishReason: (_m = response.incomplete_details) == null ? void 0 : _m.reason,
2984
- hasToolCalls: content.some((part) => part.type === "tool-call")
3034
+ hasFunctionCall
2985
3035
  }),
2986
3036
  usage: {
2987
3037
  inputTokens: response.usage.input_tokens,
@@ -3031,7 +3081,7 @@ var OpenAIResponsesLanguageModel = class {
3031
3081
  const logprobs = [];
3032
3082
  let responseId = null;
3033
3083
  const ongoingToolCalls = {};
3034
- let hasToolCalls = false;
3084
+ let hasFunctionCall = false;
3035
3085
  const activeReasoning = {};
3036
3086
  let serviceTier;
3037
3087
  return {
@@ -3121,7 +3171,7 @@ var OpenAIResponsesLanguageModel = class {
3121
3171
  } else if (isResponseOutputItemDoneChunk(value)) {
3122
3172
  if (value.item.type === "function_call") {
3123
3173
  ongoingToolCalls[value.output_index] = void 0;
3124
- hasToolCalls = true;
3174
+ hasFunctionCall = true;
3125
3175
  controller.enqueue({
3126
3176
  type: "tool-input-end",
3127
3177
  id: value.item.call_id
@@ -3139,7 +3189,6 @@ var OpenAIResponsesLanguageModel = class {
3139
3189
  });
3140
3190
  } else if (value.item.type === "web_search_call") {
3141
3191
  ongoingToolCalls[value.output_index] = void 0;
3142
- hasToolCalls = true;
3143
3192
  controller.enqueue({
3144
3193
  type: "tool-input-end",
3145
3194
  id: value.item.id
@@ -3147,20 +3196,19 @@ var OpenAIResponsesLanguageModel = class {
3147
3196
  controller.enqueue({
3148
3197
  type: "tool-call",
3149
3198
  toolCallId: value.item.id,
3150
- toolName: "web_search_preview",
3199
+ toolName: "web_search",
3151
3200
  input: JSON.stringify({ action: value.item.action }),
3152
3201
  providerExecuted: true
3153
3202
  });
3154
3203
  controller.enqueue({
3155
3204
  type: "tool-result",
3156
3205
  toolCallId: value.item.id,
3157
- toolName: "web_search_preview",
3206
+ toolName: "web_search",
3158
3207
  result: { status: value.item.status },
3159
3208
  providerExecuted: true
3160
3209
  });
3161
3210
  } else if (value.item.type === "computer_call") {
3162
3211
  ongoingToolCalls[value.output_index] = void 0;
3163
- hasToolCalls = true;
3164
3212
  controller.enqueue({
3165
3213
  type: "tool-input-end",
3166
3214
  id: value.item.id
@@ -3184,7 +3232,6 @@ var OpenAIResponsesLanguageModel = class {
3184
3232
  });
3185
3233
  } else if (value.item.type === "file_search_call") {
3186
3234
  ongoingToolCalls[value.output_index] = void 0;
3187
- hasToolCalls = true;
3188
3235
  controller.enqueue({
3189
3236
  type: "tool-input-end",
3190
3237
  id: value.item.id
@@ -3285,7 +3332,7 @@ var OpenAIResponsesLanguageModel = class {
3285
3332
  } else if (isResponseFinishedChunk(value)) {
3286
3333
  finishReason = mapOpenAIResponseFinishReason({
3287
3334
  finishReason: (_h = value.response.incomplete_details) == null ? void 0 : _h.reason,
3288
- hasToolCalls
3335
+ hasFunctionCall
3289
3336
  });
3290
3337
  usage.inputTokens = value.response.usage.input_tokens;
3291
3338
  usage.outputTokens = value.response.usage.output_tokens;
@@ -3344,176 +3391,176 @@ var OpenAIResponsesLanguageModel = class {
3344
3391
  };
3345
3392
  }
3346
3393
  };
3347
- var usageSchema2 = z16.object({
3348
- input_tokens: z16.number(),
3349
- input_tokens_details: z16.object({ cached_tokens: z16.number().nullish() }).nullish(),
3350
- output_tokens: z16.number(),
3351
- output_tokens_details: z16.object({ reasoning_tokens: z16.number().nullish() }).nullish()
3394
+ var usageSchema2 = z17.object({
3395
+ input_tokens: z17.number(),
3396
+ input_tokens_details: z17.object({ cached_tokens: z17.number().nullish() }).nullish(),
3397
+ output_tokens: z17.number(),
3398
+ output_tokens_details: z17.object({ reasoning_tokens: z17.number().nullish() }).nullish()
3352
3399
  });
3353
- var textDeltaChunkSchema = z16.object({
3354
- type: z16.literal("response.output_text.delta"),
3355
- item_id: z16.string(),
3356
- delta: z16.string(),
3400
+ var textDeltaChunkSchema = z17.object({
3401
+ type: z17.literal("response.output_text.delta"),
3402
+ item_id: z17.string(),
3403
+ delta: z17.string(),
3357
3404
  logprobs: LOGPROBS_SCHEMA.nullish()
3358
3405
  });
3359
- var errorChunkSchema = z16.object({
3360
- type: z16.literal("error"),
3361
- code: z16.string(),
3362
- message: z16.string(),
3363
- param: z16.string().nullish(),
3364
- sequence_number: z16.number()
3406
+ var errorChunkSchema = z17.object({
3407
+ type: z17.literal("error"),
3408
+ code: z17.string(),
3409
+ message: z17.string(),
3410
+ param: z17.string().nullish(),
3411
+ sequence_number: z17.number()
3365
3412
  });
3366
- var responseFinishedChunkSchema = z16.object({
3367
- type: z16.enum(["response.completed", "response.incomplete"]),
3368
- response: z16.object({
3369
- incomplete_details: z16.object({ reason: z16.string() }).nullish(),
3413
+ var responseFinishedChunkSchema = z17.object({
3414
+ type: z17.enum(["response.completed", "response.incomplete"]),
3415
+ response: z17.object({
3416
+ incomplete_details: z17.object({ reason: z17.string() }).nullish(),
3370
3417
  usage: usageSchema2,
3371
- service_tier: z16.string().nullish()
3418
+ service_tier: z17.string().nullish()
3372
3419
  })
3373
3420
  });
3374
- var responseCreatedChunkSchema = z16.object({
3375
- type: z16.literal("response.created"),
3376
- response: z16.object({
3377
- id: z16.string(),
3378
- created_at: z16.number(),
3379
- model: z16.string(),
3380
- service_tier: z16.string().nullish()
3421
+ var responseCreatedChunkSchema = z17.object({
3422
+ type: z17.literal("response.created"),
3423
+ response: z17.object({
3424
+ id: z17.string(),
3425
+ created_at: z17.number(),
3426
+ model: z17.string(),
3427
+ service_tier: z17.string().nullish()
3381
3428
  })
3382
3429
  });
3383
- var responseOutputItemAddedSchema = z16.object({
3384
- type: z16.literal("response.output_item.added"),
3385
- output_index: z16.number(),
3386
- item: z16.discriminatedUnion("type", [
3387
- z16.object({
3388
- type: z16.literal("message"),
3389
- id: z16.string()
3430
+ var responseOutputItemAddedSchema = z17.object({
3431
+ type: z17.literal("response.output_item.added"),
3432
+ output_index: z17.number(),
3433
+ item: z17.discriminatedUnion("type", [
3434
+ z17.object({
3435
+ type: z17.literal("message"),
3436
+ id: z17.string()
3390
3437
  }),
3391
- z16.object({
3392
- type: z16.literal("reasoning"),
3393
- id: z16.string(),
3394
- encrypted_content: z16.string().nullish()
3438
+ z17.object({
3439
+ type: z17.literal("reasoning"),
3440
+ id: z17.string(),
3441
+ encrypted_content: z17.string().nullish()
3395
3442
  }),
3396
- z16.object({
3397
- type: z16.literal("function_call"),
3398
- id: z16.string(),
3399
- call_id: z16.string(),
3400
- name: z16.string(),
3401
- arguments: z16.string()
3443
+ z17.object({
3444
+ type: z17.literal("function_call"),
3445
+ id: z17.string(),
3446
+ call_id: z17.string(),
3447
+ name: z17.string(),
3448
+ arguments: z17.string()
3402
3449
  }),
3403
- z16.object({
3404
- type: z16.literal("web_search_call"),
3405
- id: z16.string(),
3406
- status: z16.string(),
3407
- action: z16.object({
3408
- type: z16.literal("search"),
3409
- query: z16.string().optional()
3450
+ z17.object({
3451
+ type: z17.literal("web_search_call"),
3452
+ id: z17.string(),
3453
+ status: z17.string(),
3454
+ action: z17.object({
3455
+ type: z17.literal("search"),
3456
+ query: z17.string().optional()
3410
3457
  }).nullish()
3411
3458
  }),
3412
- z16.object({
3413
- type: z16.literal("computer_call"),
3414
- id: z16.string(),
3415
- status: z16.string()
3459
+ z17.object({
3460
+ type: z17.literal("computer_call"),
3461
+ id: z17.string(),
3462
+ status: z17.string()
3416
3463
  }),
3417
- z16.object({
3418
- type: z16.literal("file_search_call"),
3419
- id: z16.string(),
3420
- status: z16.string(),
3421
- queries: z16.array(z16.string()).nullish(),
3422
- results: z16.array(
3423
- z16.object({
3424
- attributes: z16.object({
3425
- file_id: z16.string(),
3426
- filename: z16.string(),
3427
- score: z16.number(),
3428
- text: z16.string()
3464
+ z17.object({
3465
+ type: z17.literal("file_search_call"),
3466
+ id: z17.string(),
3467
+ status: z17.string(),
3468
+ queries: z17.array(z17.string()).nullish(),
3469
+ results: z17.array(
3470
+ z17.object({
3471
+ attributes: z17.object({
3472
+ file_id: z17.string(),
3473
+ filename: z17.string(),
3474
+ score: z17.number(),
3475
+ text: z17.string()
3429
3476
  })
3430
3477
  })
3431
3478
  ).optional()
3432
3479
  })
3433
3480
  ])
3434
3481
  });
3435
- var responseOutputItemDoneSchema = z16.object({
3436
- type: z16.literal("response.output_item.done"),
3437
- output_index: z16.number(),
3438
- item: z16.discriminatedUnion("type", [
3439
- z16.object({
3440
- type: z16.literal("message"),
3441
- id: z16.string()
3482
+ var responseOutputItemDoneSchema = z17.object({
3483
+ type: z17.literal("response.output_item.done"),
3484
+ output_index: z17.number(),
3485
+ item: z17.discriminatedUnion("type", [
3486
+ z17.object({
3487
+ type: z17.literal("message"),
3488
+ id: z17.string()
3442
3489
  }),
3443
- z16.object({
3444
- type: z16.literal("reasoning"),
3445
- id: z16.string(),
3446
- encrypted_content: z16.string().nullish()
3490
+ z17.object({
3491
+ type: z17.literal("reasoning"),
3492
+ id: z17.string(),
3493
+ encrypted_content: z17.string().nullish()
3447
3494
  }),
3448
- z16.object({
3449
- type: z16.literal("function_call"),
3450
- id: z16.string(),
3451
- call_id: z16.string(),
3452
- name: z16.string(),
3453
- arguments: z16.string(),
3454
- status: z16.literal("completed")
3495
+ z17.object({
3496
+ type: z17.literal("function_call"),
3497
+ id: z17.string(),
3498
+ call_id: z17.string(),
3499
+ name: z17.string(),
3500
+ arguments: z17.string(),
3501
+ status: z17.literal("completed")
3455
3502
  }),
3456
3503
  webSearchCallItem,
3457
- z16.object({
3458
- type: z16.literal("computer_call"),
3459
- id: z16.string(),
3460
- status: z16.literal("completed")
3504
+ z17.object({
3505
+ type: z17.literal("computer_call"),
3506
+ id: z17.string(),
3507
+ status: z17.literal("completed")
3461
3508
  }),
3462
- z16.object({
3463
- type: z16.literal("file_search_call"),
3464
- id: z16.string(),
3465
- status: z16.literal("completed"),
3466
- queries: z16.array(z16.string()).nullish(),
3467
- results: z16.array(
3468
- z16.object({
3469
- attributes: z16.object({
3470
- file_id: z16.string(),
3471
- filename: z16.string(),
3472
- score: z16.number(),
3473
- text: z16.string()
3509
+ z17.object({
3510
+ type: z17.literal("file_search_call"),
3511
+ id: z17.string(),
3512
+ status: z17.literal("completed"),
3513
+ queries: z17.array(z17.string()).nullish(),
3514
+ results: z17.array(
3515
+ z17.object({
3516
+ attributes: z17.object({
3517
+ file_id: z17.string(),
3518
+ filename: z17.string(),
3519
+ score: z17.number(),
3520
+ text: z17.string()
3474
3521
  })
3475
3522
  })
3476
3523
  ).nullish()
3477
3524
  })
3478
3525
  ])
3479
3526
  });
3480
- var responseFunctionCallArgumentsDeltaSchema = z16.object({
3481
- type: z16.literal("response.function_call_arguments.delta"),
3482
- item_id: z16.string(),
3483
- output_index: z16.number(),
3484
- delta: z16.string()
3527
+ var responseFunctionCallArgumentsDeltaSchema = z17.object({
3528
+ type: z17.literal("response.function_call_arguments.delta"),
3529
+ item_id: z17.string(),
3530
+ output_index: z17.number(),
3531
+ delta: z17.string()
3485
3532
  });
3486
- var responseAnnotationAddedSchema = z16.object({
3487
- type: z16.literal("response.output_text.annotation.added"),
3488
- annotation: z16.discriminatedUnion("type", [
3489
- z16.object({
3490
- type: z16.literal("url_citation"),
3491
- url: z16.string(),
3492
- title: z16.string()
3533
+ var responseAnnotationAddedSchema = z17.object({
3534
+ type: z17.literal("response.output_text.annotation.added"),
3535
+ annotation: z17.discriminatedUnion("type", [
3536
+ z17.object({
3537
+ type: z17.literal("url_citation"),
3538
+ url: z17.string(),
3539
+ title: z17.string()
3493
3540
  }),
3494
- z16.object({
3495
- type: z16.literal("file_citation"),
3496
- file_id: z16.string(),
3497
- filename: z16.string().nullish(),
3498
- index: z16.number().nullish(),
3499
- start_index: z16.number().nullish(),
3500
- end_index: z16.number().nullish(),
3501
- quote: z16.string().nullish()
3541
+ z17.object({
3542
+ type: z17.literal("file_citation"),
3543
+ file_id: z17.string(),
3544
+ filename: z17.string().nullish(),
3545
+ index: z17.number().nullish(),
3546
+ start_index: z17.number().nullish(),
3547
+ end_index: z17.number().nullish(),
3548
+ quote: z17.string().nullish()
3502
3549
  })
3503
3550
  ])
3504
3551
  });
3505
- var responseReasoningSummaryPartAddedSchema = z16.object({
3506
- type: z16.literal("response.reasoning_summary_part.added"),
3507
- item_id: z16.string(),
3508
- summary_index: z16.number()
3552
+ var responseReasoningSummaryPartAddedSchema = z17.object({
3553
+ type: z17.literal("response.reasoning_summary_part.added"),
3554
+ item_id: z17.string(),
3555
+ summary_index: z17.number()
3509
3556
  });
3510
- var responseReasoningSummaryTextDeltaSchema = z16.object({
3511
- type: z16.literal("response.reasoning_summary_text.delta"),
3512
- item_id: z16.string(),
3513
- summary_index: z16.number(),
3514
- delta: z16.string()
3557
+ var responseReasoningSummaryTextDeltaSchema = z17.object({
3558
+ type: z17.literal("response.reasoning_summary_text.delta"),
3559
+ item_id: z17.string(),
3560
+ summary_index: z17.number(),
3561
+ delta: z17.string()
3515
3562
  });
3516
- var openaiResponsesChunkSchema = z16.union([
3563
+ var openaiResponsesChunkSchema = z17.union([
3517
3564
  textDeltaChunkSchema,
3518
3565
  responseFinishedChunkSchema,
3519
3566
  responseCreatedChunkSchema,
@@ -3524,7 +3571,7 @@ var openaiResponsesChunkSchema = z16.union([
3524
3571
  responseReasoningSummaryPartAddedSchema,
3525
3572
  responseReasoningSummaryTextDeltaSchema,
3526
3573
  errorChunkSchema,
3527
- z16.object({ type: z16.string() }).loose()
3574
+ z17.object({ type: z17.string() }).loose()
3528
3575
  // fallback for unknown chunks
3529
3576
  ]);
3530
3577
  function isTextDeltaChunk(chunk) {
@@ -3597,27 +3644,27 @@ function getResponsesModelConfig(modelId) {
3597
3644
  isReasoningModel: false
3598
3645
  };
3599
3646
  }
3600
- var openaiResponsesProviderOptionsSchema = z16.object({
3601
- metadata: z16.any().nullish(),
3602
- parallelToolCalls: z16.boolean().nullish(),
3603
- previousResponseId: z16.string().nullish(),
3604
- store: z16.boolean().nullish(),
3605
- user: z16.string().nullish(),
3606
- reasoningEffort: z16.string().nullish(),
3607
- strictJsonSchema: z16.boolean().nullish(),
3608
- instructions: z16.string().nullish(),
3609
- reasoningSummary: z16.string().nullish(),
3610
- serviceTier: z16.enum(["auto", "flex", "priority"]).nullish(),
3611
- include: z16.array(
3612
- z16.enum([
3647
+ var openaiResponsesProviderOptionsSchema = z17.object({
3648
+ metadata: z17.any().nullish(),
3649
+ parallelToolCalls: z17.boolean().nullish(),
3650
+ previousResponseId: z17.string().nullish(),
3651
+ store: z17.boolean().nullish(),
3652
+ user: z17.string().nullish(),
3653
+ reasoningEffort: z17.string().nullish(),
3654
+ strictJsonSchema: z17.boolean().nullish(),
3655
+ instructions: z17.string().nullish(),
3656
+ reasoningSummary: z17.string().nullish(),
3657
+ serviceTier: z17.enum(["auto", "flex", "priority"]).nullish(),
3658
+ include: z17.array(
3659
+ z17.enum([
3613
3660
  "reasoning.encrypted_content",
3614
3661
  "file_search_call.results",
3615
3662
  "message.output_text.logprobs"
3616
3663
  ])
3617
3664
  ).nullish(),
3618
- textVerbosity: z16.enum(["low", "medium", "high"]).nullish(),
3619
- promptCacheKey: z16.string().nullish(),
3620
- safetyIdentifier: z16.string().nullish(),
3665
+ textVerbosity: z17.enum(["low", "medium", "high"]).nullish(),
3666
+ promptCacheKey: z17.string().nullish(),
3667
+ safetyIdentifier: z17.string().nullish(),
3621
3668
  /**
3622
3669
  * Return the log probabilities of the tokens.
3623
3670
  *
@@ -3630,7 +3677,7 @@ var openaiResponsesProviderOptionsSchema = z16.object({
3630
3677
  * @see https://platform.openai.com/docs/api-reference/responses/create
3631
3678
  * @see https://cookbook.openai.com/examples/using_logprobs
3632
3679
  */
3633
- logprobs: z16.union([z16.boolean(), z16.number().min(1).max(TOP_LOGPROBS_MAX)]).optional()
3680
+ logprobs: z17.union([z17.boolean(), z17.number().min(1).max(TOP_LOGPROBS_MAX)]).optional()
3634
3681
  });
3635
3682
  export {
3636
3683
  OpenAIChatLanguageModel,