@ai-sdk/openai 2.0.83 → 2.0.85
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 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +15 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -8
- 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 +14 -7
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +14 -7
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -2,7 +2,7 @@ import { LanguageModelV2, EmbeddingModelV2, ImageModelV2, TranscriptionModelV2Ca
|
|
|
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' | (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' | (string & {});
|
|
6
6
|
declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.LazyValidator<{
|
|
7
7
|
logitBias?: Record<number, number> | undefined;
|
|
8
8
|
logprobs?: number | boolean | undefined;
|
|
@@ -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-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-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";
|
|
@@ -491,7 +491,7 @@ declare const webSearchPreviewInputSchema: _ai_sdk_provider_utils.LazySchema<Rec
|
|
|
491
491
|
declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
|
|
492
492
|
/**
|
|
493
493
|
* An object describing the specific action taken in this web search call.
|
|
494
|
-
* Includes details on how the model used the web (search, open_page,
|
|
494
|
+
* Includes details on how the model used the web (search, open_page, findInPage).
|
|
495
495
|
*/
|
|
496
496
|
action: {
|
|
497
497
|
/**
|
|
@@ -513,9 +513,9 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactor
|
|
|
513
513
|
url?: string | null;
|
|
514
514
|
} | {
|
|
515
515
|
/**
|
|
516
|
-
* Action type "
|
|
516
|
+
* Action type "findInPage": Searches for a pattern within a loaded page.
|
|
517
517
|
*/
|
|
518
|
-
type: "
|
|
518
|
+
type: "findInPage";
|
|
519
519
|
/**
|
|
520
520
|
* The URL of the page searched for the pattern.
|
|
521
521
|
*/
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { LanguageModelV2, EmbeddingModelV2, ImageModelV2, TranscriptionModelV2Ca
|
|
|
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' | (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' | (string & {});
|
|
6
6
|
declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.LazyValidator<{
|
|
7
7
|
logitBias?: Record<number, number> | undefined;
|
|
8
8
|
logprobs?: number | boolean | undefined;
|
|
@@ -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-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-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";
|
|
@@ -491,7 +491,7 @@ declare const webSearchPreviewInputSchema: _ai_sdk_provider_utils.LazySchema<Rec
|
|
|
491
491
|
declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
|
|
492
492
|
/**
|
|
493
493
|
* An object describing the specific action taken in this web search call.
|
|
494
|
-
* Includes details on how the model used the web (search, open_page,
|
|
494
|
+
* Includes details on how the model used the web (search, open_page, findInPage).
|
|
495
495
|
*/
|
|
496
496
|
action: {
|
|
497
497
|
/**
|
|
@@ -513,9 +513,9 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactor
|
|
|
513
513
|
url?: string | null;
|
|
514
514
|
} | {
|
|
515
515
|
/**
|
|
516
|
-
* Action type "
|
|
516
|
+
* Action type "findInPage": Searches for a pattern within a loaded page.
|
|
517
517
|
*/
|
|
518
|
-
type: "
|
|
518
|
+
type: "findInPage";
|
|
519
519
|
/**
|
|
520
520
|
* The URL of the page searched for the pattern.
|
|
521
521
|
*/
|
package/dist/internal/index.js
CHANGED
|
@@ -2617,7 +2617,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils21.lazyValidator)(
|
|
|
2617
2617
|
url: import_v414.z.string().nullish()
|
|
2618
2618
|
}),
|
|
2619
2619
|
import_v414.z.object({
|
|
2620
|
-
type: import_v414.z.literal("
|
|
2620
|
+
type: import_v414.z.literal("find_in_page"),
|
|
2621
2621
|
url: import_v414.z.string().nullish(),
|
|
2622
2622
|
pattern: import_v414.z.string().nullish()
|
|
2623
2623
|
})
|
|
@@ -2827,7 +2827,7 @@ var openaiResponsesResponseSchema = (0, import_provider_utils21.lazyValidator)(
|
|
|
2827
2827
|
url: import_v414.z.string().nullish()
|
|
2828
2828
|
}),
|
|
2829
2829
|
import_v414.z.object({
|
|
2830
|
-
type: import_v414.z.literal("
|
|
2830
|
+
type: import_v414.z.literal("find_in_page"),
|
|
2831
2831
|
url: import_v414.z.string().nullish(),
|
|
2832
2832
|
pattern: import_v414.z.string().nullish()
|
|
2833
2833
|
})
|
|
@@ -2949,7 +2949,10 @@ var openaiResponsesReasoningModelIds = [
|
|
|
2949
2949
|
"gpt-5.1-chat-latest",
|
|
2950
2950
|
"gpt-5.1-codex-mini",
|
|
2951
2951
|
"gpt-5.1-codex",
|
|
2952
|
-
"gpt-5.1-codex-max"
|
|
2952
|
+
"gpt-5.1-codex-max",
|
|
2953
|
+
"gpt-5.2",
|
|
2954
|
+
"gpt-5.2-chat-latest",
|
|
2955
|
+
"gpt-5.2-pro"
|
|
2953
2956
|
];
|
|
2954
2957
|
var openaiResponsesModelIds = [
|
|
2955
2958
|
"gpt-4.1",
|
|
@@ -3186,7 +3189,7 @@ var webSearchOutputSchema = (0, import_provider_utils25.lazySchema)(
|
|
|
3186
3189
|
url: import_v418.z.string().nullish()
|
|
3187
3190
|
}),
|
|
3188
3191
|
import_v418.z.object({
|
|
3189
|
-
type: import_v418.z.literal("
|
|
3192
|
+
type: import_v418.z.literal("findInPage"),
|
|
3190
3193
|
url: import_v418.z.string().nullish(),
|
|
3191
3194
|
pattern: import_v418.z.string().nullish()
|
|
3192
3195
|
})
|
|
@@ -3240,7 +3243,7 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils26.lazySchema)(
|
|
|
3240
3243
|
url: import_v419.z.string().nullish()
|
|
3241
3244
|
}),
|
|
3242
3245
|
import_v419.z.object({
|
|
3243
|
-
type: import_v419.z.literal("
|
|
3246
|
+
type: import_v419.z.literal("findInPage"),
|
|
3244
3247
|
url: import_v419.z.string().nullish(),
|
|
3245
3248
|
pattern: import_v419.z.string().nullish()
|
|
3246
3249
|
})
|
|
@@ -4496,9 +4499,13 @@ function mapWebSearchOutput(action) {
|
|
|
4496
4499
|
};
|
|
4497
4500
|
case "open_page":
|
|
4498
4501
|
return { action: { type: "openPage", url: action.url } };
|
|
4499
|
-
case "
|
|
4502
|
+
case "find_in_page":
|
|
4500
4503
|
return {
|
|
4501
|
-
action: {
|
|
4504
|
+
action: {
|
|
4505
|
+
type: "findInPage",
|
|
4506
|
+
url: action.url,
|
|
4507
|
+
pattern: action.pattern
|
|
4508
|
+
}
|
|
4502
4509
|
};
|
|
4503
4510
|
}
|
|
4504
4511
|
}
|