@ai-sdk/openai 2.0.123 → 2.0.125
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 +12 -0
- package/dist/index.d.mts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +85 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +85 -8
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +7 -7
- package/dist/internal/index.d.ts +7 -7
- package/dist/internal/index.js +84 -7
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +84 -7
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 2.0.125
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e0d0bd1: feat(openai): add GPT-6 reasoning configuration updates
|
|
8
|
+
|
|
9
|
+
## 2.0.124
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 7bebd57: feat(openai): add support for the gpt-6-astra
|
|
14
|
+
|
|
3
15
|
## 2.0.123
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -2,13 +2,13 @@ import { ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV2, Transcript
|
|
|
2
2
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
3
3
|
import { InferValidator, FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
4
|
|
|
5
|
-
type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-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' | '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.6' | 'gpt-5.6-luna' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | (string & {});
|
|
5
|
+
type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-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' | '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.6' | 'gpt-5.6-luna' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | 'gpt-6-astra' | (string & {});
|
|
6
6
|
declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.LazyValidator<{
|
|
7
7
|
logitBias?: Record<number, number> | undefined;
|
|
8
8
|
logprobs?: number | boolean | undefined;
|
|
9
9
|
parallelToolCalls?: boolean | undefined;
|
|
10
10
|
user?: string | undefined;
|
|
11
|
-
reasoningEffort?: "
|
|
11
|
+
reasoningEffort?: "low" | "medium" | "high" | "xhigh" | "max" | "none" | "minimal" | undefined;
|
|
12
12
|
maxCompletionTokens?: number | undefined;
|
|
13
13
|
store?: boolean | undefined;
|
|
14
14
|
metadata?: Record<string, string> | undefined;
|
|
@@ -33,7 +33,7 @@ type OpenAIEmbeddingModelId = 'text-embedding-3-small' | 'text-embedding-3-large
|
|
|
33
33
|
|
|
34
34
|
type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1-mini' | 'gpt-image-1.5' | 'gpt-image-2' | (string & {});
|
|
35
35
|
declare const openaiImageModelOptions: _ai_sdk_provider_utils.LazyValidator<{
|
|
36
|
-
quality?: "
|
|
36
|
+
quality?: "low" | "medium" | "high" | "auto" | "standard" | "hd" | undefined;
|
|
37
37
|
background?: "auto" | "transparent" | "opaque" | undefined;
|
|
38
38
|
outputFormat?: "png" | "jpeg" | "webp" | undefined;
|
|
39
39
|
outputCompression?: number | undefined;
|
|
@@ -41,13 +41,13 @@ declare const openaiImageModelOptions: _ai_sdk_provider_utils.LazyValidator<{
|
|
|
41
41
|
}>;
|
|
42
42
|
type OpenAIImageModelOptions = InferValidator<typeof openaiImageModelOptions>;
|
|
43
43
|
declare const openaiImageModelGenerationOptions: _ai_sdk_provider_utils.LazyValidator<{
|
|
44
|
-
quality?: "
|
|
44
|
+
quality?: "low" | "medium" | "high" | "auto" | "standard" | "hd" | undefined;
|
|
45
45
|
background?: "auto" | "transparent" | "opaque" | undefined;
|
|
46
46
|
outputFormat?: "png" | "jpeg" | "webp" | undefined;
|
|
47
47
|
outputCompression?: number | undefined;
|
|
48
48
|
user?: string | undefined;
|
|
49
49
|
style?: "vivid" | "natural" | undefined;
|
|
50
|
-
moderation?: "
|
|
50
|
+
moderation?: "low" | "auto" | undefined;
|
|
51
51
|
}>;
|
|
52
52
|
type OpenAIImageModelGenerationOptions = InferValidator<typeof openaiImageModelGenerationOptions>;
|
|
53
53
|
|
|
@@ -358,7 +358,7 @@ declare const openaiTools: {
|
|
|
358
358
|
}>;
|
|
359
359
|
};
|
|
360
360
|
|
|
361
|
-
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-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.6' | 'gpt-5.6-luna' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | '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 & {});
|
|
361
|
+
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-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.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' | (string & {});
|
|
362
362
|
declare const openaiResponsesProviderOptionsSchema: _ai_sdk_provider_utils.LazyValidator<{
|
|
363
363
|
conversation?: string | null | undefined;
|
|
364
364
|
include?: ("file_search_call.results" | "message.output_text.logprobs" | "reasoning.encrypted_content")[] | null | undefined;
|
|
@@ -375,6 +375,7 @@ declare const openaiResponsesProviderOptionsSchema: _ai_sdk_provider_utils.LazyV
|
|
|
375
375
|
} | undefined;
|
|
376
376
|
promptCacheRetention?: "in_memory" | "24h" | null | undefined;
|
|
377
377
|
reasoningEffort?: string | null | undefined;
|
|
378
|
+
reasoningEffortUpdate?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
|
|
378
379
|
reasoningMode?: "standard" | "pro" | undefined;
|
|
379
380
|
reasoningContext?: "auto" | "current_turn" | "all_turns" | undefined;
|
|
380
381
|
reasoningSummary?: string | null | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ import { ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV2, Transcript
|
|
|
2
2
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
3
3
|
import { InferValidator, FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
4
|
|
|
5
|
-
type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-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' | '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.6' | 'gpt-5.6-luna' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | (string & {});
|
|
5
|
+
type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-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' | '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.6' | 'gpt-5.6-luna' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | 'gpt-6-astra' | (string & {});
|
|
6
6
|
declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.LazyValidator<{
|
|
7
7
|
logitBias?: Record<number, number> | undefined;
|
|
8
8
|
logprobs?: number | boolean | undefined;
|
|
9
9
|
parallelToolCalls?: boolean | undefined;
|
|
10
10
|
user?: string | undefined;
|
|
11
|
-
reasoningEffort?: "
|
|
11
|
+
reasoningEffort?: "low" | "medium" | "high" | "xhigh" | "max" | "none" | "minimal" | undefined;
|
|
12
12
|
maxCompletionTokens?: number | undefined;
|
|
13
13
|
store?: boolean | undefined;
|
|
14
14
|
metadata?: Record<string, string> | undefined;
|
|
@@ -33,7 +33,7 @@ type OpenAIEmbeddingModelId = 'text-embedding-3-small' | 'text-embedding-3-large
|
|
|
33
33
|
|
|
34
34
|
type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1-mini' | 'gpt-image-1.5' | 'gpt-image-2' | (string & {});
|
|
35
35
|
declare const openaiImageModelOptions: _ai_sdk_provider_utils.LazyValidator<{
|
|
36
|
-
quality?: "
|
|
36
|
+
quality?: "low" | "medium" | "high" | "auto" | "standard" | "hd" | undefined;
|
|
37
37
|
background?: "auto" | "transparent" | "opaque" | undefined;
|
|
38
38
|
outputFormat?: "png" | "jpeg" | "webp" | undefined;
|
|
39
39
|
outputCompression?: number | undefined;
|
|
@@ -41,13 +41,13 @@ declare const openaiImageModelOptions: _ai_sdk_provider_utils.LazyValidator<{
|
|
|
41
41
|
}>;
|
|
42
42
|
type OpenAIImageModelOptions = InferValidator<typeof openaiImageModelOptions>;
|
|
43
43
|
declare const openaiImageModelGenerationOptions: _ai_sdk_provider_utils.LazyValidator<{
|
|
44
|
-
quality?: "
|
|
44
|
+
quality?: "low" | "medium" | "high" | "auto" | "standard" | "hd" | undefined;
|
|
45
45
|
background?: "auto" | "transparent" | "opaque" | undefined;
|
|
46
46
|
outputFormat?: "png" | "jpeg" | "webp" | undefined;
|
|
47
47
|
outputCompression?: number | undefined;
|
|
48
48
|
user?: string | undefined;
|
|
49
49
|
style?: "vivid" | "natural" | undefined;
|
|
50
|
-
moderation?: "
|
|
50
|
+
moderation?: "low" | "auto" | undefined;
|
|
51
51
|
}>;
|
|
52
52
|
type OpenAIImageModelGenerationOptions = InferValidator<typeof openaiImageModelGenerationOptions>;
|
|
53
53
|
|
|
@@ -358,7 +358,7 @@ declare const openaiTools: {
|
|
|
358
358
|
}>;
|
|
359
359
|
};
|
|
360
360
|
|
|
361
|
-
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-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.6' | 'gpt-5.6-luna' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | '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 & {});
|
|
361
|
+
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-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.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' | (string & {});
|
|
362
362
|
declare const openaiResponsesProviderOptionsSchema: _ai_sdk_provider_utils.LazyValidator<{
|
|
363
363
|
conversation?: string | null | undefined;
|
|
364
364
|
include?: ("file_search_call.results" | "message.output_text.logprobs" | "reasoning.encrypted_content")[] | null | undefined;
|
|
@@ -375,6 +375,7 @@ declare const openaiResponsesProviderOptionsSchema: _ai_sdk_provider_utils.LazyV
|
|
|
375
375
|
} | undefined;
|
|
376
376
|
promptCacheRetention?: "in_memory" | "24h" | null | undefined;
|
|
377
377
|
reasoningEffort?: string | null | undefined;
|
|
378
|
+
reasoningEffortUpdate?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
|
|
378
379
|
reasoningMode?: "standard" | "pro" | undefined;
|
|
379
380
|
reasoningContext?: "auto" | "current_turn" | "all_turns" | undefined;
|
|
380
381
|
reasoningSummary?: string | null | undefined;
|
package/dist/index.js
CHANGED
|
@@ -59,14 +59,17 @@ function getOpenAILanguageModelCapabilities(modelId) {
|
|
|
59
59
|
const gptVersion = getGptVersion(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
|
+
const isGpt6OrLaterModel = gptVersion != null && gptVersion.major >= 6;
|
|
62
63
|
const supportsFlexProcessing = oSeriesVersion != null && oSeriesVersion >= 3 || gptVersion != null && gptVersion.major >= 5 && !isGptChatModel;
|
|
63
64
|
const supportsPriorityProcessing = modelId.startsWith("gpt-4") || gptVersion != null && gptVersion.major >= 5 && !isGptNanoModel && !isGptChatModel || oSeriesVersion != null && oSeriesVersion >= 3;
|
|
64
65
|
const isReasoningModel = oSeriesVersion != null || gptVersion != null && gptVersion.major >= 5 && !isGptChatModel || modelId === "codex-mini-latest" || modelId === "computer-use-preview";
|
|
65
|
-
const supportsNonReasoningParameters = gptVersion != null && (gptVersion.major > 5 || gptVersion.major === 5 && ((_e = gptVersion.minor) != null ? _e : 0) >= 1);
|
|
66
|
+
const supportsNonReasoningParameters = !isGpt6OrLaterModel && gptVersion != null && (gptVersion.major > 5 || gptVersion.major === 5 && ((_e = gptVersion.minor) != null ? _e : 0) >= 1);
|
|
66
67
|
const systemMessageMode = isReasoningModel ? "developer" : "system";
|
|
67
68
|
return {
|
|
68
69
|
supportsFlexProcessing,
|
|
69
70
|
supportsPriorityProcessing,
|
|
71
|
+
supportsConfigurationUpdate: isGpt6OrLaterModel,
|
|
72
|
+
supportedReasoningEfforts: isGpt6OrLaterModel ? ["low", "medium", "high", "xhigh", "max"] : void 0,
|
|
70
73
|
isReasoningModel,
|
|
71
74
|
systemMessageMode,
|
|
72
75
|
supportsNonReasoningParameters
|
|
@@ -751,6 +754,17 @@ var OpenAIChatLanguageModel = class {
|
|
|
751
754
|
);
|
|
752
755
|
warnings.push(...messageWarnings);
|
|
753
756
|
const strictJsonSchema = (_c = openaiOptions.strictJsonSchema) != null ? _c : false;
|
|
757
|
+
let resolvedReasoningEffort = openaiOptions.reasoningEffort;
|
|
758
|
+
if (resolvedReasoningEffort != null && modelCapabilities.supportedReasoningEfforts != null && !modelCapabilities.supportedReasoningEfforts.includes(
|
|
759
|
+
resolvedReasoningEffort
|
|
760
|
+
)) {
|
|
761
|
+
warnings.push({
|
|
762
|
+
type: "unsupported-setting",
|
|
763
|
+
setting: "reasoningEffort",
|
|
764
|
+
details: `${this.modelId} only supports the following reasoning efforts: ${modelCapabilities.supportedReasoningEfforts.join(", ")}`
|
|
765
|
+
});
|
|
766
|
+
resolvedReasoningEffort = void 0;
|
|
767
|
+
}
|
|
754
768
|
const baseArgs = {
|
|
755
769
|
// model id:
|
|
756
770
|
model: this.modelId,
|
|
@@ -784,7 +798,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
784
798
|
store: openaiOptions.store,
|
|
785
799
|
metadata: openaiOptions.metadata,
|
|
786
800
|
prediction: openaiOptions.prediction,
|
|
787
|
-
reasoning_effort:
|
|
801
|
+
reasoning_effort: resolvedReasoningEffort,
|
|
788
802
|
service_tier: openaiOptions.serviceTier,
|
|
789
803
|
prompt_cache_key: openaiOptions.promptCacheKey,
|
|
790
804
|
prompt_cache_options: openaiOptions.promptCacheOptions,
|
|
@@ -793,6 +807,14 @@ var OpenAIChatLanguageModel = class {
|
|
|
793
807
|
// messages:
|
|
794
808
|
messages
|
|
795
809
|
};
|
|
810
|
+
if (modelCapabilities.supportedReasoningEfforts != null && baseArgs.prompt_cache_retention != null) {
|
|
811
|
+
baseArgs.prompt_cache_retention = void 0;
|
|
812
|
+
warnings.push({
|
|
813
|
+
type: "unsupported-setting",
|
|
814
|
+
setting: "promptCacheRetention",
|
|
815
|
+
details: "promptCacheRetention is not supported by GPT-6 and later models; use promptCacheOptions instead"
|
|
816
|
+
});
|
|
817
|
+
}
|
|
796
818
|
if (modelCapabilities.isReasoningModel) {
|
|
797
819
|
if (openaiOptions.reasoningEffort !== "none" || !modelCapabilities.supportsNonReasoningParameters) {
|
|
798
820
|
if (baseArgs.temperature != null) {
|
|
@@ -3243,7 +3265,8 @@ var openaiResponsesReasoningModelIds = [
|
|
|
3243
3265
|
"gpt-5.6",
|
|
3244
3266
|
"gpt-5.6-luna",
|
|
3245
3267
|
"gpt-5.6-sol",
|
|
3246
|
-
"gpt-5.6-terra"
|
|
3268
|
+
"gpt-5.6-terra",
|
|
3269
|
+
"gpt-6-astra"
|
|
3247
3270
|
];
|
|
3248
3271
|
var openaiResponsesModelIds = [
|
|
3249
3272
|
"gpt-4.1",
|
|
@@ -3344,6 +3367,15 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils23.lazyValid
|
|
|
3344
3367
|
* Supported values vary by model.
|
|
3345
3368
|
*/
|
|
3346
3369
|
reasoningEffort: import_v418.z.string().nullish(),
|
|
3370
|
+
/**
|
|
3371
|
+
* Updates the reasoning effort for GPT-6 and later models starting with this response
|
|
3372
|
+
* without changing the request-level reasoning effort. This preserves the
|
|
3373
|
+
* request prefix for prompt caching.
|
|
3374
|
+
*
|
|
3375
|
+
* Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be
|
|
3376
|
+
* combined with automatic truncation.
|
|
3377
|
+
*/
|
|
3378
|
+
reasoningEffortUpdate: import_v418.z.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
3347
3379
|
/**
|
|
3348
3380
|
* Controls how much model work GPT-5.6 performs before returning a final answer.
|
|
3349
3381
|
* `standard` is the default. `pro` increases quality, latency, and token usage.
|
|
@@ -3540,7 +3572,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3540
3572
|
toolChoice,
|
|
3541
3573
|
responseFormat
|
|
3542
3574
|
}) {
|
|
3543
|
-
var _a2, _b, _c, _d;
|
|
3575
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
3544
3576
|
const warnings = [];
|
|
3545
3577
|
const modelCapabilities = getOpenAILanguageModelCapabilities(this.modelId);
|
|
3546
3578
|
if (topK != null) {
|
|
@@ -3584,6 +3616,31 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3584
3616
|
hasLocalShellTool: hasOpenAITool("openai.local_shell")
|
|
3585
3617
|
});
|
|
3586
3618
|
warnings.push(...inputWarnings);
|
|
3619
|
+
let resolvedReasoningEffort = openaiOptions == null ? void 0 : openaiOptions.reasoningEffort;
|
|
3620
|
+
if (resolvedReasoningEffort != null && modelCapabilities.supportedReasoningEfforts != null && !modelCapabilities.supportedReasoningEfforts.includes(
|
|
3621
|
+
resolvedReasoningEffort
|
|
3622
|
+
)) {
|
|
3623
|
+
warnings.push({
|
|
3624
|
+
type: "unsupported-setting",
|
|
3625
|
+
setting: "reasoningEffort",
|
|
3626
|
+
details: `${this.modelId} only supports the following reasoning efforts: ${modelCapabilities.supportedReasoningEfforts.join(", ")}`
|
|
3627
|
+
});
|
|
3628
|
+
resolvedReasoningEffort = void 0;
|
|
3629
|
+
}
|
|
3630
|
+
const reasoningEffortUpdate = openaiOptions == null ? void 0 : openaiOptions.reasoningEffortUpdate;
|
|
3631
|
+
const configurationUpdateIsSupported = reasoningEffortUpdate == null || modelCapabilities.supportsConfigurationUpdate && (openaiOptions == null ? void 0 : openaiOptions.reasoningMode) !== "pro" && (openaiOptions == null ? void 0 : openaiOptions.truncation) !== "auto";
|
|
3632
|
+
if (reasoningEffortUpdate != null && !configurationUpdateIsSupported) {
|
|
3633
|
+
warnings.push({
|
|
3634
|
+
type: "unsupported-setting",
|
|
3635
|
+
setting: "reasoningEffortUpdate",
|
|
3636
|
+
details: !modelCapabilities.supportsConfigurationUpdate ? "reasoningEffortUpdate is only supported by GPT-6 and later models" : "reasoningEffortUpdate requires standard reasoning mode without automatic truncation"
|
|
3637
|
+
});
|
|
3638
|
+
} else if (reasoningEffortUpdate != null) {
|
|
3639
|
+
input.unshift({
|
|
3640
|
+
type: "configuration_update",
|
|
3641
|
+
reasoning: { effort: reasoningEffortUpdate }
|
|
3642
|
+
});
|
|
3643
|
+
}
|
|
3587
3644
|
const strictJsonSchema = (_b = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _b : false;
|
|
3588
3645
|
let include = openaiOptions == null ? void 0 : openaiOptions.include;
|
|
3589
3646
|
function addInclude(key) {
|
|
@@ -3655,10 +3712,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3655
3712
|
top_logprobs: topLogprobs,
|
|
3656
3713
|
truncation: openaiOptions == null ? void 0 : openaiOptions.truncation,
|
|
3657
3714
|
// model-specific settings:
|
|
3658
|
-
...modelCapabilities.isReasoningModel && (
|
|
3715
|
+
...modelCapabilities.isReasoningModel && (resolvedReasoningEffort != null || (openaiOptions == null ? void 0 : openaiOptions.reasoningSummary) != null || (openaiOptions == null ? void 0 : openaiOptions.reasoningMode) != null || (openaiOptions == null ? void 0 : openaiOptions.reasoningContext) != null) && {
|
|
3659
3716
|
reasoning: {
|
|
3660
|
-
...
|
|
3661
|
-
effort:
|
|
3717
|
+
...resolvedReasoningEffort != null && {
|
|
3718
|
+
effort: resolvedReasoningEffort
|
|
3662
3719
|
},
|
|
3663
3720
|
...(openaiOptions == null ? void 0 : openaiOptions.reasoningSummary) != null && {
|
|
3664
3721
|
summary: openaiOptions.reasoningSummary
|
|
@@ -3672,6 +3729,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3672
3729
|
}
|
|
3673
3730
|
}
|
|
3674
3731
|
};
|
|
3732
|
+
if (modelCapabilities.supportsConfigurationUpdate && baseArgs.prompt_cache_retention != null) {
|
|
3733
|
+
baseArgs.prompt_cache_retention = void 0;
|
|
3734
|
+
warnings.push({
|
|
3735
|
+
type: "unsupported-setting",
|
|
3736
|
+
setting: "promptCacheRetention",
|
|
3737
|
+
details: "promptCacheRetention is not supported by GPT-6 and later models; use promptCacheOptions instead"
|
|
3738
|
+
});
|
|
3739
|
+
}
|
|
3675
3740
|
if (modelCapabilities.isReasoningModel) {
|
|
3676
3741
|
if (!((openaiOptions == null ? void 0 : openaiOptions.reasoningEffort) === "none" && modelCapabilities.supportsNonReasoningParameters)) {
|
|
3677
3742
|
if (baseArgs.temperature != null) {
|
|
@@ -3690,6 +3755,18 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3690
3755
|
details: "topP is not supported for reasoning models"
|
|
3691
3756
|
});
|
|
3692
3757
|
}
|
|
3758
|
+
if (modelCapabilities.supportedReasoningEfforts != null && (baseArgs.top_logprobs != null || ((_e = baseArgs.include) == null ? void 0 : _e.includes("message.output_text.logprobs")))) {
|
|
3759
|
+
baseArgs.top_logprobs = void 0;
|
|
3760
|
+
const filteredInclude = (_f = baseArgs.include) == null ? void 0 : _f.filter(
|
|
3761
|
+
(value) => value !== "message.output_text.logprobs"
|
|
3762
|
+
);
|
|
3763
|
+
baseArgs.include = filteredInclude != null && filteredInclude.length > 0 ? filteredInclude : void 0;
|
|
3764
|
+
warnings.push({
|
|
3765
|
+
type: "unsupported-setting",
|
|
3766
|
+
setting: "logprobs",
|
|
3767
|
+
details: "logprobs is not supported for reasoning models"
|
|
3768
|
+
});
|
|
3769
|
+
}
|
|
3693
3770
|
}
|
|
3694
3771
|
} else {
|
|
3695
3772
|
if ((openaiOptions == null ? void 0 : openaiOptions.reasoningEffort) != null) {
|
|
@@ -5010,7 +5087,7 @@ var OpenAITranscriptionModel = class {
|
|
|
5010
5087
|
};
|
|
5011
5088
|
|
|
5012
5089
|
// src/version.ts
|
|
5013
|
-
var VERSION = true ? "2.0.
|
|
5090
|
+
var VERSION = true ? "2.0.125" : "0.0.0-test";
|
|
5014
5091
|
|
|
5015
5092
|
// src/openai-provider.ts
|
|
5016
5093
|
function createOpenAI(options = {}) {
|