@ai-sdk/openai 3.0.115 → 3.0.117
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 +22 -0
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +23 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -16
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +5 -5
- package/dist/internal/index.d.ts +5 -5
- package/dist/internal/index.js +22 -15
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +22 -15
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +5 -3
- package/package.json +3 -3
- package/src/chat/openai-chat-api.ts +5 -0
- package/src/chat/openai-chat-language-model.ts +4 -1
- package/src/chat/openai-chat-options.ts +2 -0
- package/src/openai-language-model-capabilities.ts +7 -3
- package/src/openai-stream-error.ts +4 -0
- package/src/responses/openai-responses-api.ts +2 -2
- package/src/responses/openai-responses-language-model.ts +1 -1
- package/src/responses/openai-responses-options.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 3.0.117
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a3e970b: fix(openai): expose Chat Completions audio transcripts as generated text
|
|
8
|
+
- f7f36d2: chore: enable dead code lint rules
|
|
9
|
+
- 57256a0: fix(openai): preserve retryability for early stream errors
|
|
10
|
+
- Updated dependencies [069a945]
|
|
11
|
+
- Updated dependencies [d1a36d2]
|
|
12
|
+
- Updated dependencies [f7f36d2]
|
|
13
|
+
- @ai-sdk/provider-utils@4.0.54
|
|
14
|
+
|
|
15
|
+
## 3.0.116
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- ad8de8d: fix(openai): accept `incomplete` function_call and custom_tool_call items on the Responses stream, so a call truncated by `max_output_tokens` finishes with `length` instead of a `TypeValidationError`
|
|
20
|
+
- 0b9d00b: feat: GPT-6 Sol and Luna model IDs
|
|
21
|
+
- Updated dependencies [da2e17b]
|
|
22
|
+
- @ai-sdk/provider@3.0.17
|
|
23
|
+
- @ai-sdk/provider-utils@4.0.53
|
|
24
|
+
|
|
3
25
|
## 3.0.115
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -3,13 +3,13 @@ import { JSONValue, ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3,
|
|
|
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-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-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-16k' | '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' | 'gpt-5.3-chat-latest' | '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' | (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-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-16k' | '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' | 'gpt-5.3-chat-latest' | '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-luna' | 'gpt-6-sol' | (string & {});
|
|
7
7
|
declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
8
8
|
logitBias?: Record<number, number> | undefined;
|
|
9
9
|
logprobs?: number | boolean | undefined;
|
|
10
10
|
parallelToolCalls?: boolean | undefined;
|
|
11
11
|
user?: string | undefined;
|
|
12
|
-
reasoningEffort?: "low" | "medium" | "high" | "xhigh" | "max" | "
|
|
12
|
+
reasoningEffort?: "none" | "low" | "medium" | "high" | "xhigh" | "max" | "minimal" | undefined;
|
|
13
13
|
maxCompletionTokens?: number | undefined;
|
|
14
14
|
store?: boolean | undefined;
|
|
15
15
|
metadata?: Record<string, string> | undefined;
|
|
@@ -472,7 +472,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
472
472
|
call_id: string;
|
|
473
473
|
name: string;
|
|
474
474
|
arguments: string;
|
|
475
|
-
status: "completed";
|
|
475
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
476
476
|
async?: boolean | null | undefined;
|
|
477
477
|
namespace?: string | null | undefined;
|
|
478
478
|
} | {
|
|
@@ -481,7 +481,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
481
481
|
call_id: string;
|
|
482
482
|
name: string;
|
|
483
483
|
input: string;
|
|
484
|
-
status: "completed";
|
|
484
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
485
485
|
async?: boolean | null | undefined;
|
|
486
486
|
} | {
|
|
487
487
|
type: "code_interpreter_call";
|
|
@@ -1092,7 +1092,7 @@ declare const openaiTools: {
|
|
|
1092
1092
|
}>;
|
|
1093
1093
|
};
|
|
1094
1094
|
|
|
1095
|
-
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-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 & {});
|
|
1095
|
+
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-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 & {});
|
|
1096
1096
|
declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1097
1097
|
conversation?: string | null | undefined;
|
|
1098
1098
|
include?: ("web_search_call.results" | "file_search_call.results" | "message.output_text.logprobs" | "reasoning.encrypted_content")[] | null | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ import { JSONValue, ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3,
|
|
|
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-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-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-16k' | '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' | 'gpt-5.3-chat-latest' | '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' | (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-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-16k' | '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' | 'gpt-5.3-chat-latest' | '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-luna' | 'gpt-6-sol' | (string & {});
|
|
7
7
|
declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
8
8
|
logitBias?: Record<number, number> | undefined;
|
|
9
9
|
logprobs?: number | boolean | undefined;
|
|
10
10
|
parallelToolCalls?: boolean | undefined;
|
|
11
11
|
user?: string | undefined;
|
|
12
|
-
reasoningEffort?: "low" | "medium" | "high" | "xhigh" | "max" | "
|
|
12
|
+
reasoningEffort?: "none" | "low" | "medium" | "high" | "xhigh" | "max" | "minimal" | undefined;
|
|
13
13
|
maxCompletionTokens?: number | undefined;
|
|
14
14
|
store?: boolean | undefined;
|
|
15
15
|
metadata?: Record<string, string> | undefined;
|
|
@@ -472,7 +472,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
472
472
|
call_id: string;
|
|
473
473
|
name: string;
|
|
474
474
|
arguments: string;
|
|
475
|
-
status: "completed";
|
|
475
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
476
476
|
async?: boolean | null | undefined;
|
|
477
477
|
namespace?: string | null | undefined;
|
|
478
478
|
} | {
|
|
@@ -481,7 +481,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
481
481
|
call_id: string;
|
|
482
482
|
name: string;
|
|
483
483
|
input: string;
|
|
484
|
-
status: "completed";
|
|
484
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
485
485
|
async?: boolean | null | undefined;
|
|
486
486
|
} | {
|
|
487
487
|
type: "code_interpreter_call";
|
|
@@ -1092,7 +1092,7 @@ declare const openaiTools: {
|
|
|
1092
1092
|
}>;
|
|
1093
1093
|
};
|
|
1094
1094
|
|
|
1095
|
-
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-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 & {});
|
|
1095
|
+
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-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 & {});
|
|
1096
1096
|
declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1097
1097
|
conversation?: string | null | undefined;
|
|
1098
1098
|
include?: ("web_search_call.results" | "file_search_call.results" | "message.output_text.logprobs" | "reasoning.encrypted_content")[] | null | undefined;
|
package/dist/index.js
CHANGED
|
@@ -60,6 +60,7 @@ function getOpenAILanguageModelCapabilities(modelId) {
|
|
|
60
60
|
const isGptChatModel = (gptVersion == null ? void 0 : gptVersion.minor) == null && ((_b = (_a2 = gptVersion == null ? void 0 : gptVersion.variant) == null ? void 0 : _a2.startsWith("chat")) != null ? _b : false);
|
|
61
61
|
const isGptNanoModel = (_d = (_c = gptVersion == null ? void 0 : gptVersion.variant) == null ? void 0 : _c.startsWith("nano")) != null ? _d : false;
|
|
62
62
|
const isGpt6OrLaterModel = gptVersion != null && gptVersion.major >= 6;
|
|
63
|
+
const isGpt6SolOrLuna = modelId === "gpt-6-sol" || modelId === "gpt-6-luna";
|
|
63
64
|
const supportsFlexProcessing = oSeriesVersion != null && oSeriesVersion >= 3 || gptVersion != null && gptVersion.major >= 5 && !isGptChatModel;
|
|
64
65
|
const supportsPriorityProcessing = modelId.startsWith("gpt-4") || gptVersion != null && gptVersion.major >= 5 && !isGptNanoModel && !isGptChatModel || oSeriesVersion != null && oSeriesVersion >= 3;
|
|
65
66
|
const isReasoningModel = oSeriesVersion != null || gptVersion != null && gptVersion.major >= 5 && !isGptChatModel;
|
|
@@ -70,7 +71,7 @@ function getOpenAILanguageModelCapabilities(modelId) {
|
|
|
70
71
|
supportsPriorityProcessing,
|
|
71
72
|
supportsConfigurationUpdate: isGpt6OrLaterModel,
|
|
72
73
|
supportsAsyncToolCalling: isGpt6OrLaterModel,
|
|
73
|
-
supportedReasoningEfforts: isGpt6OrLaterModel ? ["low", "medium", "high", "xhigh", "max"] : void 0,
|
|
74
|
+
supportedReasoningEfforts: isGpt6SolOrLuna ? ["none", "low", "medium", "high", "xhigh", "max"] : isGpt6OrLaterModel ? ["low", "medium", "high", "xhigh", "max"] : void 0,
|
|
74
75
|
isReasoningModel,
|
|
75
76
|
systemMessageMode,
|
|
76
77
|
supportsNonReasoningParameters
|
|
@@ -166,7 +167,8 @@ function createOpenAIStreamError({
|
|
|
166
167
|
statusCode: streamError == null ? 500 : getStatusCode(streamError),
|
|
167
168
|
responseHeaders,
|
|
168
169
|
responseBody: JSON.stringify(frame),
|
|
169
|
-
data: frame
|
|
170
|
+
data: frame,
|
|
171
|
+
isRetryable: streamError == null ? true : isRetryableStreamError(streamError, getStatusCode(streamError))
|
|
170
172
|
});
|
|
171
173
|
}
|
|
172
174
|
function parseStreamError(frame) {
|
|
@@ -580,6 +582,9 @@ var openaiChatResponseSchema = (0, import_provider_utils3.lazySchema)(
|
|
|
580
582
|
message: import_v42.z.object({
|
|
581
583
|
role: import_v42.z.literal("assistant").nullish(),
|
|
582
584
|
content: import_v42.z.string().nullish(),
|
|
585
|
+
audio: import_v42.z.object({
|
|
586
|
+
transcript: import_v42.z.string().nullish()
|
|
587
|
+
}).nullish(),
|
|
583
588
|
tool_calls: import_v42.z.array(
|
|
584
589
|
import_v42.z.object({
|
|
585
590
|
id: import_v42.z.string().nullish(),
|
|
@@ -1119,7 +1124,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
1119
1124
|
};
|
|
1120
1125
|
}
|
|
1121
1126
|
async doGenerate(options) {
|
|
1122
|
-
var _a2, _b, _c, _d, _e, _f, _g;
|
|
1127
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
1123
1128
|
const { args: body, warnings } = await this.getArgs(options);
|
|
1124
1129
|
const {
|
|
1125
1130
|
responseHeaders,
|
|
@@ -1147,19 +1152,19 @@ var OpenAIChatLanguageModel = class {
|
|
|
1147
1152
|
});
|
|
1148
1153
|
}
|
|
1149
1154
|
const content = [];
|
|
1150
|
-
const text = choice.message.content;
|
|
1155
|
+
const text = choice.message.content != null && choice.message.content.length > 0 ? choice.message.content : (_a2 = choice.message.audio) == null ? void 0 : _a2.transcript;
|
|
1151
1156
|
if (text != null && text.length > 0) {
|
|
1152
1157
|
content.push({ type: "text", text });
|
|
1153
1158
|
}
|
|
1154
|
-
for (const toolCall of (
|
|
1159
|
+
for (const toolCall of (_b = choice.message.tool_calls) != null ? _b : []) {
|
|
1155
1160
|
content.push({
|
|
1156
1161
|
type: "tool-call",
|
|
1157
|
-
toolCallId: (
|
|
1162
|
+
toolCallId: (_c = toolCall.id) != null ? _c : (0, import_provider_utils5.generateId)(),
|
|
1158
1163
|
toolName: toolCall.function.name,
|
|
1159
1164
|
input: toolCall.function.arguments
|
|
1160
1165
|
});
|
|
1161
1166
|
}
|
|
1162
|
-
for (const annotation of (
|
|
1167
|
+
for (const annotation of (_d = choice.message.annotations) != null ? _d : []) {
|
|
1163
1168
|
content.push({
|
|
1164
1169
|
type: "source",
|
|
1165
1170
|
sourceType: "url",
|
|
@@ -1168,8 +1173,8 @@ var OpenAIChatLanguageModel = class {
|
|
|
1168
1173
|
title: annotation.url_citation.title
|
|
1169
1174
|
});
|
|
1170
1175
|
}
|
|
1171
|
-
const completionTokenDetails = (
|
|
1172
|
-
const promptTokenDetails = (
|
|
1176
|
+
const completionTokenDetails = (_e = response.usage) == null ? void 0 : _e.completion_tokens_details;
|
|
1177
|
+
const promptTokenDetails = (_f = response.usage) == null ? void 0 : _f.prompt_tokens_details;
|
|
1173
1178
|
const providerMetadata = { openai: {} };
|
|
1174
1179
|
if ((completionTokenDetails == null ? void 0 : completionTokenDetails.accepted_prediction_tokens) != null) {
|
|
1175
1180
|
providerMetadata.openai.acceptedPredictionTokens = completionTokenDetails == null ? void 0 : completionTokenDetails.accepted_prediction_tokens;
|
|
@@ -1177,14 +1182,14 @@ var OpenAIChatLanguageModel = class {
|
|
|
1177
1182
|
if ((completionTokenDetails == null ? void 0 : completionTokenDetails.rejected_prediction_tokens) != null) {
|
|
1178
1183
|
providerMetadata.openai.rejectedPredictionTokens = completionTokenDetails == null ? void 0 : completionTokenDetails.rejected_prediction_tokens;
|
|
1179
1184
|
}
|
|
1180
|
-
if (((
|
|
1185
|
+
if (((_g = choice.logprobs) == null ? void 0 : _g.content) != null) {
|
|
1181
1186
|
providerMetadata.openai.logprobs = choice.logprobs.content;
|
|
1182
1187
|
}
|
|
1183
1188
|
return {
|
|
1184
1189
|
content,
|
|
1185
1190
|
finishReason: {
|
|
1186
1191
|
unified: mapOpenAIFinishReason(choice.finish_reason),
|
|
1187
|
-
raw: (
|
|
1192
|
+
raw: (_h = choice.finish_reason) != null ? _h : void 0
|
|
1188
1193
|
},
|
|
1189
1194
|
usage: convertOpenAIChatUsage(response.usage),
|
|
1190
1195
|
request: { body },
|
|
@@ -4429,7 +4434,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils28.lazySchema)(
|
|
|
4429
4434
|
name: import_v422.z.string(),
|
|
4430
4435
|
arguments: import_v422.z.string(),
|
|
4431
4436
|
async: import_v422.z.boolean().nullish(),
|
|
4432
|
-
status: import_v422.z.
|
|
4437
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4433
4438
|
namespace: import_v422.z.string().nullish()
|
|
4434
4439
|
}),
|
|
4435
4440
|
import_v422.z.object({
|
|
@@ -4439,7 +4444,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils28.lazySchema)(
|
|
|
4439
4444
|
name: import_v422.z.string(),
|
|
4440
4445
|
input: import_v422.z.string(),
|
|
4441
4446
|
async: import_v422.z.boolean().nullish(),
|
|
4442
|
-
status: import_v422.z.
|
|
4447
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"])
|
|
4443
4448
|
}),
|
|
4444
4449
|
import_v422.z.object({
|
|
4445
4450
|
type: import_v422.z.literal("code_interpreter_call"),
|
|
@@ -5071,7 +5076,9 @@ var openaiResponsesReasoningModelIds = [
|
|
|
5071
5076
|
"gpt-5.6-luna",
|
|
5072
5077
|
"gpt-5.6-sol",
|
|
5073
5078
|
"gpt-5.6-terra",
|
|
5074
|
-
"gpt-6-astra"
|
|
5079
|
+
"gpt-6-astra",
|
|
5080
|
+
"gpt-6-luna",
|
|
5081
|
+
"gpt-6-sol"
|
|
5075
5082
|
];
|
|
5076
5083
|
var openaiResponsesModelIds = [
|
|
5077
5084
|
"gpt-4.1",
|
|
@@ -6887,7 +6894,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6887
6894
|
};
|
|
6888
6895
|
} else if (value.item.type === "shell_call_output") {
|
|
6889
6896
|
} else if (value.item.type === "message") {
|
|
6890
|
-
ongoingAnnotations.splice(0
|
|
6897
|
+
ongoingAnnotations.splice(0);
|
|
6891
6898
|
activeMessagePhase = (_b2 = value.item.phase) != null ? _b2 : void 0;
|
|
6892
6899
|
controller.enqueue({
|
|
6893
6900
|
type: "text-start",
|
|
@@ -8129,7 +8136,7 @@ var OpenAITranscriptionModel = class {
|
|
|
8129
8136
|
};
|
|
8130
8137
|
|
|
8131
8138
|
// src/version.ts
|
|
8132
|
-
var VERSION = true ? "3.0.
|
|
8139
|
+
var VERSION = true ? "3.0.117" : "0.0.0-test";
|
|
8133
8140
|
|
|
8134
8141
|
// src/openai-provider.ts
|
|
8135
8142
|
function createOpenAI(options = {}) {
|