@ai-sdk/openai 3.0.133 → 3.0.134

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.
@@ -226,19 +226,207 @@ declare class OpenAISpeechModel implements SpeechModelV3 {
226
226
  doGenerate(options: Parameters<SpeechModelV3['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV3['doGenerate']>>>;
227
227
  }
228
228
 
229
- type OpenAIResponsesModelId = 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.2-codex' | 'gpt-5.3-chat-latest' | 'gpt-5.3-codex' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | 'gpt-5.5' | 'gpt-5.5-2026-04-23' | 'gpt-5.6' | 'gpt-5.6-luna' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | 'gpt-6-astra' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'gpt-6-sol' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | 'o4-mini' | 'o4-mini-2025-04-16' | (string & {});
230
-
231
- declare class OpenAIResponsesLanguageModel implements LanguageModelV3 {
232
- readonly specificationVersion = "v3";
233
- readonly modelId: OpenAIResponsesModelId;
234
- private readonly config;
235
- constructor(modelId: OpenAIResponsesModelId, config: OpenAIConfig);
236
- readonly supportedUrls: Record<string, RegExp[]>;
237
- get provider(): string;
238
- private getArgs;
239
- doGenerate(options: LanguageModelV3CallOptions): Promise<LanguageModelV3GenerateResult>;
240
- doStream(options: LanguageModelV3CallOptions): Promise<LanguageModelV3StreamResult>;
241
- }
229
+ declare const webSearchArgsSchema: _ai_sdk_provider_utils.LazySchema<{
230
+ externalWebAccess?: boolean | undefined;
231
+ filters?: {
232
+ allowedDomains?: string[] | undefined;
233
+ blockedDomains?: string[] | undefined;
234
+ } | undefined;
235
+ searchContextSize?: "low" | "medium" | "high" | undefined;
236
+ userLocation?: {
237
+ type: "approximate";
238
+ country?: string | undefined;
239
+ city?: string | undefined;
240
+ region?: string | undefined;
241
+ timezone?: string | undefined;
242
+ } | undefined;
243
+ }>;
244
+ declare const webSearchOutputSchema: _ai_sdk_provider_utils.LazySchema<{
245
+ action?: {
246
+ type: "search";
247
+ query?: string | undefined;
248
+ queries?: string[] | undefined;
249
+ } | {
250
+ type: "openPage";
251
+ url?: string | null | undefined;
252
+ } | {
253
+ type: "findInPage";
254
+ url?: string | null | undefined;
255
+ pattern?: string | null | undefined;
256
+ } | undefined;
257
+ sources?: ({
258
+ type: "url";
259
+ url: string;
260
+ } | {
261
+ type: "api";
262
+ name: string;
263
+ })[] | undefined;
264
+ }>;
265
+ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
266
+ /**
267
+ * An object describing the specific action taken in this web search call.
268
+ * Includes details on how the model used the web (search, open_page, find_in_page).
269
+ */
270
+ action?: {
271
+ /**
272
+ * Action type "search" - Performs a web search query.
273
+ */
274
+ type: "search";
275
+ /**
276
+ * The search query.
277
+ *
278
+ * @deprecated Use `queries` instead.
279
+ */
280
+ query?: string;
281
+ /**
282
+ * The search queries the model used.
283
+ */
284
+ queries?: string[];
285
+ } | {
286
+ /**
287
+ * Action type "openPage" - Opens a specific URL from search results.
288
+ */
289
+ type: "openPage";
290
+ /**
291
+ * The URL opened by the model.
292
+ */
293
+ url?: string | null;
294
+ } | {
295
+ /**
296
+ * Action type "findInPage": Searches for a pattern within a loaded page.
297
+ */
298
+ type: "findInPage";
299
+ /**
300
+ * The URL of the page searched for the pattern.
301
+ */
302
+ url?: string | null;
303
+ /**
304
+ * The pattern or text to search for within the page.
305
+ */
306
+ pattern?: string | null;
307
+ };
308
+ /**
309
+ * Optional sources cited by the model for the web search call.
310
+ */
311
+ sources?: Array<{
312
+ type: "url";
313
+ url: string;
314
+ } | {
315
+ type: "api";
316
+ name: string;
317
+ }>;
318
+ }, {
319
+ /**
320
+ * Whether to use external web access for fetching live content.
321
+ * - true: Fetch live web content (default)
322
+ * - false: Use cached/indexed results
323
+ */
324
+ externalWebAccess?: boolean;
325
+ /**
326
+ * Filters for the search.
327
+ */
328
+ filters?: {
329
+ /**
330
+ * Allowed domains for the search.
331
+ * If not provided, all domains are allowed.
332
+ * Subdomains of the provided domains are allowed as well.
333
+ * Omit the HTTP or HTTPS prefix. Maximum 100 domains.
334
+ */
335
+ allowedDomains?: string[];
336
+ /**
337
+ * Blocked domains for the search.
338
+ * Subdomains of the provided domains are blocked as well.
339
+ * Omit the HTTP or HTTPS prefix. Maximum 100 domains.
340
+ */
341
+ blockedDomains?: string[];
342
+ };
343
+ /**
344
+ * Search context size to use for the web search.
345
+ * - high: Most comprehensive context, highest cost, slower response
346
+ * - medium: Balanced context, cost, and latency (default)
347
+ * - low: Least context, lowest cost, fastest response
348
+ */
349
+ searchContextSize?: "low" | "medium" | "high";
350
+ /**
351
+ * User location information to provide geographically relevant search results.
352
+ */
353
+ userLocation?: {
354
+ /**
355
+ * Type of location (always 'approximate')
356
+ */
357
+ type: "approximate";
358
+ /**
359
+ * Two-letter ISO country code (e.g., 'US', 'GB')
360
+ */
361
+ country?: string;
362
+ /**
363
+ * City name (free text, e.g., 'Minneapolis')
364
+ */
365
+ city?: string;
366
+ /**
367
+ * Region name (free text, e.g., 'Minnesota')
368
+ */
369
+ region?: string;
370
+ /**
371
+ * IANA timezone (e.g., 'America/Chicago')
372
+ */
373
+ timezone?: string;
374
+ };
375
+ }>;
376
+ declare const webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, {
377
+ /**
378
+ * An object describing the specific action taken in this web search call.
379
+ * Includes details on how the model used the web (search, open_page, find_in_page).
380
+ */
381
+ action?: {
382
+ /**
383
+ * Action type "search" - Performs a web search query.
384
+ */
385
+ type: "search";
386
+ /**
387
+ * The search query.
388
+ *
389
+ * @deprecated Use `queries` instead.
390
+ */
391
+ query?: string;
392
+ /**
393
+ * The search queries the model used.
394
+ */
395
+ queries?: string[];
396
+ } | {
397
+ /**
398
+ * Action type "openPage" - Opens a specific URL from search results.
399
+ */
400
+ type: "openPage";
401
+ /**
402
+ * The URL opened by the model.
403
+ */
404
+ url?: string | null;
405
+ } | {
406
+ /**
407
+ * Action type "findInPage": Searches for a pattern within a loaded page.
408
+ */
409
+ type: "findInPage";
410
+ /**
411
+ * The URL of the page searched for the pattern.
412
+ */
413
+ url?: string | null;
414
+ /**
415
+ * The pattern or text to search for within the page.
416
+ */
417
+ pattern?: string | null;
418
+ };
419
+ /**
420
+ * Optional sources cited by the model for the web search call.
421
+ */
422
+ sources?: Array<{
423
+ type: "url";
424
+ url: string;
425
+ } | {
426
+ type: "api";
427
+ name: string;
428
+ }>;
429
+ }>;
242
430
 
243
431
  /**
244
432
  * A filter used to compare a specified attribute key to a given value using a defined comparison operation.
@@ -775,6 +963,36 @@ type OpenAIResponsesChunk = InferSchema<typeof openaiResponsesChunkSchema>;
775
963
  type OpenAIResponsesLogprobs = NonNullable<(OpenAIResponsesChunk & {
776
964
  type: 'response.output_text.delta';
777
965
  })['logprobs']> | null;
966
+ type OpenAIResponsesWebSearchAction = NonNullable<((OpenAIResponsesChunk & {
967
+ type: 'response.output_item.done';
968
+ })['item'] & {
969
+ type: 'web_search_call';
970
+ })['action']>;
971
+
972
+ type OpenAIResponsesModelId = 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.2-codex' | 'gpt-5.3-chat-latest' | 'gpt-5.3-codex' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | 'gpt-5.5' | 'gpt-5.5-2026-04-23' | 'gpt-5.6' | 'gpt-5.6-luna' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | 'gpt-6-astra' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'gpt-6-sol' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | 'o4-mini' | 'o4-mini-2025-04-16' | (string & {});
973
+
974
+ declare class OpenAIResponsesLanguageModel implements LanguageModelV3 {
975
+ readonly specificationVersion = "v3";
976
+ readonly modelId: OpenAIResponsesModelId;
977
+ private readonly config;
978
+ constructor(modelId: OpenAIResponsesModelId, config: OpenAIConfig);
979
+ readonly supportedUrls: Record<string, RegExp[]>;
980
+ get provider(): string;
981
+ private getArgs;
982
+ doGenerate(options: LanguageModelV3CallOptions): Promise<LanguageModelV3GenerateResult>;
983
+ doStream(options: LanguageModelV3CallOptions): Promise<LanguageModelV3StreamResult>;
984
+ }
985
+ declare function mapWebSearchResult({ action, status, }: {
986
+ action?: OpenAIResponsesWebSearchAction | null;
987
+ status: string;
988
+ }): {
989
+ isError: true;
990
+ result: {
991
+ status: string;
992
+ };
993
+ } | {
994
+ result: InferSchema<typeof webSearchOutputSchema>;
995
+ };
778
996
 
779
997
  type OpenaiResponsesChunk = InferSchema<typeof openaiResponsesChunkSchema>;
780
998
  type ResponsesOutputTextAnnotationProviderMetadata = Extract<OpenaiResponsesChunk, {
@@ -1291,208 +1509,6 @@ declare const toolSearch: (args?: Parameters<typeof toolSearchToolFactory>[0]) =
1291
1509
  tools: Array<JSONObject>;
1292
1510
  }>;
1293
1511
 
1294
- declare const webSearchArgsSchema: _ai_sdk_provider_utils.LazySchema<{
1295
- externalWebAccess?: boolean | undefined;
1296
- filters?: {
1297
- allowedDomains?: string[] | undefined;
1298
- blockedDomains?: string[] | undefined;
1299
- } | undefined;
1300
- searchContextSize?: "low" | "medium" | "high" | undefined;
1301
- userLocation?: {
1302
- type: "approximate";
1303
- country?: string | undefined;
1304
- city?: string | undefined;
1305
- region?: string | undefined;
1306
- timezone?: string | undefined;
1307
- } | undefined;
1308
- }>;
1309
- declare const webSearchOutputSchema: _ai_sdk_provider_utils.LazySchema<{
1310
- action?: {
1311
- type: "search";
1312
- query?: string | undefined;
1313
- queries?: string[] | undefined;
1314
- } | {
1315
- type: "openPage";
1316
- url?: string | null | undefined;
1317
- } | {
1318
- type: "findInPage";
1319
- url?: string | null | undefined;
1320
- pattern?: string | null | undefined;
1321
- } | undefined;
1322
- sources?: ({
1323
- type: "url";
1324
- url: string;
1325
- } | {
1326
- type: "api";
1327
- name: string;
1328
- })[] | undefined;
1329
- }>;
1330
- declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
1331
- /**
1332
- * An object describing the specific action taken in this web search call.
1333
- * Includes details on how the model used the web (search, open_page, find_in_page).
1334
- */
1335
- action?: {
1336
- /**
1337
- * Action type "search" - Performs a web search query.
1338
- */
1339
- type: "search";
1340
- /**
1341
- * The search query.
1342
- *
1343
- * @deprecated Use `queries` instead.
1344
- */
1345
- query?: string;
1346
- /**
1347
- * The search queries the model used.
1348
- */
1349
- queries?: string[];
1350
- } | {
1351
- /**
1352
- * Action type "openPage" - Opens a specific URL from search results.
1353
- */
1354
- type: "openPage";
1355
- /**
1356
- * The URL opened by the model.
1357
- */
1358
- url?: string | null;
1359
- } | {
1360
- /**
1361
- * Action type "findInPage": Searches for a pattern within a loaded page.
1362
- */
1363
- type: "findInPage";
1364
- /**
1365
- * The URL of the page searched for the pattern.
1366
- */
1367
- url?: string | null;
1368
- /**
1369
- * The pattern or text to search for within the page.
1370
- */
1371
- pattern?: string | null;
1372
- };
1373
- /**
1374
- * Optional sources cited by the model for the web search call.
1375
- */
1376
- sources?: Array<{
1377
- type: "url";
1378
- url: string;
1379
- } | {
1380
- type: "api";
1381
- name: string;
1382
- }>;
1383
- }, {
1384
- /**
1385
- * Whether to use external web access for fetching live content.
1386
- * - true: Fetch live web content (default)
1387
- * - false: Use cached/indexed results
1388
- */
1389
- externalWebAccess?: boolean;
1390
- /**
1391
- * Filters for the search.
1392
- */
1393
- filters?: {
1394
- /**
1395
- * Allowed domains for the search.
1396
- * If not provided, all domains are allowed.
1397
- * Subdomains of the provided domains are allowed as well.
1398
- * Omit the HTTP or HTTPS prefix. Maximum 100 domains.
1399
- */
1400
- allowedDomains?: string[];
1401
- /**
1402
- * Blocked domains for the search.
1403
- * Subdomains of the provided domains are blocked as well.
1404
- * Omit the HTTP or HTTPS prefix. Maximum 100 domains.
1405
- */
1406
- blockedDomains?: string[];
1407
- };
1408
- /**
1409
- * Search context size to use for the web search.
1410
- * - high: Most comprehensive context, highest cost, slower response
1411
- * - medium: Balanced context, cost, and latency (default)
1412
- * - low: Least context, lowest cost, fastest response
1413
- */
1414
- searchContextSize?: "low" | "medium" | "high";
1415
- /**
1416
- * User location information to provide geographically relevant search results.
1417
- */
1418
- userLocation?: {
1419
- /**
1420
- * Type of location (always 'approximate')
1421
- */
1422
- type: "approximate";
1423
- /**
1424
- * Two-letter ISO country code (e.g., 'US', 'GB')
1425
- */
1426
- country?: string;
1427
- /**
1428
- * City name (free text, e.g., 'Minneapolis')
1429
- */
1430
- city?: string;
1431
- /**
1432
- * Region name (free text, e.g., 'Minnesota')
1433
- */
1434
- region?: string;
1435
- /**
1436
- * IANA timezone (e.g., 'America/Chicago')
1437
- */
1438
- timezone?: string;
1439
- };
1440
- }>;
1441
- declare const webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, {
1442
- /**
1443
- * An object describing the specific action taken in this web search call.
1444
- * Includes details on how the model used the web (search, open_page, find_in_page).
1445
- */
1446
- action?: {
1447
- /**
1448
- * Action type "search" - Performs a web search query.
1449
- */
1450
- type: "search";
1451
- /**
1452
- * The search query.
1453
- *
1454
- * @deprecated Use `queries` instead.
1455
- */
1456
- query?: string;
1457
- /**
1458
- * The search queries the model used.
1459
- */
1460
- queries?: string[];
1461
- } | {
1462
- /**
1463
- * Action type "openPage" - Opens a specific URL from search results.
1464
- */
1465
- type: "openPage";
1466
- /**
1467
- * The URL opened by the model.
1468
- */
1469
- url?: string | null;
1470
- } | {
1471
- /**
1472
- * Action type "findInPage": Searches for a pattern within a loaded page.
1473
- */
1474
- type: "findInPage";
1475
- /**
1476
- * The URL of the page searched for the pattern.
1477
- */
1478
- url?: string | null;
1479
- /**
1480
- * The pattern or text to search for within the page.
1481
- */
1482
- pattern?: string | null;
1483
- };
1484
- /**
1485
- * Optional sources cited by the model for the web search call.
1486
- */
1487
- sources?: Array<{
1488
- type: "url";
1489
- url: string;
1490
- } | {
1491
- type: "api";
1492
- name: string;
1493
- }>;
1494
- }>;
1495
-
1496
1512
  declare const webSearchPreviewArgsSchema: _ai_sdk_provider_utils.LazySchema<{
1497
1513
  searchContextSize?: "low" | "medium" | "high" | undefined;
1498
1514
  userLocation?: {
@@ -1576,4 +1592,4 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOu
1576
1592
  };
1577
1593
  }>;
1578
1594
 
1579
- export { type ApplyPatchOperation, OpenAIChatLanguageModel, type OpenAIChatModelId, OpenAICompletionLanguageModel, type OpenAICompletionModelId, OpenAIEmbeddingModel, type OpenAIEmbeddingModelId, type OpenAIEmbeddingModelOptions, OpenAIImageModel, type OpenAIImageModelEditOptions, type OpenAIImageModelGenerationOptions, type OpenAIImageModelId, type OpenAIImageModelOptions, type OpenAILanguageModelChatOptions, type OpenAILanguageModelCompletionOptions, OpenAIResponsesLanguageModel, OpenAISpeechModel, type OpenAISpeechModelId, type OpenAISpeechModelOptions, type OpenAITranscriptionCallOptions, OpenAITranscriptionModel, type OpenAITranscriptionModelId, type OpenAITranscriptionModelOptions, type OpenaiResponsesProviderMetadata, type OpenaiResponsesReasoningProviderMetadata, type OpenaiResponsesSourceDocumentProviderMetadata, type OpenaiResponsesTextProviderMetadata, type OpenaiResponsesToolCallProviderMetadata, type ResponsesProviderMetadata, type ResponsesReasoningProviderMetadata, type ResponsesSourceDocumentProviderMetadata, type ResponsesTextProviderMetadata, type ResponsesToolCallProviderMetadata, applyPatch, applyPatchArgsSchema, applyPatchInputSchema, applyPatchOutputSchema, applyPatchToolFactory, codeInterpreter, codeInterpreterArgsSchema, codeInterpreterInputSchema, codeInterpreterOutputSchema, codeInterpreterToolFactory, fileSearch, fileSearchArgsSchema, fileSearchOutputSchema, getMaxImagesPerCall, hasDefaultResponseFormat, imageGeneration, imageGenerationArgsSchema, imageGenerationOutputSchema, modelMaxImagesPerCall, openAITranscriptionModelOptions, openaiEmbeddingModelOptions, openaiImageModelEditOptions, openaiImageModelGenerationOptions, openaiImageModelOptions, openaiLanguageModelChatOptions, openaiLanguageModelCompletionOptions, openaiSpeechModelOptionsSchema, toolSearch, toolSearchArgsSchema, toolSearchInputSchema, toolSearchOutputSchema, webSearch, webSearchArgsSchema, webSearchOutputSchema, webSearchPreview, webSearchPreviewArgsSchema, webSearchPreviewInputSchema, webSearchToolFactory };
1595
+ export { type ApplyPatchOperation, OpenAIChatLanguageModel, type OpenAIChatModelId, OpenAICompletionLanguageModel, type OpenAICompletionModelId, OpenAIEmbeddingModel, type OpenAIEmbeddingModelId, type OpenAIEmbeddingModelOptions, OpenAIImageModel, type OpenAIImageModelEditOptions, type OpenAIImageModelGenerationOptions, type OpenAIImageModelId, type OpenAIImageModelOptions, type OpenAILanguageModelChatOptions, type OpenAILanguageModelCompletionOptions, OpenAIResponsesLanguageModel, OpenAISpeechModel, type OpenAISpeechModelId, type OpenAISpeechModelOptions, type OpenAITranscriptionCallOptions, OpenAITranscriptionModel, type OpenAITranscriptionModelId, type OpenAITranscriptionModelOptions, type OpenaiResponsesProviderMetadata, type OpenaiResponsesReasoningProviderMetadata, type OpenaiResponsesSourceDocumentProviderMetadata, type OpenaiResponsesTextProviderMetadata, type OpenaiResponsesToolCallProviderMetadata, type ResponsesProviderMetadata, type ResponsesReasoningProviderMetadata, type ResponsesSourceDocumentProviderMetadata, type ResponsesTextProviderMetadata, type ResponsesToolCallProviderMetadata, applyPatch, applyPatchArgsSchema, applyPatchInputSchema, applyPatchOutputSchema, applyPatchToolFactory, codeInterpreter, codeInterpreterArgsSchema, codeInterpreterInputSchema, codeInterpreterOutputSchema, codeInterpreterToolFactory, fileSearch, fileSearchArgsSchema, fileSearchOutputSchema, getMaxImagesPerCall, hasDefaultResponseFormat, imageGeneration, imageGenerationArgsSchema, imageGenerationOutputSchema, mapWebSearchResult, modelMaxImagesPerCall, openAITranscriptionModelOptions, openaiEmbeddingModelOptions, openaiImageModelEditOptions, openaiImageModelGenerationOptions, openaiImageModelOptions, openaiLanguageModelChatOptions, openaiLanguageModelCompletionOptions, openaiSpeechModelOptionsSchema, toolSearch, toolSearchArgsSchema, toolSearchInputSchema, toolSearchOutputSchema, webSearch, webSearchArgsSchema, webSearchOutputSchema, webSearchPreview, webSearchPreviewArgsSchema, webSearchPreviewInputSchema, webSearchToolFactory };
@@ -45,6 +45,7 @@ __export(index_exports, {
45
45
  imageGeneration: () => imageGeneration,
46
46
  imageGenerationArgsSchema: () => imageGenerationArgsSchema,
47
47
  imageGenerationOutputSchema: () => imageGenerationOutputSchema,
48
+ mapWebSearchResult: () => mapWebSearchResult,
48
49
  modelMaxImagesPerCall: () => modelMaxImagesPerCall,
49
50
  openAITranscriptionModelOptions: () => openAITranscriptionModelOptions,
50
51
  openaiEmbeddingModelOptions: () => openaiEmbeddingModelOptions,
@@ -6935,7 +6936,7 @@ var OpenAIResponsesLanguageModel = class {
6935
6936
  toolName: toolNameMapping.toCustomToolName(
6936
6937
  webSearchToolName != null ? webSearchToolName : "web_search"
6937
6938
  ),
6938
- result: mapWebSearchOutput(part.action)
6939
+ ...mapWebSearchResult(part)
6939
6940
  });
6940
6941
  break;
6941
6942
  }
@@ -7539,7 +7540,7 @@ var OpenAIResponsesLanguageModel = class {
7539
7540
  toolName: toolNameMapping.toCustomToolName(
7540
7541
  webSearchToolName != null ? webSearchToolName : "web_search"
7541
7542
  ),
7542
- result: mapWebSearchOutput(value.item.action)
7543
+ ...mapWebSearchResult(value.item)
7543
7544
  });
7544
7545
  } else if (value.item.type === "computer_call") {
7545
7546
  ongoingToolCalls[value.output_index] = void 0;
@@ -8221,6 +8222,12 @@ function isErrorChunk(chunk) {
8221
8222
  function isResponseOutputChunk(chunk) {
8222
8223
  return !(chunk.type === "response.created" || chunk.type === "response.failed" || chunk.type === "error" || chunk.type === "unknown_chunk");
8223
8224
  }
8225
+ function mapWebSearchResult({
8226
+ action,
8227
+ status
8228
+ }) {
8229
+ return status === "completed" ? { result: mapWebSearchOutput(action) } : { isError: true, result: { status } };
8230
+ }
8224
8231
  function mapWebSearchOutput(action) {
8225
8232
  var _a2;
8226
8233
  if (action == null) {
@@ -8279,6 +8286,7 @@ function escapeJSONDelta(delta) {
8279
8286
  imageGeneration,
8280
8287
  imageGenerationArgsSchema,
8281
8288
  imageGenerationOutputSchema,
8289
+ mapWebSearchResult,
8282
8290
  modelMaxImagesPerCall,
8283
8291
  openAITranscriptionModelOptions,
8284
8292
  openaiEmbeddingModelOptions,