@ai-sdk/openai 3.0.32 → 3.0.34

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 3.0.34
4
+
5
+ ### Patch Changes
6
+
7
+ - 66a374c: Support `phase` parameter on Responses API message items. The `phase` field (`'commentary'` or `'final_answer'`) is returned by models like `gpt-5.3-codex` on assistant message output items and must be preserved when sending follow-up requests. The phase value is available in `providerMetadata.openai.phase` on text parts and is automatically included on assistant messages sent back to the API.
8
+
9
+ ## 3.0.33
10
+
11
+ ### Patch Changes
12
+
13
+ - 624e651: Added missing model IDs to OpenAIChatModelId, OpenAIResponsesModelId, OpenAIImageModelId, OpenAISpeechModelId, OpenAITranscriptionModelId, and OpenAICompletionModelId types for better autocomplete support.
14
+
3
15
  ## 3.0.32
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -3,7 +3,7 @@ import { ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3, Transcript
3
3
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
4
4
  import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
5
5
 
6
- type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4' | 'gpt-4-0613' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'chatgpt-4o-latest' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5.1' | 'gpt-5.1-chat-latest' | 'gpt-5.2' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | (string & {});
6
+ type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-audio-preview-2025-06-03' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini-audio-preview' | 'gpt-4o-mini-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4' | 'gpt-4-0613' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-16k' | 'chatgpt-4o-latest' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | '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' | (string & {});
7
7
  declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<{
8
8
  logitBias?: Record<number, number> | undefined;
9
9
  logprobs?: number | boolean | undefined;
@@ -25,7 +25,7 @@ declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<
25
25
  }>;
26
26
  type OpenAILanguageModelChatOptions = InferSchema<typeof openaiLanguageModelChatOptions>;
27
27
 
28
- type OpenAICompletionModelId = 'gpt-3.5-turbo-instruct' | (string & {});
28
+ type OpenAICompletionModelId = 'gpt-3.5-turbo-instruct' | 'gpt-3.5-turbo-instruct-0914' | (string & {});
29
29
  declare const openaiLanguageModelCompletionOptions: _ai_sdk_provider_utils.LazySchema<{
30
30
  echo?: boolean | undefined;
31
31
  logitBias?: Record<string, number> | undefined;
@@ -42,7 +42,7 @@ declare const openaiEmbeddingModelOptions: _ai_sdk_provider_utils.LazySchema<{
42
42
  }>;
43
43
  type OpenAIEmbeddingModelOptions = InferSchema<typeof openaiEmbeddingModelOptions>;
44
44
 
45
- type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1-mini' | 'gpt-image-1.5' | (string & {});
45
+ type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1-mini' | 'gpt-image-1.5' | 'chatgpt-image-latest' | (string & {});
46
46
 
47
47
  declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
48
48
  /**
@@ -220,6 +220,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
220
220
  item: {
221
221
  type: "message";
222
222
  id: string;
223
+ phase?: "commentary" | "final_answer" | null | undefined;
223
224
  } | {
224
225
  type: "reasoning";
225
226
  id: string;
@@ -315,6 +316,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
315
316
  item: {
316
317
  type: "message";
317
318
  id: string;
319
+ phase?: "commentary" | "final_answer" | null | undefined;
318
320
  } | {
319
321
  type: "reasoning";
320
322
  id: string;
@@ -868,7 +870,7 @@ declare const openaiTools: {
868
870
  }>;
869
871
  };
870
872
 
871
- 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 & {});
873
+ 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-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-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' | 'o4-mini' | 'o4-mini-2025-04-16' | (string & {});
872
874
  declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
873
875
  conversation?: string | null | undefined;
874
876
  include?: ("file_search_call.results" | "message.output_text.logprobs" | "reasoning.encrypted_content")[] | null | undefined;
@@ -894,14 +896,14 @@ declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.
894
896
  }>;
895
897
  type OpenAILanguageModelResponsesOptions = InferSchema<typeof openaiLanguageModelResponsesOptionsSchema>;
896
898
 
897
- type OpenAISpeechModelId = 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts' | (string & {});
899
+ type OpenAISpeechModelId = 'tts-1' | 'tts-1-1106' | 'tts-1-hd' | 'tts-1-hd-1106' | 'gpt-4o-mini-tts' | 'gpt-4o-mini-tts-2025-03-20' | 'gpt-4o-mini-tts-2025-12-15' | (string & {});
898
900
  declare const openaiSpeechModelOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
899
901
  instructions?: string | null | undefined;
900
902
  speed?: number | null | undefined;
901
903
  }>;
902
904
  type OpenAISpeechModelOptions = InferSchema<typeof openaiSpeechModelOptionsSchema>;
903
905
 
904
- type OpenAITranscriptionModelId = 'whisper-1' | 'gpt-4o-mini-transcribe' | 'gpt-4o-transcribe' | (string & {});
906
+ type OpenAITranscriptionModelId = 'whisper-1' | 'gpt-4o-mini-transcribe' | 'gpt-4o-mini-transcribe-2025-03-20' | 'gpt-4o-mini-transcribe-2025-12-15' | 'gpt-4o-transcribe' | 'gpt-4o-transcribe-diarize' | (string & {});
905
907
  declare const openAITranscriptionModelOptions: _ai_sdk_provider_utils.LazySchema<{
906
908
  include?: string[] | undefined;
907
909
  language?: string | undefined;
@@ -1027,6 +1029,7 @@ type OpenaiResponsesProviderMetadata = {
1027
1029
  };
1028
1030
  type ResponsesTextProviderMetadata = {
1029
1031
  itemId: string;
1032
+ phase?: 'commentary' | 'final_answer' | null;
1030
1033
  annotations?: Array<ResponsesOutputTextAnnotationProviderMetadata>;
1031
1034
  };
1032
1035
  type OpenaiResponsesTextProviderMetadata = {
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3, Transcript
3
3
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
4
4
  import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
5
5
 
6
- type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4' | 'gpt-4-0613' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'chatgpt-4o-latest' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5.1' | 'gpt-5.1-chat-latest' | 'gpt-5.2' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | (string & {});
6
+ type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-audio-preview-2025-06-03' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini-audio-preview' | 'gpt-4o-mini-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4' | 'gpt-4-0613' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-16k' | 'chatgpt-4o-latest' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | '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' | (string & {});
7
7
  declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<{
8
8
  logitBias?: Record<number, number> | undefined;
9
9
  logprobs?: number | boolean | undefined;
@@ -25,7 +25,7 @@ declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<
25
25
  }>;
26
26
  type OpenAILanguageModelChatOptions = InferSchema<typeof openaiLanguageModelChatOptions>;
27
27
 
28
- type OpenAICompletionModelId = 'gpt-3.5-turbo-instruct' | (string & {});
28
+ type OpenAICompletionModelId = 'gpt-3.5-turbo-instruct' | 'gpt-3.5-turbo-instruct-0914' | (string & {});
29
29
  declare const openaiLanguageModelCompletionOptions: _ai_sdk_provider_utils.LazySchema<{
30
30
  echo?: boolean | undefined;
31
31
  logitBias?: Record<string, number> | undefined;
@@ -42,7 +42,7 @@ declare const openaiEmbeddingModelOptions: _ai_sdk_provider_utils.LazySchema<{
42
42
  }>;
43
43
  type OpenAIEmbeddingModelOptions = InferSchema<typeof openaiEmbeddingModelOptions>;
44
44
 
45
- type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1-mini' | 'gpt-image-1.5' | (string & {});
45
+ type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1-mini' | 'gpt-image-1.5' | 'chatgpt-image-latest' | (string & {});
46
46
 
47
47
  declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
48
48
  /**
@@ -220,6 +220,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
220
220
  item: {
221
221
  type: "message";
222
222
  id: string;
223
+ phase?: "commentary" | "final_answer" | null | undefined;
223
224
  } | {
224
225
  type: "reasoning";
225
226
  id: string;
@@ -315,6 +316,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
315
316
  item: {
316
317
  type: "message";
317
318
  id: string;
319
+ phase?: "commentary" | "final_answer" | null | undefined;
318
320
  } | {
319
321
  type: "reasoning";
320
322
  id: string;
@@ -868,7 +870,7 @@ declare const openaiTools: {
868
870
  }>;
869
871
  };
870
872
 
871
- 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 & {});
873
+ 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-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-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' | 'o4-mini' | 'o4-mini-2025-04-16' | (string & {});
872
874
  declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
873
875
  conversation?: string | null | undefined;
874
876
  include?: ("file_search_call.results" | "message.output_text.logprobs" | "reasoning.encrypted_content")[] | null | undefined;
@@ -894,14 +896,14 @@ declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.
894
896
  }>;
895
897
  type OpenAILanguageModelResponsesOptions = InferSchema<typeof openaiLanguageModelResponsesOptionsSchema>;
896
898
 
897
- type OpenAISpeechModelId = 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts' | (string & {});
899
+ type OpenAISpeechModelId = 'tts-1' | 'tts-1-1106' | 'tts-1-hd' | 'tts-1-hd-1106' | 'gpt-4o-mini-tts' | 'gpt-4o-mini-tts-2025-03-20' | 'gpt-4o-mini-tts-2025-12-15' | (string & {});
898
900
  declare const openaiSpeechModelOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
899
901
  instructions?: string | null | undefined;
900
902
  speed?: number | null | undefined;
901
903
  }>;
902
904
  type OpenAISpeechModelOptions = InferSchema<typeof openaiSpeechModelOptionsSchema>;
903
905
 
904
- type OpenAITranscriptionModelId = 'whisper-1' | 'gpt-4o-mini-transcribe' | 'gpt-4o-transcribe' | (string & {});
906
+ type OpenAITranscriptionModelId = 'whisper-1' | 'gpt-4o-mini-transcribe' | 'gpt-4o-mini-transcribe-2025-03-20' | 'gpt-4o-mini-transcribe-2025-12-15' | 'gpt-4o-transcribe' | 'gpt-4o-transcribe-diarize' | (string & {});
905
907
  declare const openAITranscriptionModelOptions: _ai_sdk_provider_utils.LazySchema<{
906
908
  include?: string[] | undefined;
907
909
  language?: string | undefined;
@@ -1027,6 +1029,7 @@ type OpenaiResponsesProviderMetadata = {
1027
1029
  };
1028
1030
  type ResponsesTextProviderMetadata = {
1029
1031
  itemId: string;
1032
+ phase?: 'commentary' | 'final_answer' | null;
1030
1033
  annotations?: Array<ResponsesOutputTextAnnotationProviderMetadata>;
1031
1034
  };
1032
1035
  type OpenaiResponsesTextProviderMetadata = {
package/dist/index.js CHANGED
@@ -1749,9 +1749,11 @@ var modelMaxImagesPerCall = {
1749
1749
  "dall-e-2": 10,
1750
1750
  "gpt-image-1": 10,
1751
1751
  "gpt-image-1-mini": 10,
1752
- "gpt-image-1.5": 10
1752
+ "gpt-image-1.5": 10,
1753
+ "chatgpt-image-latest": 10
1753
1754
  };
1754
1755
  var defaultResponseFormatPrefixes = [
1756
+ "chatgpt-image-",
1755
1757
  "gpt-image-1-mini",
1756
1758
  "gpt-image-1.5",
1757
1759
  "gpt-image-1"
@@ -2573,7 +2575,7 @@ async function convertToOpenAIResponsesInput({
2573
2575
  hasShellTool = false,
2574
2576
  hasApplyPatchTool = false
2575
2577
  }) {
2576
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
2578
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
2577
2579
  const input = [];
2578
2580
  const warnings = [];
2579
2581
  const processedApprovalIds = /* @__PURE__ */ new Set();
@@ -2654,7 +2656,9 @@ async function convertToOpenAIResponsesInput({
2654
2656
  for (const part of content) {
2655
2657
  switch (part.type) {
2656
2658
  case "text": {
2657
- const id = (_b = (_a = part.providerOptions) == null ? void 0 : _a[providerOptionsName]) == null ? void 0 : _b.itemId;
2659
+ const providerOpts = (_a = part.providerOptions) == null ? void 0 : _a[providerOptionsName];
2660
+ const id = providerOpts == null ? void 0 : providerOpts.itemId;
2661
+ const phase = providerOpts == null ? void 0 : providerOpts.phase;
2658
2662
  if (hasConversation && id != null) {
2659
2663
  break;
2660
2664
  }
@@ -2665,12 +2669,13 @@ async function convertToOpenAIResponsesInput({
2665
2669
  input.push({
2666
2670
  role: "assistant",
2667
2671
  content: [{ type: "output_text", text: part.text }],
2668
- id
2672
+ id,
2673
+ ...phase != null && { phase }
2669
2674
  });
2670
2675
  break;
2671
2676
  }
2672
2677
  case "tool-call": {
2673
- const id = (_g = (_d = (_c = part.providerOptions) == null ? void 0 : _c[providerOptionsName]) == null ? void 0 : _d.itemId) != null ? _g : (_f = (_e = part.providerMetadata) == null ? void 0 : _e[providerOptionsName]) == null ? void 0 : _f.itemId;
2678
+ const id = (_f = (_c = (_b = part.providerOptions) == null ? void 0 : _b[providerOptionsName]) == null ? void 0 : _c.itemId) != null ? _f : (_e = (_d = part.providerMetadata) == null ? void 0 : _d[providerOptionsName]) == null ? void 0 : _e.itemId;
2674
2679
  if (hasConversation && id != null) {
2675
2680
  break;
2676
2681
  }
@@ -2781,7 +2786,7 @@ async function convertToOpenAIResponsesInput({
2781
2786
  break;
2782
2787
  }
2783
2788
  if (store) {
2784
- const itemId = (_j = (_i = (_h = part.providerOptions) == null ? void 0 : _h[providerOptionsName]) == null ? void 0 : _i.itemId) != null ? _j : part.toolCallId;
2789
+ const itemId = (_i = (_h = (_g = part.providerOptions) == null ? void 0 : _g[providerOptionsName]) == null ? void 0 : _h.itemId) != null ? _i : part.toolCallId;
2785
2790
  input.push({ type: "item_reference", id: itemId });
2786
2791
  } else {
2787
2792
  warnings.push({
@@ -2875,7 +2880,7 @@ async function convertToOpenAIResponsesInput({
2875
2880
  }
2876
2881
  const output = part.output;
2877
2882
  if (output.type === "execution-denied") {
2878
- const approvalId = (_l = (_k = output.providerOptions) == null ? void 0 : _k.openai) == null ? void 0 : _l.approvalId;
2883
+ const approvalId = (_k = (_j = output.providerOptions) == null ? void 0 : _j.openai) == null ? void 0 : _k.approvalId;
2879
2884
  if (approvalId) {
2880
2885
  continue;
2881
2886
  }
@@ -2934,7 +2939,7 @@ async function convertToOpenAIResponsesInput({
2934
2939
  contentValue = output.value;
2935
2940
  break;
2936
2941
  case "execution-denied":
2937
- contentValue = (_m = output.reason) != null ? _m : "Tool execution denied.";
2942
+ contentValue = (_l = output.reason) != null ? _l : "Tool execution denied.";
2938
2943
  break;
2939
2944
  case "json":
2940
2945
  case "error-json":
@@ -3067,7 +3072,8 @@ var openaiResponsesChunkSchema = (0, import_provider_utils24.lazySchema)(
3067
3072
  item: import_v419.z.discriminatedUnion("type", [
3068
3073
  import_v419.z.object({
3069
3074
  type: import_v419.z.literal("message"),
3070
- id: import_v419.z.string()
3075
+ id: import_v419.z.string(),
3076
+ phase: import_v419.z.enum(["commentary", "final_answer"]).nullish()
3071
3077
  }),
3072
3078
  import_v419.z.object({
3073
3079
  type: import_v419.z.literal("reasoning"),
@@ -3184,7 +3190,8 @@ var openaiResponsesChunkSchema = (0, import_provider_utils24.lazySchema)(
3184
3190
  item: import_v419.z.discriminatedUnion("type", [
3185
3191
  import_v419.z.object({
3186
3192
  type: import_v419.z.literal("message"),
3187
- id: import_v419.z.string()
3193
+ id: import_v419.z.string(),
3194
+ phase: import_v419.z.enum(["commentary", "final_answer"]).nullish()
3188
3195
  }),
3189
3196
  import_v419.z.object({
3190
3197
  type: import_v419.z.literal("reasoning"),
@@ -3496,6 +3503,7 @@ var openaiResponsesResponseSchema = (0, import_provider_utils24.lazySchema)(
3496
3503
  type: import_v419.z.literal("message"),
3497
3504
  role: import_v419.z.literal("assistant"),
3498
3505
  id: import_v419.z.string(),
3506
+ phase: import_v419.z.enum(["commentary", "final_answer"]).nullish(),
3499
3507
  content: import_v419.z.array(
3500
3508
  import_v419.z.object({
3501
3509
  type: import_v419.z.literal("output_text"),
@@ -4628,6 +4636,7 @@ var OpenAIResponsesLanguageModel = class {
4628
4636
  }
4629
4637
  const providerMetadata2 = {
4630
4638
  itemId: part.id,
4639
+ ...part.phase != null && { phase: part.phase },
4631
4640
  ...contentPart.annotations.length > 0 && {
4632
4641
  annotations: contentPart.annotations
4633
4642
  }
@@ -4942,6 +4951,7 @@ var OpenAIResponsesLanguageModel = class {
4942
4951
  let responseId = null;
4943
4952
  const ongoingToolCalls = {};
4944
4953
  const ongoingAnnotations = [];
4954
+ let activeMessagePhase;
4945
4955
  let hasFunctionCall = false;
4946
4956
  const activeReasoning = {};
4947
4957
  let serviceTier;
@@ -4952,7 +4962,7 @@ var OpenAIResponsesLanguageModel = class {
4952
4962
  controller.enqueue({ type: "stream-start", warnings });
4953
4963
  },
4954
4964
  transform(chunk, controller) {
4955
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
4965
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
4956
4966
  if (options.includeRawChunks) {
4957
4967
  controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
4958
4968
  }
@@ -5093,12 +5103,16 @@ var OpenAIResponsesLanguageModel = class {
5093
5103
  } else if (value.item.type === "shell_call_output") {
5094
5104
  } else if (value.item.type === "message") {
5095
5105
  ongoingAnnotations.splice(0, ongoingAnnotations.length);
5106
+ activeMessagePhase = (_a = value.item.phase) != null ? _a : void 0;
5096
5107
  controller.enqueue({
5097
5108
  type: "text-start",
5098
5109
  id: value.item.id,
5099
5110
  providerMetadata: {
5100
5111
  [providerOptionsName]: {
5101
- itemId: value.item.id
5112
+ itemId: value.item.id,
5113
+ ...value.item.phase != null && {
5114
+ phase: value.item.phase
5115
+ }
5102
5116
  }
5103
5117
  }
5104
5118
  });
@@ -5113,19 +5127,22 @@ var OpenAIResponsesLanguageModel = class {
5113
5127
  providerMetadata: {
5114
5128
  [providerOptionsName]: {
5115
5129
  itemId: value.item.id,
5116
- reasoningEncryptedContent: (_a = value.item.encrypted_content) != null ? _a : null
5130
+ reasoningEncryptedContent: (_b = value.item.encrypted_content) != null ? _b : null
5117
5131
  }
5118
5132
  }
5119
5133
  });
5120
5134
  }
5121
5135
  } else if (isResponseOutputItemDoneChunk(value)) {
5122
5136
  if (value.item.type === "message") {
5137
+ const phase = (_c = value.item.phase) != null ? _c : activeMessagePhase;
5138
+ activeMessagePhase = void 0;
5123
5139
  controller.enqueue({
5124
5140
  type: "text-end",
5125
5141
  id: value.item.id,
5126
5142
  providerMetadata: {
5127
5143
  [providerOptionsName]: {
5128
5144
  itemId: value.item.id,
5145
+ ...phase != null && { phase },
5129
5146
  ...ongoingAnnotations.length > 0 && {
5130
5147
  annotations: ongoingAnnotations
5131
5148
  }
@@ -5190,13 +5207,13 @@ var OpenAIResponsesLanguageModel = class {
5190
5207
  toolName: toolNameMapping.toCustomToolName("file_search"),
5191
5208
  result: {
5192
5209
  queries: value.item.queries,
5193
- results: (_c = (_b = value.item.results) == null ? void 0 : _b.map((result) => ({
5210
+ results: (_e = (_d = value.item.results) == null ? void 0 : _d.map((result) => ({
5194
5211
  attributes: result.attributes,
5195
5212
  fileId: result.file_id,
5196
5213
  filename: result.filename,
5197
5214
  score: result.score,
5198
5215
  text: result.text
5199
- }))) != null ? _c : null
5216
+ }))) != null ? _e : null
5200
5217
  }
5201
5218
  });
5202
5219
  } else if (value.item.type === "code_interpreter_call") {
@@ -5220,10 +5237,10 @@ var OpenAIResponsesLanguageModel = class {
5220
5237
  });
5221
5238
  } else if (value.item.type === "mcp_call") {
5222
5239
  ongoingToolCalls[value.output_index] = void 0;
5223
- const approvalRequestId = (_d = value.item.approval_request_id) != null ? _d : void 0;
5224
- const aliasedToolCallId = approvalRequestId != null ? (_f = (_e = approvalRequestIdToDummyToolCallIdFromStream.get(
5240
+ const approvalRequestId = (_f = value.item.approval_request_id) != null ? _f : void 0;
5241
+ const aliasedToolCallId = approvalRequestId != null ? (_h = (_g = approvalRequestIdToDummyToolCallIdFromStream.get(
5225
5242
  approvalRequestId
5226
- )) != null ? _e : approvalRequestIdToDummyToolCallIdFromPrompt[approvalRequestId]) != null ? _f : value.item.id : value.item.id;
5243
+ )) != null ? _g : approvalRequestIdToDummyToolCallIdFromPrompt[approvalRequestId]) != null ? _h : value.item.id : value.item.id;
5227
5244
  const toolName = `mcp.${value.item.name}`;
5228
5245
  controller.enqueue({
5229
5246
  type: "tool-call",
@@ -5293,8 +5310,8 @@ var OpenAIResponsesLanguageModel = class {
5293
5310
  ongoingToolCalls[value.output_index] = void 0;
5294
5311
  } else if (value.item.type === "mcp_approval_request") {
5295
5312
  ongoingToolCalls[value.output_index] = void 0;
5296
- const dummyToolCallId = (_i = (_h = (_g = self.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0, import_provider_utils27.generateId)();
5297
- const approvalRequestId = (_j = value.item.approval_request_id) != null ? _j : value.item.id;
5313
+ const dummyToolCallId = (_k = (_j = (_i = self.config).generateId) == null ? void 0 : _j.call(_i)) != null ? _k : (0, import_provider_utils27.generateId)();
5314
+ const approvalRequestId = (_l = value.item.approval_request_id) != null ? _l : value.item.id;
5298
5315
  approvalRequestIdToDummyToolCallIdFromStream.set(
5299
5316
  approvalRequestId,
5300
5317
  dummyToolCallId
@@ -5383,7 +5400,7 @@ var OpenAIResponsesLanguageModel = class {
5383
5400
  providerMetadata: {
5384
5401
  [providerOptionsName]: {
5385
5402
  itemId: value.item.id,
5386
- reasoningEncryptedContent: (_k = value.item.encrypted_content) != null ? _k : null
5403
+ reasoningEncryptedContent: (_m = value.item.encrypted_content) != null ? _m : null
5387
5404
  }
5388
5405
  }
5389
5406
  });
@@ -5487,7 +5504,7 @@ var OpenAIResponsesLanguageModel = class {
5487
5504
  id: value.item_id,
5488
5505
  delta: value.delta
5489
5506
  });
5490
- if (((_m = (_l = options.providerOptions) == null ? void 0 : _l[providerOptionsName]) == null ? void 0 : _m.logprobs) && value.logprobs) {
5507
+ if (((_o = (_n = options.providerOptions) == null ? void 0 : _n[providerOptionsName]) == null ? void 0 : _o.logprobs) && value.logprobs) {
5491
5508
  logprobs.push(value.logprobs);
5492
5509
  }
5493
5510
  } else if (value.type === "response.reasoning_summary_part.added") {
@@ -5516,7 +5533,7 @@ var OpenAIResponsesLanguageModel = class {
5516
5533
  providerMetadata: {
5517
5534
  [providerOptionsName]: {
5518
5535
  itemId: value.item_id,
5519
- reasoningEncryptedContent: (_o = (_n = activeReasoning[value.item_id]) == null ? void 0 : _n.encryptedContent) != null ? _o : null
5536
+ reasoningEncryptedContent: (_q = (_p = activeReasoning[value.item_id]) == null ? void 0 : _p.encryptedContent) != null ? _q : null
5520
5537
  }
5521
5538
  }
5522
5539
  });
@@ -5550,10 +5567,10 @@ var OpenAIResponsesLanguageModel = class {
5550
5567
  } else if (isResponseFinishedChunk(value)) {
5551
5568
  finishReason = {
5552
5569
  unified: mapOpenAIResponseFinishReason({
5553
- finishReason: (_p = value.response.incomplete_details) == null ? void 0 : _p.reason,
5570
+ finishReason: (_r = value.response.incomplete_details) == null ? void 0 : _r.reason,
5554
5571
  hasFunctionCall
5555
5572
  }),
5556
- raw: (_r = (_q = value.response.incomplete_details) == null ? void 0 : _q.reason) != null ? _r : void 0
5573
+ raw: (_t = (_s = value.response.incomplete_details) == null ? void 0 : _s.reason) != null ? _t : void 0
5557
5574
  };
5558
5575
  usage = value.response.usage;
5559
5576
  if (typeof value.response.service_tier === "string") {
@@ -5565,7 +5582,7 @@ var OpenAIResponsesLanguageModel = class {
5565
5582
  controller.enqueue({
5566
5583
  type: "source",
5567
5584
  sourceType: "url",
5568
- id: (_u = (_t = (_s = self.config).generateId) == null ? void 0 : _t.call(_s)) != null ? _u : (0, import_provider_utils27.generateId)(),
5585
+ id: (_w = (_v = (_u = self.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : (0, import_provider_utils27.generateId)(),
5569
5586
  url: value.annotation.url,
5570
5587
  title: value.annotation.title
5571
5588
  });
@@ -5573,7 +5590,7 @@ var OpenAIResponsesLanguageModel = class {
5573
5590
  controller.enqueue({
5574
5591
  type: "source",
5575
5592
  sourceType: "document",
5576
- id: (_x = (_w = (_v = self.config).generateId) == null ? void 0 : _w.call(_v)) != null ? _x : (0, import_provider_utils27.generateId)(),
5593
+ id: (_z = (_y = (_x = self.config).generateId) == null ? void 0 : _y.call(_x)) != null ? _z : (0, import_provider_utils27.generateId)(),
5577
5594
  mediaType: "text/plain",
5578
5595
  title: value.annotation.filename,
5579
5596
  filename: value.annotation.filename,
@@ -5589,7 +5606,7 @@ var OpenAIResponsesLanguageModel = class {
5589
5606
  controller.enqueue({
5590
5607
  type: "source",
5591
5608
  sourceType: "document",
5592
- id: (_A = (_z = (_y = self.config).generateId) == null ? void 0 : _z.call(_y)) != null ? _A : (0, import_provider_utils27.generateId)(),
5609
+ id: (_C = (_B = (_A = self.config).generateId) == null ? void 0 : _B.call(_A)) != null ? _C : (0, import_provider_utils27.generateId)(),
5593
5610
  mediaType: "text/plain",
5594
5611
  title: value.annotation.filename,
5595
5612
  filename: value.annotation.filename,
@@ -5605,7 +5622,7 @@ var OpenAIResponsesLanguageModel = class {
5605
5622
  controller.enqueue({
5606
5623
  type: "source",
5607
5624
  sourceType: "document",
5608
- id: (_D = (_C = (_B = self.config).generateId) == null ? void 0 : _C.call(_B)) != null ? _D : (0, import_provider_utils27.generateId)(),
5625
+ id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : (0, import_provider_utils27.generateId)(),
5609
5626
  mediaType: "application/octet-stream",
5610
5627
  title: value.annotation.file_id,
5611
5628
  filename: value.annotation.file_id,
@@ -6064,7 +6081,7 @@ var OpenAITranscriptionModel = class {
6064
6081
  };
6065
6082
 
6066
6083
  // src/version.ts
6067
- var VERSION = true ? "3.0.32" : "0.0.0-test";
6084
+ var VERSION = true ? "3.0.34" : "0.0.0-test";
6068
6085
 
6069
6086
  // src/openai-provider.ts
6070
6087
  function createOpenAI(options = {}) {