@ai-sdk/openai 2.0.92 → 2.0.94

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.
@@ -187,7 +187,7 @@ declare class OpenAISpeechModel implements SpeechModelV2 {
187
187
  doGenerate(options: Parameters<SpeechModelV2['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV2['doGenerate']>>>;
188
188
  }
189
189
 
190
- type OpenAIResponsesModelId = 'chatgpt-4o-latest' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4-0613' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-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-4' | '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-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | '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' | (string & {});
190
+ type OpenAIResponsesModelId = 'chatgpt-4o-latest' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4-0613' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-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-4' | '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-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-codex' | 'gpt-5.3-codex' | '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' | (string & {});
191
191
 
192
192
  declare class OpenAIResponsesLanguageModel implements LanguageModelV2 {
193
193
  readonly specificationVersion = "v2";
@@ -493,7 +493,7 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactor
493
493
  * An object describing the specific action taken in this web search call.
494
494
  * Includes details on how the model used the web (search, open_page, findInPage).
495
495
  */
496
- action: {
496
+ action?: {
497
497
  /**
498
498
  * Action type "search" - Performs a web search query.
499
499
  */
@@ -187,7 +187,7 @@ declare class OpenAISpeechModel implements SpeechModelV2 {
187
187
  doGenerate(options: Parameters<SpeechModelV2['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV2['doGenerate']>>>;
188
188
  }
189
189
 
190
- type OpenAIResponsesModelId = 'chatgpt-4o-latest' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4-0613' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-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-4' | '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-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | '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' | (string & {});
190
+ type OpenAIResponsesModelId = 'chatgpt-4o-latest' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4-0613' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-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-4' | '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-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-codex' | 'gpt-5.3-codex' | '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' | (string & {});
191
191
 
192
192
  declare class OpenAIResponsesLanguageModel implements LanguageModelV2 {
193
193
  readonly specificationVersion = "v2";
@@ -493,7 +493,7 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactor
493
493
  * An object describing the specific action taken in this web search call.
494
494
  * Includes details on how the model used the web (search, open_page, findInPage).
495
495
  */
496
- action: {
496
+ action?: {
497
497
  /**
498
498
  * Action type "search" - Performs a web search query.
499
499
  */
@@ -2660,7 +2660,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils21.lazyValidator)(
2660
2660
  url: import_v414.z.string().nullish(),
2661
2661
  pattern: import_v414.z.string().nullish()
2662
2662
  })
2663
- ])
2663
+ ]).nullish()
2664
2664
  }),
2665
2665
  import_v414.z.object({
2666
2666
  type: import_v414.z.literal("file_search_call"),
@@ -2857,7 +2857,10 @@ var openaiResponsesResponseSchema = (0, import_provider_utils21.lazyValidator)(
2857
2857
  sources: import_v414.z.array(
2858
2858
  import_v414.z.discriminatedUnion("type", [
2859
2859
  import_v414.z.object({ type: import_v414.z.literal("url"), url: import_v414.z.string() }),
2860
- import_v414.z.object({ type: import_v414.z.literal("api"), name: import_v414.z.string() })
2860
+ import_v414.z.object({
2861
+ type: import_v414.z.literal("api"),
2862
+ name: import_v414.z.string()
2863
+ })
2861
2864
  ])
2862
2865
  ).nullish()
2863
2866
  }),
@@ -2870,7 +2873,7 @@ var openaiResponsesResponseSchema = (0, import_provider_utils21.lazyValidator)(
2870
2873
  url: import_v414.z.string().nullish(),
2871
2874
  pattern: import_v414.z.string().nullish()
2872
2875
  })
2873
- ])
2876
+ ]).nullish()
2874
2877
  }),
2875
2878
  import_v414.z.object({
2876
2879
  type: import_v414.z.literal("file_search_call"),
@@ -2991,7 +2994,9 @@ var openaiResponsesReasoningModelIds = [
2991
2994
  "gpt-5.1-codex-max",
2992
2995
  "gpt-5.2",
2993
2996
  "gpt-5.2-chat-latest",
2994
- "gpt-5.2-pro"
2997
+ "gpt-5.2-pro",
2998
+ "gpt-5.2-codex",
2999
+ "gpt-5.3-codex"
2995
3000
  ];
2996
3001
  var openaiResponsesModelIds = [
2997
3002
  "gpt-4.1",
@@ -3232,7 +3237,7 @@ var webSearchOutputSchema = (0, import_provider_utils25.lazySchema)(
3232
3237
  url: import_v418.z.string().nullish(),
3233
3238
  pattern: import_v418.z.string().nullish()
3234
3239
  })
3235
- ]),
3240
+ ]).optional(),
3236
3241
  sources: import_v418.z.array(
3237
3242
  import_v418.z.discriminatedUnion("type", [
3238
3243
  import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
@@ -3286,7 +3291,7 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils26.lazySchema)(
3286
3291
  url: import_v419.z.string().nullish(),
3287
3292
  pattern: import_v419.z.string().nullish()
3288
3293
  })
3289
- ])
3294
+ ]).optional()
3290
3295
  })
3291
3296
  )
3292
3297
  );
@@ -4529,6 +4534,9 @@ function isErrorChunk(chunk) {
4529
4534
  }
4530
4535
  function mapWebSearchOutput(action) {
4531
4536
  var _a;
4537
+ if (action == null) {
4538
+ return {};
4539
+ }
4532
4540
  switch (action.type) {
4533
4541
  case "search":
4534
4542
  return {