@ai-sdk/openai 4.0.0-beta.7 → 4.0.0-beta.74
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 +636 -24
- package/README.md +2 -0
- package/dist/index.d.ts +240 -44
- package/dist/index.js +3345 -1683
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +390 -36
- package/dist/internal/index.js +2707 -1706
- package/dist/internal/index.js.map +1 -1
- package/docs/03-openai.mdx +413 -39
- package/package.json +16 -17
- package/src/chat/convert-openai-chat-usage.ts +1 -1
- package/src/chat/convert-to-openai-chat-messages.ts +96 -68
- package/src/chat/map-openai-finish-reason.ts +1 -1
- package/src/chat/openai-chat-api.ts +6 -2
- package/src/chat/{openai-chat-options.ts → openai-chat-language-model-options.ts} +11 -1
- package/src/chat/openai-chat-language-model.ts +82 -148
- package/src/chat/openai-chat-prepare-tools.ts +3 -3
- package/src/completion/convert-openai-completion-usage.ts +1 -1
- package/src/completion/convert-to-openai-completion-prompt.ts +1 -2
- package/src/completion/map-openai-finish-reason.ts +1 -1
- package/src/completion/openai-completion-api.ts +5 -2
- package/src/completion/{openai-completion-options.ts → openai-completion-language-model-options.ts} +5 -1
- package/src/completion/openai-completion-language-model.ts +53 -17
- package/src/embedding/{openai-embedding-options.ts → openai-embedding-model-options.ts} +5 -1
- package/src/embedding/openai-embedding-model.ts +22 -5
- package/src/files/openai-files-api.ts +17 -0
- package/src/files/openai-files-options.ts +22 -0
- package/src/files/openai-files.ts +100 -0
- package/src/image/openai-image-model-options.ts +123 -0
- package/src/image/openai-image-model.ts +62 -83
- package/src/index.ts +15 -6
- package/src/internal/index.ts +7 -6
- package/src/openai-config.ts +7 -7
- package/src/openai-language-model-capabilities.ts +5 -4
- package/src/openai-provider.ts +80 -9
- package/src/openai-stream-error.ts +181 -0
- package/src/openai-tools.ts +12 -1
- package/src/realtime/index.ts +2 -0
- package/src/realtime/openai-realtime-event-mapper.ts +436 -0
- package/src/realtime/openai-realtime-model-options.ts +3 -0
- package/src/realtime/openai-realtime-model.ts +111 -0
- package/src/responses/convert-openai-responses-usage.ts +1 -1
- package/src/responses/convert-to-openai-responses-input.ts +345 -90
- package/src/responses/map-openai-responses-finish-reason.ts +1 -1
- package/src/responses/openai-responses-api.ts +186 -17
- package/src/responses/{openai-responses-options.ts → openai-responses-language-model-options.ts} +55 -1
- package/src/responses/openai-responses-language-model.ts +330 -52
- package/src/responses/openai-responses-prepare-tools.ts +129 -18
- package/src/responses/openai-responses-provider-metadata.ts +12 -2
- package/src/skills/openai-skills-api.ts +31 -0
- package/src/skills/openai-skills.ts +83 -0
- package/src/speech/{openai-speech-options.ts → openai-speech-model-options.ts} +5 -1
- package/src/speech/openai-speech-model.ts +23 -7
- package/src/tool/apply-patch.ts +33 -32
- package/src/tool/code-interpreter.ts +40 -41
- package/src/tool/custom.ts +2 -8
- package/src/tool/file-search.ts +3 -3
- package/src/tool/image-generation.ts +2 -2
- package/src/tool/local-shell.ts +2 -2
- package/src/tool/mcp.ts +3 -3
- package/src/tool/shell.ts +9 -4
- package/src/tool/tool-search.ts +98 -0
- package/src/tool/web-search-preview.ts +2 -2
- package/src/tool/web-search.ts +10 -2
- package/src/transcription/{openai-transcription-options.ts → openai-transcription-model-options.ts} +5 -1
- package/src/transcription/openai-transcription-model.ts +35 -13
- package/dist/index.d.mts +0 -1107
- package/dist/index.mjs +0 -6509
- package/dist/index.mjs.map +0 -1
- package/dist/internal/index.d.mts +0 -1137
- package/dist/internal/index.mjs +0 -6322
- package/dist/internal/index.mjs.map +0 -1
- package/src/image/openai-image-options.ts +0 -31
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _ai_sdk_provider from '@ai-sdk/provider';
|
|
2
|
+
import { LanguageModelV4, LanguageModelV4CallOptions, LanguageModelV4GenerateResult, LanguageModelV4StreamResult, EmbeddingModelV4, ImageModelV4, TranscriptionModelV4CallOptions, TranscriptionModelV4, SpeechModelV4, JSONValue } from '@ai-sdk/provider';
|
|
2
3
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
3
|
-
import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
|
+
import { InferSchema, WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE, FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
5
|
|
|
5
|
-
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-pro' | 'gpt-5.4-pro-2026-03-05' | (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' | (string & {});
|
|
6
7
|
declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
7
8
|
logitBias?: Record<number, number> | undefined;
|
|
8
9
|
logprobs?: number | boolean | undefined;
|
|
@@ -26,7 +27,7 @@ type OpenAILanguageModelChatOptions = InferSchema<typeof openaiLanguageModelChat
|
|
|
26
27
|
|
|
27
28
|
type OpenAIChatConfig = {
|
|
28
29
|
provider: string;
|
|
29
|
-
headers
|
|
30
|
+
headers?: () => Record<string, string | undefined>;
|
|
30
31
|
url: (options: {
|
|
31
32
|
modelId: string;
|
|
32
33
|
path: string;
|
|
@@ -40,6 +41,14 @@ declare class OpenAIChatLanguageModel implements LanguageModelV4 {
|
|
|
40
41
|
'image/*': RegExp[];
|
|
41
42
|
};
|
|
42
43
|
private readonly config;
|
|
44
|
+
static [WORKFLOW_SERIALIZE](model: OpenAIChatLanguageModel): {
|
|
45
|
+
modelId: string;
|
|
46
|
+
config: _ai_sdk_provider.JSONObject;
|
|
47
|
+
};
|
|
48
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
49
|
+
modelId: OpenAIChatModelId;
|
|
50
|
+
config: OpenAIChatConfig;
|
|
51
|
+
}): OpenAIChatLanguageModel;
|
|
43
52
|
constructor(modelId: OpenAIChatModelId, config: OpenAIChatConfig);
|
|
44
53
|
get provider(): string;
|
|
45
54
|
private getArgs;
|
|
@@ -59,7 +68,7 @@ type OpenAILanguageModelCompletionOptions = InferSchema<typeof openaiLanguageMod
|
|
|
59
68
|
|
|
60
69
|
type OpenAICompletionConfig = {
|
|
61
70
|
provider: string;
|
|
62
|
-
headers
|
|
71
|
+
headers?: () => Record<string, string | undefined>;
|
|
63
72
|
url: (options: {
|
|
64
73
|
modelId: string;
|
|
65
74
|
path: string;
|
|
@@ -71,6 +80,14 @@ declare class OpenAICompletionLanguageModel implements LanguageModelV4 {
|
|
|
71
80
|
readonly modelId: OpenAICompletionModelId;
|
|
72
81
|
private readonly config;
|
|
73
82
|
private get providerOptionsName();
|
|
83
|
+
static [WORKFLOW_SERIALIZE](model: OpenAICompletionLanguageModel): {
|
|
84
|
+
modelId: string;
|
|
85
|
+
config: _ai_sdk_provider.JSONObject;
|
|
86
|
+
};
|
|
87
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
88
|
+
modelId: OpenAICompletionModelId;
|
|
89
|
+
config: OpenAICompletionConfig;
|
|
90
|
+
}): OpenAICompletionLanguageModel;
|
|
74
91
|
constructor(modelId: OpenAICompletionModelId, config: OpenAICompletionConfig);
|
|
75
92
|
get provider(): string;
|
|
76
93
|
readonly supportedUrls: Record<string, RegExp[]>;
|
|
@@ -85,16 +102,16 @@ type OpenAIConfig = {
|
|
|
85
102
|
modelId: string;
|
|
86
103
|
path: string;
|
|
87
104
|
}) => string;
|
|
88
|
-
headers
|
|
105
|
+
headers?: () => Record<string, string | undefined>;
|
|
89
106
|
fetch?: FetchFunction;
|
|
90
107
|
generateId?: () => string;
|
|
91
108
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
109
|
+
* This is soft-deprecated. Use provider references (e.g. `{ openai: 'file-abc123' }`)
|
|
110
|
+
* in file part data instead. File ID prefixes used to identify file IDs
|
|
111
|
+
* in Responses API. When undefined, all string file data is treated as
|
|
112
|
+
* base64 content.
|
|
94
113
|
*
|
|
95
|
-
*
|
|
96
|
-
* - OpenAI: ['file-'] for IDs like 'file-abc123'
|
|
97
|
-
* - Azure OpenAI: ['assistant-'] for IDs like 'assistant-abc123'
|
|
114
|
+
* TODO: remove in v8
|
|
98
115
|
*/
|
|
99
116
|
fileIdPrefixes?: readonly string[];
|
|
100
117
|
};
|
|
@@ -112,14 +129,49 @@ declare class OpenAIEmbeddingModel implements EmbeddingModelV4 {
|
|
|
112
129
|
readonly maxEmbeddingsPerCall = 2048;
|
|
113
130
|
readonly supportsParallelCalls = true;
|
|
114
131
|
private readonly config;
|
|
132
|
+
static [WORKFLOW_SERIALIZE](model: OpenAIEmbeddingModel): {
|
|
133
|
+
modelId: string;
|
|
134
|
+
config: _ai_sdk_provider.JSONObject;
|
|
135
|
+
};
|
|
136
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
137
|
+
modelId: OpenAIEmbeddingModelId;
|
|
138
|
+
config: OpenAIConfig;
|
|
139
|
+
}): OpenAIEmbeddingModel;
|
|
115
140
|
get provider(): string;
|
|
116
141
|
constructor(modelId: OpenAIEmbeddingModelId, config: OpenAIConfig);
|
|
117
142
|
doEmbed({ values, headers, abortSignal, providerOptions, }: Parameters<EmbeddingModelV4['doEmbed']>[0]): Promise<Awaited<ReturnType<EmbeddingModelV4['doEmbed']>>>;
|
|
118
143
|
}
|
|
119
144
|
|
|
120
|
-
type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1-mini' | 'gpt-image-1.5' | 'chatgpt-image-latest' | (string & {});
|
|
145
|
+
type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1-mini' | 'gpt-image-1.5' | 'gpt-image-2' | 'chatgpt-image-latest' | (string & {});
|
|
121
146
|
declare const modelMaxImagesPerCall: Record<OpenAIImageModelId, number>;
|
|
122
147
|
declare function hasDefaultResponseFormat(modelId: string): boolean;
|
|
148
|
+
declare const openaiImageModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
149
|
+
quality?: "auto" | "low" | "medium" | "high" | "standard" | "hd" | undefined;
|
|
150
|
+
background?: "auto" | "transparent" | "opaque" | undefined;
|
|
151
|
+
outputFormat?: "png" | "jpeg" | "webp" | undefined;
|
|
152
|
+
outputCompression?: number | undefined;
|
|
153
|
+
user?: string | undefined;
|
|
154
|
+
}>;
|
|
155
|
+
type OpenAIImageModelOptions = InferSchema<typeof openaiImageModelOptions>;
|
|
156
|
+
declare const openaiImageModelGenerationOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
157
|
+
quality?: "auto" | "low" | "medium" | "high" | "standard" | "hd" | undefined;
|
|
158
|
+
background?: "auto" | "transparent" | "opaque" | undefined;
|
|
159
|
+
outputFormat?: "png" | "jpeg" | "webp" | undefined;
|
|
160
|
+
outputCompression?: number | undefined;
|
|
161
|
+
user?: string | undefined;
|
|
162
|
+
style?: "vivid" | "natural" | undefined;
|
|
163
|
+
moderation?: "auto" | "low" | undefined;
|
|
164
|
+
}>;
|
|
165
|
+
type OpenAIImageModelGenerationOptions = InferSchema<typeof openaiImageModelGenerationOptions>;
|
|
166
|
+
declare const openaiImageModelEditOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
167
|
+
quality?: "auto" | "low" | "medium" | "high" | "standard" | "hd" | undefined;
|
|
168
|
+
background?: "auto" | "transparent" | "opaque" | undefined;
|
|
169
|
+
outputFormat?: "png" | "jpeg" | "webp" | undefined;
|
|
170
|
+
outputCompression?: number | undefined;
|
|
171
|
+
user?: string | undefined;
|
|
172
|
+
inputFidelity?: "low" | "high" | undefined;
|
|
173
|
+
}>;
|
|
174
|
+
type OpenAIImageModelEditOptions = InferSchema<typeof openaiImageModelEditOptions>;
|
|
123
175
|
|
|
124
176
|
interface OpenAIImageModelConfig extends OpenAIConfig {
|
|
125
177
|
_internal?: {
|
|
@@ -130,6 +182,14 @@ declare class OpenAIImageModel implements ImageModelV4 {
|
|
|
130
182
|
readonly modelId: OpenAIImageModelId;
|
|
131
183
|
private readonly config;
|
|
132
184
|
readonly specificationVersion = "v4";
|
|
185
|
+
static [WORKFLOW_SERIALIZE](model: OpenAIImageModel): {
|
|
186
|
+
modelId: string;
|
|
187
|
+
config: _ai_sdk_provider.JSONObject;
|
|
188
|
+
};
|
|
189
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
190
|
+
modelId: OpenAIImageModelId;
|
|
191
|
+
config: OpenAIImageModelConfig;
|
|
192
|
+
}): OpenAIImageModel;
|
|
133
193
|
get maxImagesPerCall(): number;
|
|
134
194
|
get provider(): string;
|
|
135
195
|
constructor(modelId: OpenAIImageModelId, config: OpenAIImageModelConfig);
|
|
@@ -160,6 +220,14 @@ declare class OpenAITranscriptionModel implements TranscriptionModelV4 {
|
|
|
160
220
|
readonly modelId: OpenAITranscriptionModelId;
|
|
161
221
|
private readonly config;
|
|
162
222
|
readonly specificationVersion = "v4";
|
|
223
|
+
static [WORKFLOW_SERIALIZE](model: OpenAITranscriptionModel): {
|
|
224
|
+
modelId: string;
|
|
225
|
+
config: _ai_sdk_provider.JSONObject;
|
|
226
|
+
};
|
|
227
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
228
|
+
modelId: OpenAITranscriptionModelId;
|
|
229
|
+
config: OpenAITranscriptionModelConfig;
|
|
230
|
+
}): OpenAITranscriptionModel;
|
|
163
231
|
get provider(): string;
|
|
164
232
|
constructor(modelId: OpenAITranscriptionModelId, config: OpenAITranscriptionModelConfig);
|
|
165
233
|
private getArgs;
|
|
@@ -182,18 +250,34 @@ declare class OpenAISpeechModel implements SpeechModelV4 {
|
|
|
182
250
|
readonly modelId: OpenAISpeechModelId;
|
|
183
251
|
private readonly config;
|
|
184
252
|
readonly specificationVersion = "v4";
|
|
253
|
+
static [WORKFLOW_SERIALIZE](model: OpenAISpeechModel): {
|
|
254
|
+
modelId: string;
|
|
255
|
+
config: _ai_sdk_provider.JSONObject;
|
|
256
|
+
};
|
|
257
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
258
|
+
modelId: OpenAISpeechModelId;
|
|
259
|
+
config: OpenAISpeechModelConfig;
|
|
260
|
+
}): OpenAISpeechModel;
|
|
185
261
|
get provider(): string;
|
|
186
262
|
constructor(modelId: OpenAISpeechModelId, config: OpenAISpeechModelConfig);
|
|
187
263
|
private getArgs;
|
|
188
264
|
doGenerate(options: Parameters<SpeechModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV4['doGenerate']>>>;
|
|
189
265
|
}
|
|
190
266
|
|
|
191
|
-
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-pro' | 'gpt-5.4-pro-2026-03-05' | '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 & {});
|
|
267
|
+
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-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 & {});
|
|
192
268
|
|
|
193
269
|
declare class OpenAIResponsesLanguageModel implements LanguageModelV4 {
|
|
194
270
|
readonly specificationVersion = "v4";
|
|
195
271
|
readonly modelId: OpenAIResponsesModelId;
|
|
196
272
|
private readonly config;
|
|
273
|
+
static [WORKFLOW_SERIALIZE](model: OpenAIResponsesLanguageModel): {
|
|
274
|
+
modelId: string;
|
|
275
|
+
config: _ai_sdk_provider.JSONObject;
|
|
276
|
+
};
|
|
277
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
278
|
+
modelId: OpenAIResponsesModelId;
|
|
279
|
+
config: OpenAIConfig;
|
|
280
|
+
}): OpenAIResponsesLanguageModel;
|
|
197
281
|
constructor(modelId: OpenAIResponsesModelId, config: OpenAIConfig);
|
|
198
282
|
readonly supportedUrls: Record<string, RegExp[]>;
|
|
199
283
|
get provider(): string;
|
|
@@ -235,6 +319,21 @@ type OpenAIResponsesFileSearchToolCompoundFilter = {
|
|
|
235
319
|
declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
236
320
|
type: "unknown_chunk";
|
|
237
321
|
message: string;
|
|
322
|
+
} | {
|
|
323
|
+
type: "error";
|
|
324
|
+
sequence_number: number;
|
|
325
|
+
error: {
|
|
326
|
+
type: string;
|
|
327
|
+
code: string;
|
|
328
|
+
message: string;
|
|
329
|
+
param?: string | null | undefined;
|
|
330
|
+
};
|
|
331
|
+
} | {
|
|
332
|
+
type: "error";
|
|
333
|
+
sequence_number: number;
|
|
334
|
+
message: string;
|
|
335
|
+
code?: string | null | undefined;
|
|
336
|
+
param?: string | null | undefined;
|
|
238
337
|
} | {
|
|
239
338
|
type: "response.output_text.delta";
|
|
240
339
|
item_id: string;
|
|
@@ -265,6 +364,29 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
265
364
|
} | null | undefined;
|
|
266
365
|
service_tier?: string | null | undefined;
|
|
267
366
|
};
|
|
367
|
+
} | {
|
|
368
|
+
type: "response.failed";
|
|
369
|
+
sequence_number: number;
|
|
370
|
+
response: {
|
|
371
|
+
error?: {
|
|
372
|
+
message: string;
|
|
373
|
+
code?: string | null | undefined;
|
|
374
|
+
} | null | undefined;
|
|
375
|
+
incomplete_details?: {
|
|
376
|
+
reason: string;
|
|
377
|
+
} | null | undefined;
|
|
378
|
+
usage?: {
|
|
379
|
+
input_tokens: number;
|
|
380
|
+
output_tokens: number;
|
|
381
|
+
input_tokens_details?: {
|
|
382
|
+
cached_tokens?: number | null | undefined;
|
|
383
|
+
} | null | undefined;
|
|
384
|
+
output_tokens_details?: {
|
|
385
|
+
reasoning_tokens?: number | null | undefined;
|
|
386
|
+
} | null | undefined;
|
|
387
|
+
} | null | undefined;
|
|
388
|
+
service_tier?: string | null | undefined;
|
|
389
|
+
};
|
|
268
390
|
} | {
|
|
269
391
|
type: "response.created";
|
|
270
392
|
response: {
|
|
@@ -290,6 +412,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
290
412
|
call_id: string;
|
|
291
413
|
name: string;
|
|
292
414
|
arguments: string;
|
|
415
|
+
namespace?: string | null | undefined;
|
|
293
416
|
} | {
|
|
294
417
|
type: "web_search_call";
|
|
295
418
|
id: string;
|
|
@@ -359,6 +482,10 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
359
482
|
action: {
|
|
360
483
|
commands: string[];
|
|
361
484
|
};
|
|
485
|
+
} | {
|
|
486
|
+
type: "compaction";
|
|
487
|
+
id: string;
|
|
488
|
+
encrypted_content?: string | null | undefined;
|
|
362
489
|
} | {
|
|
363
490
|
type: "shell_call_output";
|
|
364
491
|
id: string;
|
|
@@ -374,6 +501,20 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
374
501
|
exit_code: number;
|
|
375
502
|
};
|
|
376
503
|
}[];
|
|
504
|
+
} | {
|
|
505
|
+
type: "tool_search_call";
|
|
506
|
+
id: string;
|
|
507
|
+
execution: "server" | "client";
|
|
508
|
+
call_id: string | null;
|
|
509
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
510
|
+
arguments: unknown;
|
|
511
|
+
} | {
|
|
512
|
+
type: "tool_search_output";
|
|
513
|
+
id: string;
|
|
514
|
+
execution: "server" | "client";
|
|
515
|
+
call_id: string | null;
|
|
516
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
517
|
+
tools: Record<string, JSONValue | undefined>[];
|
|
377
518
|
};
|
|
378
519
|
} | {
|
|
379
520
|
type: "response.output_item.done";
|
|
@@ -393,6 +534,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
393
534
|
name: string;
|
|
394
535
|
arguments: string;
|
|
395
536
|
status: "completed";
|
|
537
|
+
namespace?: string | null | undefined;
|
|
396
538
|
} | {
|
|
397
539
|
type: "custom_tool_call";
|
|
398
540
|
id: string;
|
|
@@ -423,6 +565,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
423
565
|
action?: {
|
|
424
566
|
type: "search";
|
|
425
567
|
query?: string | null | undefined;
|
|
568
|
+
queries?: string[] | null | undefined;
|
|
426
569
|
sources?: ({
|
|
427
570
|
type: "url";
|
|
428
571
|
url: string;
|
|
@@ -528,6 +671,10 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
528
671
|
action: {
|
|
529
672
|
commands: string[];
|
|
530
673
|
};
|
|
674
|
+
} | {
|
|
675
|
+
type: "compaction";
|
|
676
|
+
id: string;
|
|
677
|
+
encrypted_content: string;
|
|
531
678
|
} | {
|
|
532
679
|
type: "shell_call_output";
|
|
533
680
|
id: string;
|
|
@@ -543,6 +690,20 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
543
690
|
exit_code: number;
|
|
544
691
|
};
|
|
545
692
|
}[];
|
|
693
|
+
} | {
|
|
694
|
+
type: "tool_search_call";
|
|
695
|
+
id: string;
|
|
696
|
+
execution: "server" | "client";
|
|
697
|
+
call_id: string | null;
|
|
698
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
699
|
+
arguments: unknown;
|
|
700
|
+
} | {
|
|
701
|
+
type: "tool_search_output";
|
|
702
|
+
id: string;
|
|
703
|
+
execution: "server" | "client";
|
|
704
|
+
call_id: string | null;
|
|
705
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
706
|
+
tools: Record<string, JSONValue | undefined>[];
|
|
546
707
|
};
|
|
547
708
|
} | {
|
|
548
709
|
type: "response.function_call_arguments.delta";
|
|
@@ -618,15 +779,6 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
618
779
|
item_id: string;
|
|
619
780
|
output_index: number;
|
|
620
781
|
diff: string;
|
|
621
|
-
} | {
|
|
622
|
-
type: "error";
|
|
623
|
-
sequence_number: number;
|
|
624
|
-
error: {
|
|
625
|
-
type: string;
|
|
626
|
-
code: string;
|
|
627
|
-
message: string;
|
|
628
|
-
param?: string | null | undefined;
|
|
629
|
-
};
|
|
630
782
|
}>;
|
|
631
783
|
type OpenAIResponsesChunk = InferSchema<typeof openaiResponsesChunkSchema>;
|
|
632
784
|
type OpenAIResponsesLogprobs = NonNullable<(OpenAIResponsesChunk & {
|
|
@@ -652,6 +804,14 @@ type OpenaiResponsesReasoningProviderMetadata = {
|
|
|
652
804
|
type OpenaiResponsesProviderMetadata = {
|
|
653
805
|
openai: ResponsesProviderMetadata;
|
|
654
806
|
};
|
|
807
|
+
type ResponsesCompactionProviderMetadata = {
|
|
808
|
+
type: 'compaction';
|
|
809
|
+
itemId: string;
|
|
810
|
+
encryptedContent?: string;
|
|
811
|
+
};
|
|
812
|
+
type OpenaiResponsesCompactionProviderMetadata = {
|
|
813
|
+
openai: ResponsesCompactionProviderMetadata;
|
|
814
|
+
};
|
|
655
815
|
type ResponsesTextProviderMetadata = {
|
|
656
816
|
itemId: string;
|
|
657
817
|
phase?: 'commentary' | 'final_answer' | null;
|
|
@@ -751,7 +911,7 @@ type ApplyPatchOperation = {
|
|
|
751
911
|
* - Returns the status of applying those patches (completed or failed)
|
|
752
912
|
*
|
|
753
913
|
*/
|
|
754
|
-
declare const applyPatchToolFactory: _ai_sdk_provider_utils.
|
|
914
|
+
declare const applyPatchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
755
915
|
/**
|
|
756
916
|
* The unique ID of the apply patch tool call generated by the model.
|
|
757
917
|
*/
|
|
@@ -772,14 +932,14 @@ declare const applyPatchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryW
|
|
|
772
932
|
* (e.g., patch results or errors).
|
|
773
933
|
*/
|
|
774
934
|
output?: string;
|
|
775
|
-
}, {}>;
|
|
935
|
+
}, {}, {}>;
|
|
776
936
|
/**
|
|
777
937
|
* The apply_patch tool lets GPT-5.1 create, update, and delete files in your
|
|
778
938
|
* codebase using structured diffs. Instead of just suggesting edits, the model
|
|
779
939
|
* emits patch operations that your application applies and then reports back on,
|
|
780
940
|
* enabling iterative, multi-step code editing workflows.
|
|
781
941
|
*/
|
|
782
|
-
declare const applyPatch: _ai_sdk_provider_utils.
|
|
942
|
+
declare const applyPatch: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
783
943
|
/**
|
|
784
944
|
* The unique ID of the apply patch tool call generated by the model.
|
|
785
945
|
*/
|
|
@@ -800,7 +960,7 @@ declare const applyPatch: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSc
|
|
|
800
960
|
* (e.g., patch results or errors).
|
|
801
961
|
*/
|
|
802
962
|
output?: string;
|
|
803
|
-
}, {}>;
|
|
963
|
+
}, {}, {}>;
|
|
804
964
|
|
|
805
965
|
declare const codeInterpreterInputSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
806
966
|
containerId: string;
|
|
@@ -830,7 +990,7 @@ type CodeInterpreterArgs = {
|
|
|
830
990
|
fileIds?: string[];
|
|
831
991
|
};
|
|
832
992
|
};
|
|
833
|
-
declare const codeInterpreterToolFactory: _ai_sdk_provider_utils.
|
|
993
|
+
declare const codeInterpreterToolFactory: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
834
994
|
/**
|
|
835
995
|
* The code to run, or null if not available.
|
|
836
996
|
*/
|
|
@@ -857,8 +1017,8 @@ declare const codeInterpreterToolFactory: _ai_sdk_provider_utils.ProviderToolFac
|
|
|
857
1017
|
*/
|
|
858
1018
|
url: string;
|
|
859
1019
|
}> | null;
|
|
860
|
-
}, CodeInterpreterArgs>;
|
|
861
|
-
declare const codeInterpreter: (args?: CodeInterpreterArgs) => _ai_sdk_provider_utils.
|
|
1020
|
+
}, CodeInterpreterArgs, {}>;
|
|
1021
|
+
declare const codeInterpreter: (args?: CodeInterpreterArgs) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
862
1022
|
/**
|
|
863
1023
|
* The code to run, or null if not available.
|
|
864
1024
|
*/
|
|
@@ -885,7 +1045,7 @@ declare const codeInterpreter: (args?: CodeInterpreterArgs) => _ai_sdk_provider_
|
|
|
885
1045
|
*/
|
|
886
1046
|
url: string;
|
|
887
1047
|
}> | null;
|
|
888
|
-
}>;
|
|
1048
|
+
}, {}>;
|
|
889
1049
|
|
|
890
1050
|
declare const fileSearchArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
891
1051
|
vectorStoreIds: string[];
|
|
@@ -906,7 +1066,7 @@ declare const fileSearchOutputSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
906
1066
|
text: string;
|
|
907
1067
|
}[] | null;
|
|
908
1068
|
}>;
|
|
909
|
-
declare const fileSearch: _ai_sdk_provider_utils.
|
|
1069
|
+
declare const fileSearch: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {
|
|
910
1070
|
/**
|
|
911
1071
|
* The search query to execute.
|
|
912
1072
|
*/
|
|
@@ -968,7 +1128,7 @@ declare const fileSearch: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSc
|
|
|
968
1128
|
* A filter to apply.
|
|
969
1129
|
*/
|
|
970
1130
|
filters?: OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter;
|
|
971
|
-
}>;
|
|
1131
|
+
}, {}>;
|
|
972
1132
|
|
|
973
1133
|
declare const imageGenerationArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
974
1134
|
background?: "auto" | "transparent" | "opaque" | undefined;
|
|
@@ -1044,12 +1204,206 @@ type ImageGenerationArgs = {
|
|
|
1044
1204
|
*/
|
|
1045
1205
|
size?: 'auto' | '1024x1024' | '1024x1536' | '1536x1024';
|
|
1046
1206
|
};
|
|
1047
|
-
declare const imageGeneration: (args?: ImageGenerationArgs) => _ai_sdk_provider_utils.
|
|
1207
|
+
declare const imageGeneration: (args?: ImageGenerationArgs) => _ai_sdk_provider_utils.ProviderExecutedTool<{}, {
|
|
1048
1208
|
/**
|
|
1049
1209
|
* The generated image encoded in base64.
|
|
1050
1210
|
*/
|
|
1051
1211
|
result: string;
|
|
1212
|
+
}, {}>;
|
|
1213
|
+
|
|
1214
|
+
declare const webSearchArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1215
|
+
externalWebAccess?: boolean | undefined;
|
|
1216
|
+
filters?: {
|
|
1217
|
+
allowedDomains?: string[] | undefined;
|
|
1218
|
+
} | undefined;
|
|
1219
|
+
searchContextSize?: "low" | "medium" | "high" | undefined;
|
|
1220
|
+
userLocation?: {
|
|
1221
|
+
type: "approximate";
|
|
1222
|
+
country?: string | undefined;
|
|
1223
|
+
city?: string | undefined;
|
|
1224
|
+
region?: string | undefined;
|
|
1225
|
+
timezone?: string | undefined;
|
|
1226
|
+
} | undefined;
|
|
1052
1227
|
}>;
|
|
1228
|
+
declare const webSearchOutputSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1229
|
+
action?: {
|
|
1230
|
+
type: "search";
|
|
1231
|
+
query?: string | undefined;
|
|
1232
|
+
queries?: string[] | undefined;
|
|
1233
|
+
} | {
|
|
1234
|
+
type: "openPage";
|
|
1235
|
+
url?: string | null | undefined;
|
|
1236
|
+
} | {
|
|
1237
|
+
type: "findInPage";
|
|
1238
|
+
url?: string | null | undefined;
|
|
1239
|
+
pattern?: string | null | undefined;
|
|
1240
|
+
} | undefined;
|
|
1241
|
+
sources?: ({
|
|
1242
|
+
type: "url";
|
|
1243
|
+
url: string;
|
|
1244
|
+
} | {
|
|
1245
|
+
type: "api";
|
|
1246
|
+
name: string;
|
|
1247
|
+
})[] | undefined;
|
|
1248
|
+
}>;
|
|
1249
|
+
declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {
|
|
1250
|
+
/**
|
|
1251
|
+
* An object describing the specific action taken in this web search call.
|
|
1252
|
+
* Includes details on how the model used the web (search, open_page, find_in_page).
|
|
1253
|
+
*/
|
|
1254
|
+
action?: {
|
|
1255
|
+
/**
|
|
1256
|
+
* Action type "search" - Performs a web search query.
|
|
1257
|
+
*/
|
|
1258
|
+
type: "search";
|
|
1259
|
+
/**
|
|
1260
|
+
* The search query.
|
|
1261
|
+
*
|
|
1262
|
+
* @deprecated Use `queries` instead.
|
|
1263
|
+
*/
|
|
1264
|
+
query?: string;
|
|
1265
|
+
/**
|
|
1266
|
+
* The search queries the model used.
|
|
1267
|
+
*/
|
|
1268
|
+
queries?: string[];
|
|
1269
|
+
} | {
|
|
1270
|
+
/**
|
|
1271
|
+
* Action type "openPage" - Opens a specific URL from search results.
|
|
1272
|
+
*/
|
|
1273
|
+
type: "openPage";
|
|
1274
|
+
/**
|
|
1275
|
+
* The URL opened by the model.
|
|
1276
|
+
*/
|
|
1277
|
+
url?: string | null;
|
|
1278
|
+
} | {
|
|
1279
|
+
/**
|
|
1280
|
+
* Action type "findInPage": Searches for a pattern within a loaded page.
|
|
1281
|
+
*/
|
|
1282
|
+
type: "findInPage";
|
|
1283
|
+
/**
|
|
1284
|
+
* The URL of the page searched for the pattern.
|
|
1285
|
+
*/
|
|
1286
|
+
url?: string | null;
|
|
1287
|
+
/**
|
|
1288
|
+
* The pattern or text to search for within the page.
|
|
1289
|
+
*/
|
|
1290
|
+
pattern?: string | null;
|
|
1291
|
+
};
|
|
1292
|
+
/**
|
|
1293
|
+
* Optional sources cited by the model for the web search call.
|
|
1294
|
+
*/
|
|
1295
|
+
sources?: Array<{
|
|
1296
|
+
type: "url";
|
|
1297
|
+
url: string;
|
|
1298
|
+
} | {
|
|
1299
|
+
type: "api";
|
|
1300
|
+
name: string;
|
|
1301
|
+
}>;
|
|
1302
|
+
}, {
|
|
1303
|
+
/**
|
|
1304
|
+
* Whether to use external web access for fetching live content.
|
|
1305
|
+
* - true: Fetch live web content (default)
|
|
1306
|
+
* - false: Use cached/indexed results
|
|
1307
|
+
*/
|
|
1308
|
+
externalWebAccess?: boolean;
|
|
1309
|
+
/**
|
|
1310
|
+
* Filters for the search.
|
|
1311
|
+
*/
|
|
1312
|
+
filters?: {
|
|
1313
|
+
/**
|
|
1314
|
+
* Allowed domains for the search.
|
|
1315
|
+
* If not provided, all domains are allowed.
|
|
1316
|
+
* Subdomains of the provided domains are allowed as well.
|
|
1317
|
+
*/
|
|
1318
|
+
allowedDomains?: string[];
|
|
1319
|
+
};
|
|
1320
|
+
/**
|
|
1321
|
+
* Search context size to use for the web search.
|
|
1322
|
+
* - high: Most comprehensive context, highest cost, slower response
|
|
1323
|
+
* - medium: Balanced context, cost, and latency (default)
|
|
1324
|
+
* - low: Least context, lowest cost, fastest response
|
|
1325
|
+
*/
|
|
1326
|
+
searchContextSize?: "low" | "medium" | "high";
|
|
1327
|
+
/**
|
|
1328
|
+
* User location information to provide geographically relevant search results.
|
|
1329
|
+
*/
|
|
1330
|
+
userLocation?: {
|
|
1331
|
+
/**
|
|
1332
|
+
* Type of location (always 'approximate')
|
|
1333
|
+
*/
|
|
1334
|
+
type: "approximate";
|
|
1335
|
+
/**
|
|
1336
|
+
* Two-letter ISO country code (e.g., 'US', 'GB')
|
|
1337
|
+
*/
|
|
1338
|
+
country?: string;
|
|
1339
|
+
/**
|
|
1340
|
+
* City name (free text, e.g., 'Minneapolis')
|
|
1341
|
+
*/
|
|
1342
|
+
city?: string;
|
|
1343
|
+
/**
|
|
1344
|
+
* Region name (free text, e.g., 'Minnesota')
|
|
1345
|
+
*/
|
|
1346
|
+
region?: string;
|
|
1347
|
+
/**
|
|
1348
|
+
* IANA timezone (e.g., 'America/Chicago')
|
|
1349
|
+
*/
|
|
1350
|
+
timezone?: string;
|
|
1351
|
+
};
|
|
1352
|
+
}, {}>;
|
|
1353
|
+
declare const webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{}, {
|
|
1354
|
+
/**
|
|
1355
|
+
* An object describing the specific action taken in this web search call.
|
|
1356
|
+
* Includes details on how the model used the web (search, open_page, find_in_page).
|
|
1357
|
+
*/
|
|
1358
|
+
action?: {
|
|
1359
|
+
/**
|
|
1360
|
+
* Action type "search" - Performs a web search query.
|
|
1361
|
+
*/
|
|
1362
|
+
type: "search";
|
|
1363
|
+
/**
|
|
1364
|
+
* The search query.
|
|
1365
|
+
*
|
|
1366
|
+
* @deprecated Use `queries` instead.
|
|
1367
|
+
*/
|
|
1368
|
+
query?: string;
|
|
1369
|
+
/**
|
|
1370
|
+
* The search queries the model used.
|
|
1371
|
+
*/
|
|
1372
|
+
queries?: string[];
|
|
1373
|
+
} | {
|
|
1374
|
+
/**
|
|
1375
|
+
* Action type "openPage" - Opens a specific URL from search results.
|
|
1376
|
+
*/
|
|
1377
|
+
type: "openPage";
|
|
1378
|
+
/**
|
|
1379
|
+
* The URL opened by the model.
|
|
1380
|
+
*/
|
|
1381
|
+
url?: string | null;
|
|
1382
|
+
} | {
|
|
1383
|
+
/**
|
|
1384
|
+
* Action type "findInPage": Searches for a pattern within a loaded page.
|
|
1385
|
+
*/
|
|
1386
|
+
type: "findInPage";
|
|
1387
|
+
/**
|
|
1388
|
+
* The URL of the page searched for the pattern.
|
|
1389
|
+
*/
|
|
1390
|
+
url?: string | null;
|
|
1391
|
+
/**
|
|
1392
|
+
* The pattern or text to search for within the page.
|
|
1393
|
+
*/
|
|
1394
|
+
pattern?: string | null;
|
|
1395
|
+
};
|
|
1396
|
+
/**
|
|
1397
|
+
* Optional sources cited by the model for the web search call.
|
|
1398
|
+
*/
|
|
1399
|
+
sources?: Array<{
|
|
1400
|
+
type: "url";
|
|
1401
|
+
url: string;
|
|
1402
|
+
} | {
|
|
1403
|
+
type: "api";
|
|
1404
|
+
name: string;
|
|
1405
|
+
}>;
|
|
1406
|
+
}, {}>;
|
|
1053
1407
|
|
|
1054
1408
|
declare const webSearchPreviewArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1055
1409
|
searchContextSize?: "low" | "medium" | "high" | undefined;
|
|
@@ -1062,7 +1416,7 @@ declare const webSearchPreviewArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
1062
1416
|
} | undefined;
|
|
1063
1417
|
}>;
|
|
1064
1418
|
declare const webSearchPreviewInputSchema: _ai_sdk_provider_utils.LazySchema<Record<string, never>>;
|
|
1065
|
-
declare const webSearchPreview: _ai_sdk_provider_utils.
|
|
1419
|
+
declare const webSearchPreview: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {
|
|
1066
1420
|
/**
|
|
1067
1421
|
* An object describing the specific action taken in this web search call.
|
|
1068
1422
|
* Includes details on how the model used the web (search, open_page, find_in_page).
|
|
@@ -1132,6 +1486,6 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOu
|
|
|
1132
1486
|
*/
|
|
1133
1487
|
timezone?: string;
|
|
1134
1488
|
};
|
|
1135
|
-
}>;
|
|
1489
|
+
}, {}>;
|
|
1136
1490
|
|
|
1137
|
-
export { type ApplyPatchOperation, OpenAIChatLanguageModel, type OpenAIChatModelId, OpenAICompletionLanguageModel, type OpenAICompletionModelId, OpenAIEmbeddingModel, type OpenAIEmbeddingModelId, type OpenAIEmbeddingModelOptions, OpenAIImageModel, type OpenAIImageModelId, type OpenAILanguageModelChatOptions, type OpenAILanguageModelCompletionOptions, OpenAIResponsesLanguageModel, OpenAISpeechModel, type OpenAISpeechModelId, type OpenAISpeechModelOptions, type OpenAITranscriptionCallOptions, OpenAITranscriptionModel, type OpenAITranscriptionModelId, type OpenAITranscriptionModelOptions, type OpenaiResponsesProviderMetadata, type OpenaiResponsesReasoningProviderMetadata, type OpenaiResponsesSourceDocumentProviderMetadata, type OpenaiResponsesTextProviderMetadata, type ResponsesProviderMetadata, type ResponsesReasoningProviderMetadata, type ResponsesSourceDocumentProviderMetadata, type ResponsesTextProviderMetadata, applyPatch, applyPatchArgsSchema, applyPatchInputSchema, applyPatchOutputSchema, applyPatchToolFactory, codeInterpreter, codeInterpreterArgsSchema, codeInterpreterInputSchema, codeInterpreterOutputSchema, codeInterpreterToolFactory, fileSearch, fileSearchArgsSchema, fileSearchOutputSchema, hasDefaultResponseFormat, imageGeneration, imageGenerationArgsSchema, imageGenerationOutputSchema, modelMaxImagesPerCall, openAITranscriptionModelOptions, openaiEmbeddingModelOptions, openaiLanguageModelChatOptions, openaiLanguageModelCompletionOptions, openaiSpeechModelOptionsSchema, webSearchPreview, webSearchPreviewArgsSchema, webSearchPreviewInputSchema };
|
|
1491
|
+
export { type ApplyPatchOperation, OpenAIChatLanguageModel, type OpenAIChatModelId, OpenAICompletionLanguageModel, type OpenAICompletionModelId, OpenAIEmbeddingModel, type OpenAIEmbeddingModelId, type OpenAIEmbeddingModelOptions, OpenAIImageModel, type OpenAIImageModelEditOptions, type OpenAIImageModelGenerationOptions, type OpenAIImageModelId, type OpenAIImageModelOptions, type OpenAILanguageModelChatOptions, type OpenAILanguageModelCompletionOptions, OpenAIResponsesLanguageModel, OpenAISpeechModel, type OpenAISpeechModelId, type OpenAISpeechModelOptions, type OpenAITranscriptionCallOptions, OpenAITranscriptionModel, type OpenAITranscriptionModelId, type OpenAITranscriptionModelOptions, type OpenaiResponsesCompactionProviderMetadata, type OpenaiResponsesProviderMetadata, type OpenaiResponsesReasoningProviderMetadata, type OpenaiResponsesSourceDocumentProviderMetadata, type OpenaiResponsesTextProviderMetadata, type ResponsesCompactionProviderMetadata, type ResponsesProviderMetadata, type ResponsesReasoningProviderMetadata, type ResponsesSourceDocumentProviderMetadata, type ResponsesTextProviderMetadata, applyPatch, applyPatchArgsSchema, applyPatchInputSchema, applyPatchOutputSchema, applyPatchToolFactory, codeInterpreter, codeInterpreterArgsSchema, codeInterpreterInputSchema, codeInterpreterOutputSchema, codeInterpreterToolFactory, fileSearch, fileSearchArgsSchema, fileSearchOutputSchema, hasDefaultResponseFormat, imageGeneration, imageGenerationArgsSchema, imageGenerationOutputSchema, modelMaxImagesPerCall, openAITranscriptionModelOptions, openaiEmbeddingModelOptions, openaiImageModelEditOptions, openaiImageModelGenerationOptions, openaiImageModelOptions, openaiLanguageModelChatOptions, openaiLanguageModelCompletionOptions, openaiSpeechModelOptionsSchema, webSearch, webSearchArgsSchema, webSearchOutputSchema, webSearchPreview, webSearchPreviewArgsSchema, webSearchPreviewInputSchema, webSearchToolFactory };
|