@ai-sdk/openai 3.0.65 → 3.0.67
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 +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +196 -1
- package/dist/internal/index.d.ts +196 -1
- package/dist/internal/index.js +20 -4
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +15 -3
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/internal/index.ts +1 -0
- package/src/responses/openai-responses-api.ts +2 -0
- package/src/responses/openai-responses-language-model.ts +5 -1
- package/src/tool/web-search.ts +8 -0
|
@@ -488,6 +488,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
488
488
|
action?: {
|
|
489
489
|
type: "search";
|
|
490
490
|
query?: string | null | undefined;
|
|
491
|
+
queries?: string[] | null | undefined;
|
|
491
492
|
sources?: ({
|
|
492
493
|
type: "url";
|
|
493
494
|
url: string;
|
|
@@ -1130,6 +1131,200 @@ declare const imageGeneration: (args?: ImageGenerationArgs) => _ai_sdk_provider_
|
|
|
1130
1131
|
result: string;
|
|
1131
1132
|
}>;
|
|
1132
1133
|
|
|
1134
|
+
declare const webSearchArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1135
|
+
externalWebAccess?: boolean | undefined;
|
|
1136
|
+
filters?: {
|
|
1137
|
+
allowedDomains?: string[] | undefined;
|
|
1138
|
+
} | undefined;
|
|
1139
|
+
searchContextSize?: "low" | "medium" | "high" | undefined;
|
|
1140
|
+
userLocation?: {
|
|
1141
|
+
type: "approximate";
|
|
1142
|
+
country?: string | undefined;
|
|
1143
|
+
city?: string | undefined;
|
|
1144
|
+
region?: string | undefined;
|
|
1145
|
+
timezone?: string | undefined;
|
|
1146
|
+
} | undefined;
|
|
1147
|
+
}>;
|
|
1148
|
+
declare const webSearchOutputSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1149
|
+
action?: {
|
|
1150
|
+
type: "search";
|
|
1151
|
+
query?: string | undefined;
|
|
1152
|
+
queries?: string[] | undefined;
|
|
1153
|
+
} | {
|
|
1154
|
+
type: "openPage";
|
|
1155
|
+
url?: string | null | undefined;
|
|
1156
|
+
} | {
|
|
1157
|
+
type: "findInPage";
|
|
1158
|
+
url?: string | null | undefined;
|
|
1159
|
+
pattern?: string | null | undefined;
|
|
1160
|
+
} | undefined;
|
|
1161
|
+
sources?: ({
|
|
1162
|
+
type: "url";
|
|
1163
|
+
url: string;
|
|
1164
|
+
} | {
|
|
1165
|
+
type: "api";
|
|
1166
|
+
name: string;
|
|
1167
|
+
})[] | undefined;
|
|
1168
|
+
}>;
|
|
1169
|
+
declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
1170
|
+
/**
|
|
1171
|
+
* An object describing the specific action taken in this web search call.
|
|
1172
|
+
* Includes details on how the model used the web (search, open_page, find_in_page).
|
|
1173
|
+
*/
|
|
1174
|
+
action?: {
|
|
1175
|
+
/**
|
|
1176
|
+
* Action type "search" - Performs a web search query.
|
|
1177
|
+
*/
|
|
1178
|
+
type: "search";
|
|
1179
|
+
/**
|
|
1180
|
+
* The search query.
|
|
1181
|
+
*
|
|
1182
|
+
* @deprecated Use `queries` instead.
|
|
1183
|
+
*/
|
|
1184
|
+
query?: string;
|
|
1185
|
+
/**
|
|
1186
|
+
* The search queries the model used.
|
|
1187
|
+
*/
|
|
1188
|
+
queries?: string[];
|
|
1189
|
+
} | {
|
|
1190
|
+
/**
|
|
1191
|
+
* Action type "openPage" - Opens a specific URL from search results.
|
|
1192
|
+
*/
|
|
1193
|
+
type: "openPage";
|
|
1194
|
+
/**
|
|
1195
|
+
* The URL opened by the model.
|
|
1196
|
+
*/
|
|
1197
|
+
url?: string | null;
|
|
1198
|
+
} | {
|
|
1199
|
+
/**
|
|
1200
|
+
* Action type "findInPage": Searches for a pattern within a loaded page.
|
|
1201
|
+
*/
|
|
1202
|
+
type: "findInPage";
|
|
1203
|
+
/**
|
|
1204
|
+
* The URL of the page searched for the pattern.
|
|
1205
|
+
*/
|
|
1206
|
+
url?: string | null;
|
|
1207
|
+
/**
|
|
1208
|
+
* The pattern or text to search for within the page.
|
|
1209
|
+
*/
|
|
1210
|
+
pattern?: string | null;
|
|
1211
|
+
};
|
|
1212
|
+
/**
|
|
1213
|
+
* Optional sources cited by the model for the web search call.
|
|
1214
|
+
*/
|
|
1215
|
+
sources?: Array<{
|
|
1216
|
+
type: "url";
|
|
1217
|
+
url: string;
|
|
1218
|
+
} | {
|
|
1219
|
+
type: "api";
|
|
1220
|
+
name: string;
|
|
1221
|
+
}>;
|
|
1222
|
+
}, {
|
|
1223
|
+
/**
|
|
1224
|
+
* Whether to use external web access for fetching live content.
|
|
1225
|
+
* - true: Fetch live web content (default)
|
|
1226
|
+
* - false: Use cached/indexed results
|
|
1227
|
+
*/
|
|
1228
|
+
externalWebAccess?: boolean;
|
|
1229
|
+
/**
|
|
1230
|
+
* Filters for the search.
|
|
1231
|
+
*/
|
|
1232
|
+
filters?: {
|
|
1233
|
+
/**
|
|
1234
|
+
* Allowed domains for the search.
|
|
1235
|
+
* If not provided, all domains are allowed.
|
|
1236
|
+
* Subdomains of the provided domains are allowed as well.
|
|
1237
|
+
*/
|
|
1238
|
+
allowedDomains?: string[];
|
|
1239
|
+
};
|
|
1240
|
+
/**
|
|
1241
|
+
* Search context size to use for the web search.
|
|
1242
|
+
* - high: Most comprehensive context, highest cost, slower response
|
|
1243
|
+
* - medium: Balanced context, cost, and latency (default)
|
|
1244
|
+
* - low: Least context, lowest cost, fastest response
|
|
1245
|
+
*/
|
|
1246
|
+
searchContextSize?: "low" | "medium" | "high";
|
|
1247
|
+
/**
|
|
1248
|
+
* User location information to provide geographically relevant search results.
|
|
1249
|
+
*/
|
|
1250
|
+
userLocation?: {
|
|
1251
|
+
/**
|
|
1252
|
+
* Type of location (always 'approximate')
|
|
1253
|
+
*/
|
|
1254
|
+
type: "approximate";
|
|
1255
|
+
/**
|
|
1256
|
+
* Two-letter ISO country code (e.g., 'US', 'GB')
|
|
1257
|
+
*/
|
|
1258
|
+
country?: string;
|
|
1259
|
+
/**
|
|
1260
|
+
* City name (free text, e.g., 'Minneapolis')
|
|
1261
|
+
*/
|
|
1262
|
+
city?: string;
|
|
1263
|
+
/**
|
|
1264
|
+
* Region name (free text, e.g., 'Minnesota')
|
|
1265
|
+
*/
|
|
1266
|
+
region?: string;
|
|
1267
|
+
/**
|
|
1268
|
+
* IANA timezone (e.g., 'America/Chicago')
|
|
1269
|
+
*/
|
|
1270
|
+
timezone?: string;
|
|
1271
|
+
};
|
|
1272
|
+
}>;
|
|
1273
|
+
declare const webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
1274
|
+
/**
|
|
1275
|
+
* An object describing the specific action taken in this web search call.
|
|
1276
|
+
* Includes details on how the model used the web (search, open_page, find_in_page).
|
|
1277
|
+
*/
|
|
1278
|
+
action?: {
|
|
1279
|
+
/**
|
|
1280
|
+
* Action type "search" - Performs a web search query.
|
|
1281
|
+
*/
|
|
1282
|
+
type: "search";
|
|
1283
|
+
/**
|
|
1284
|
+
* The search query.
|
|
1285
|
+
*
|
|
1286
|
+
* @deprecated Use `queries` instead.
|
|
1287
|
+
*/
|
|
1288
|
+
query?: string;
|
|
1289
|
+
/**
|
|
1290
|
+
* The search queries the model used.
|
|
1291
|
+
*/
|
|
1292
|
+
queries?: string[];
|
|
1293
|
+
} | {
|
|
1294
|
+
/**
|
|
1295
|
+
* Action type "openPage" - Opens a specific URL from search results.
|
|
1296
|
+
*/
|
|
1297
|
+
type: "openPage";
|
|
1298
|
+
/**
|
|
1299
|
+
* The URL opened by the model.
|
|
1300
|
+
*/
|
|
1301
|
+
url?: string | null;
|
|
1302
|
+
} | {
|
|
1303
|
+
/**
|
|
1304
|
+
* Action type "findInPage": Searches for a pattern within a loaded page.
|
|
1305
|
+
*/
|
|
1306
|
+
type: "findInPage";
|
|
1307
|
+
/**
|
|
1308
|
+
* The URL of the page searched for the pattern.
|
|
1309
|
+
*/
|
|
1310
|
+
url?: string | null;
|
|
1311
|
+
/**
|
|
1312
|
+
* The pattern or text to search for within the page.
|
|
1313
|
+
*/
|
|
1314
|
+
pattern?: string | null;
|
|
1315
|
+
};
|
|
1316
|
+
/**
|
|
1317
|
+
* Optional sources cited by the model for the web search call.
|
|
1318
|
+
*/
|
|
1319
|
+
sources?: Array<{
|
|
1320
|
+
type: "url";
|
|
1321
|
+
url: string;
|
|
1322
|
+
} | {
|
|
1323
|
+
type: "api";
|
|
1324
|
+
name: string;
|
|
1325
|
+
}>;
|
|
1326
|
+
}>;
|
|
1327
|
+
|
|
1133
1328
|
declare const webSearchPreviewArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1134
1329
|
searchContextSize?: "low" | "medium" | "high" | undefined;
|
|
1135
1330
|
userLocation?: {
|
|
@@ -1213,4 +1408,4 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOu
|
|
|
1213
1408
|
};
|
|
1214
1409
|
}>;
|
|
1215
1410
|
|
|
1216
|
-
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 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, openaiImageModelEditOptions, openaiImageModelGenerationOptions, openaiImageModelOptions, openaiLanguageModelChatOptions, openaiLanguageModelCompletionOptions, openaiSpeechModelOptionsSchema, webSearchPreview, webSearchPreviewArgsSchema, webSearchPreviewInputSchema };
|
|
1411
|
+
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 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, openaiImageModelEditOptions, openaiImageModelGenerationOptions, openaiImageModelOptions, openaiLanguageModelChatOptions, openaiLanguageModelCompletionOptions, openaiSpeechModelOptionsSchema, webSearch, webSearchArgsSchema, webSearchOutputSchema, webSearchPreview, webSearchPreviewArgsSchema, webSearchPreviewInputSchema, webSearchToolFactory };
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -488,6 +488,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
488
488
|
action?: {
|
|
489
489
|
type: "search";
|
|
490
490
|
query?: string | null | undefined;
|
|
491
|
+
queries?: string[] | null | undefined;
|
|
491
492
|
sources?: ({
|
|
492
493
|
type: "url";
|
|
493
494
|
url: string;
|
|
@@ -1130,6 +1131,200 @@ declare const imageGeneration: (args?: ImageGenerationArgs) => _ai_sdk_provider_
|
|
|
1130
1131
|
result: string;
|
|
1131
1132
|
}>;
|
|
1132
1133
|
|
|
1134
|
+
declare const webSearchArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1135
|
+
externalWebAccess?: boolean | undefined;
|
|
1136
|
+
filters?: {
|
|
1137
|
+
allowedDomains?: string[] | undefined;
|
|
1138
|
+
} | undefined;
|
|
1139
|
+
searchContextSize?: "low" | "medium" | "high" | undefined;
|
|
1140
|
+
userLocation?: {
|
|
1141
|
+
type: "approximate";
|
|
1142
|
+
country?: string | undefined;
|
|
1143
|
+
city?: string | undefined;
|
|
1144
|
+
region?: string | undefined;
|
|
1145
|
+
timezone?: string | undefined;
|
|
1146
|
+
} | undefined;
|
|
1147
|
+
}>;
|
|
1148
|
+
declare const webSearchOutputSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1149
|
+
action?: {
|
|
1150
|
+
type: "search";
|
|
1151
|
+
query?: string | undefined;
|
|
1152
|
+
queries?: string[] | undefined;
|
|
1153
|
+
} | {
|
|
1154
|
+
type: "openPage";
|
|
1155
|
+
url?: string | null | undefined;
|
|
1156
|
+
} | {
|
|
1157
|
+
type: "findInPage";
|
|
1158
|
+
url?: string | null | undefined;
|
|
1159
|
+
pattern?: string | null | undefined;
|
|
1160
|
+
} | undefined;
|
|
1161
|
+
sources?: ({
|
|
1162
|
+
type: "url";
|
|
1163
|
+
url: string;
|
|
1164
|
+
} | {
|
|
1165
|
+
type: "api";
|
|
1166
|
+
name: string;
|
|
1167
|
+
})[] | undefined;
|
|
1168
|
+
}>;
|
|
1169
|
+
declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
1170
|
+
/**
|
|
1171
|
+
* An object describing the specific action taken in this web search call.
|
|
1172
|
+
* Includes details on how the model used the web (search, open_page, find_in_page).
|
|
1173
|
+
*/
|
|
1174
|
+
action?: {
|
|
1175
|
+
/**
|
|
1176
|
+
* Action type "search" - Performs a web search query.
|
|
1177
|
+
*/
|
|
1178
|
+
type: "search";
|
|
1179
|
+
/**
|
|
1180
|
+
* The search query.
|
|
1181
|
+
*
|
|
1182
|
+
* @deprecated Use `queries` instead.
|
|
1183
|
+
*/
|
|
1184
|
+
query?: string;
|
|
1185
|
+
/**
|
|
1186
|
+
* The search queries the model used.
|
|
1187
|
+
*/
|
|
1188
|
+
queries?: string[];
|
|
1189
|
+
} | {
|
|
1190
|
+
/**
|
|
1191
|
+
* Action type "openPage" - Opens a specific URL from search results.
|
|
1192
|
+
*/
|
|
1193
|
+
type: "openPage";
|
|
1194
|
+
/**
|
|
1195
|
+
* The URL opened by the model.
|
|
1196
|
+
*/
|
|
1197
|
+
url?: string | null;
|
|
1198
|
+
} | {
|
|
1199
|
+
/**
|
|
1200
|
+
* Action type "findInPage": Searches for a pattern within a loaded page.
|
|
1201
|
+
*/
|
|
1202
|
+
type: "findInPage";
|
|
1203
|
+
/**
|
|
1204
|
+
* The URL of the page searched for the pattern.
|
|
1205
|
+
*/
|
|
1206
|
+
url?: string | null;
|
|
1207
|
+
/**
|
|
1208
|
+
* The pattern or text to search for within the page.
|
|
1209
|
+
*/
|
|
1210
|
+
pattern?: string | null;
|
|
1211
|
+
};
|
|
1212
|
+
/**
|
|
1213
|
+
* Optional sources cited by the model for the web search call.
|
|
1214
|
+
*/
|
|
1215
|
+
sources?: Array<{
|
|
1216
|
+
type: "url";
|
|
1217
|
+
url: string;
|
|
1218
|
+
} | {
|
|
1219
|
+
type: "api";
|
|
1220
|
+
name: string;
|
|
1221
|
+
}>;
|
|
1222
|
+
}, {
|
|
1223
|
+
/**
|
|
1224
|
+
* Whether to use external web access for fetching live content.
|
|
1225
|
+
* - true: Fetch live web content (default)
|
|
1226
|
+
* - false: Use cached/indexed results
|
|
1227
|
+
*/
|
|
1228
|
+
externalWebAccess?: boolean;
|
|
1229
|
+
/**
|
|
1230
|
+
* Filters for the search.
|
|
1231
|
+
*/
|
|
1232
|
+
filters?: {
|
|
1233
|
+
/**
|
|
1234
|
+
* Allowed domains for the search.
|
|
1235
|
+
* If not provided, all domains are allowed.
|
|
1236
|
+
* Subdomains of the provided domains are allowed as well.
|
|
1237
|
+
*/
|
|
1238
|
+
allowedDomains?: string[];
|
|
1239
|
+
};
|
|
1240
|
+
/**
|
|
1241
|
+
* Search context size to use for the web search.
|
|
1242
|
+
* - high: Most comprehensive context, highest cost, slower response
|
|
1243
|
+
* - medium: Balanced context, cost, and latency (default)
|
|
1244
|
+
* - low: Least context, lowest cost, fastest response
|
|
1245
|
+
*/
|
|
1246
|
+
searchContextSize?: "low" | "medium" | "high";
|
|
1247
|
+
/**
|
|
1248
|
+
* User location information to provide geographically relevant search results.
|
|
1249
|
+
*/
|
|
1250
|
+
userLocation?: {
|
|
1251
|
+
/**
|
|
1252
|
+
* Type of location (always 'approximate')
|
|
1253
|
+
*/
|
|
1254
|
+
type: "approximate";
|
|
1255
|
+
/**
|
|
1256
|
+
* Two-letter ISO country code (e.g., 'US', 'GB')
|
|
1257
|
+
*/
|
|
1258
|
+
country?: string;
|
|
1259
|
+
/**
|
|
1260
|
+
* City name (free text, e.g., 'Minneapolis')
|
|
1261
|
+
*/
|
|
1262
|
+
city?: string;
|
|
1263
|
+
/**
|
|
1264
|
+
* Region name (free text, e.g., 'Minnesota')
|
|
1265
|
+
*/
|
|
1266
|
+
region?: string;
|
|
1267
|
+
/**
|
|
1268
|
+
* IANA timezone (e.g., 'America/Chicago')
|
|
1269
|
+
*/
|
|
1270
|
+
timezone?: string;
|
|
1271
|
+
};
|
|
1272
|
+
}>;
|
|
1273
|
+
declare const webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
1274
|
+
/**
|
|
1275
|
+
* An object describing the specific action taken in this web search call.
|
|
1276
|
+
* Includes details on how the model used the web (search, open_page, find_in_page).
|
|
1277
|
+
*/
|
|
1278
|
+
action?: {
|
|
1279
|
+
/**
|
|
1280
|
+
* Action type "search" - Performs a web search query.
|
|
1281
|
+
*/
|
|
1282
|
+
type: "search";
|
|
1283
|
+
/**
|
|
1284
|
+
* The search query.
|
|
1285
|
+
*
|
|
1286
|
+
* @deprecated Use `queries` instead.
|
|
1287
|
+
*/
|
|
1288
|
+
query?: string;
|
|
1289
|
+
/**
|
|
1290
|
+
* The search queries the model used.
|
|
1291
|
+
*/
|
|
1292
|
+
queries?: string[];
|
|
1293
|
+
} | {
|
|
1294
|
+
/**
|
|
1295
|
+
* Action type "openPage" - Opens a specific URL from search results.
|
|
1296
|
+
*/
|
|
1297
|
+
type: "openPage";
|
|
1298
|
+
/**
|
|
1299
|
+
* The URL opened by the model.
|
|
1300
|
+
*/
|
|
1301
|
+
url?: string | null;
|
|
1302
|
+
} | {
|
|
1303
|
+
/**
|
|
1304
|
+
* Action type "findInPage": Searches for a pattern within a loaded page.
|
|
1305
|
+
*/
|
|
1306
|
+
type: "findInPage";
|
|
1307
|
+
/**
|
|
1308
|
+
* The URL of the page searched for the pattern.
|
|
1309
|
+
*/
|
|
1310
|
+
url?: string | null;
|
|
1311
|
+
/**
|
|
1312
|
+
* The pattern or text to search for within the page.
|
|
1313
|
+
*/
|
|
1314
|
+
pattern?: string | null;
|
|
1315
|
+
};
|
|
1316
|
+
/**
|
|
1317
|
+
* Optional sources cited by the model for the web search call.
|
|
1318
|
+
*/
|
|
1319
|
+
sources?: Array<{
|
|
1320
|
+
type: "url";
|
|
1321
|
+
url: string;
|
|
1322
|
+
} | {
|
|
1323
|
+
type: "api";
|
|
1324
|
+
name: string;
|
|
1325
|
+
}>;
|
|
1326
|
+
}>;
|
|
1327
|
+
|
|
1133
1328
|
declare const webSearchPreviewArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1134
1329
|
searchContextSize?: "low" | "medium" | "high" | undefined;
|
|
1135
1330
|
userLocation?: {
|
|
@@ -1213,4 +1408,4 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOu
|
|
|
1213
1408
|
};
|
|
1214
1409
|
}>;
|
|
1215
1410
|
|
|
1216
|
-
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 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, openaiImageModelEditOptions, openaiImageModelGenerationOptions, openaiImageModelOptions, openaiLanguageModelChatOptions, openaiLanguageModelCompletionOptions, openaiSpeechModelOptionsSchema, webSearchPreview, webSearchPreviewArgsSchema, webSearchPreviewInputSchema };
|
|
1411
|
+
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 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, openaiImageModelEditOptions, openaiImageModelGenerationOptions, openaiImageModelOptions, openaiLanguageModelChatOptions, openaiLanguageModelCompletionOptions, openaiSpeechModelOptionsSchema, webSearch, webSearchArgsSchema, webSearchOutputSchema, webSearchPreview, webSearchPreviewArgsSchema, webSearchPreviewInputSchema, webSearchToolFactory };
|
package/dist/internal/index.js
CHANGED
|
@@ -53,9 +53,13 @@ __export(index_exports, {
|
|
|
53
53
|
openaiLanguageModelChatOptions: () => openaiLanguageModelChatOptions,
|
|
54
54
|
openaiLanguageModelCompletionOptions: () => openaiLanguageModelCompletionOptions,
|
|
55
55
|
openaiSpeechModelOptionsSchema: () => openaiSpeechModelOptionsSchema,
|
|
56
|
+
webSearch: () => webSearch,
|
|
57
|
+
webSearchArgsSchema: () => webSearchArgsSchema,
|
|
58
|
+
webSearchOutputSchema: () => webSearchOutputSchema,
|
|
56
59
|
webSearchPreview: () => webSearchPreview,
|
|
57
60
|
webSearchPreviewArgsSchema: () => webSearchPreviewArgsSchema,
|
|
58
|
-
webSearchPreviewInputSchema: () => webSearchPreviewInputSchema
|
|
61
|
+
webSearchPreviewInputSchema: () => webSearchPreviewInputSchema,
|
|
62
|
+
webSearchToolFactory: () => webSearchToolFactory
|
|
59
63
|
});
|
|
60
64
|
module.exports = __toCommonJS(index_exports);
|
|
61
65
|
|
|
@@ -3578,6 +3582,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils25.lazySchema)(
|
|
|
3578
3582
|
import_v418.z.object({
|
|
3579
3583
|
type: import_v418.z.literal("search"),
|
|
3580
3584
|
query: import_v418.z.string().nullish(),
|
|
3585
|
+
queries: import_v418.z.array(import_v418.z.string()).nullish(),
|
|
3581
3586
|
sources: import_v418.z.array(
|
|
3582
3587
|
import_v418.z.discriminatedUnion("type", [
|
|
3583
3588
|
import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
|
|
@@ -3930,6 +3935,7 @@ var openaiResponsesResponseSchema = (0, import_provider_utils25.lazySchema)(
|
|
|
3930
3935
|
import_v418.z.object({
|
|
3931
3936
|
type: import_v418.z.literal("search"),
|
|
3932
3937
|
query: import_v418.z.string().nullish(),
|
|
3938
|
+
queries: import_v418.z.array(import_v418.z.string()).nullish(),
|
|
3933
3939
|
sources: import_v418.z.array(
|
|
3934
3940
|
import_v418.z.discriminatedUnion("type", [
|
|
3935
3941
|
import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
|
|
@@ -4649,7 +4655,8 @@ var webSearchOutputSchema = (0, import_provider_utils32.lazySchema)(
|
|
|
4649
4655
|
action: import_v425.z.discriminatedUnion("type", [
|
|
4650
4656
|
import_v425.z.object({
|
|
4651
4657
|
type: import_v425.z.literal("search"),
|
|
4652
|
-
query: import_v425.z.string().optional()
|
|
4658
|
+
query: import_v425.z.string().optional(),
|
|
4659
|
+
queries: import_v425.z.array(import_v425.z.string()).optional()
|
|
4653
4660
|
}),
|
|
4654
4661
|
import_v425.z.object({
|
|
4655
4662
|
type: import_v425.z.literal("openPage"),
|
|
@@ -4675,6 +4682,7 @@ var webSearchToolFactory = (0, import_provider_utils32.createProviderToolFactory
|
|
|
4675
4682
|
inputSchema: webSearchInputSchema,
|
|
4676
4683
|
outputSchema: webSearchOutputSchema
|
|
4677
4684
|
});
|
|
4685
|
+
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
4678
4686
|
|
|
4679
4687
|
// src/tool/web-search-preview.ts
|
|
4680
4688
|
var import_provider_utils33 = require("@ai-sdk/provider-utils");
|
|
@@ -6696,7 +6704,11 @@ function mapWebSearchOutput(action) {
|
|
|
6696
6704
|
switch (action.type) {
|
|
6697
6705
|
case "search":
|
|
6698
6706
|
return {
|
|
6699
|
-
action: {
|
|
6707
|
+
action: {
|
|
6708
|
+
type: "search",
|
|
6709
|
+
query: (_a = action.query) != null ? _a : void 0,
|
|
6710
|
+
...action.queries != null && { queries: action.queries }
|
|
6711
|
+
},
|
|
6700
6712
|
// include sources when provided by the Responses API (behind include flag)
|
|
6701
6713
|
...action.sources != null && { sources: action.sources }
|
|
6702
6714
|
};
|
|
@@ -6750,8 +6762,12 @@ function escapeJSONDelta(delta) {
|
|
|
6750
6762
|
openaiLanguageModelChatOptions,
|
|
6751
6763
|
openaiLanguageModelCompletionOptions,
|
|
6752
6764
|
openaiSpeechModelOptionsSchema,
|
|
6765
|
+
webSearch,
|
|
6766
|
+
webSearchArgsSchema,
|
|
6767
|
+
webSearchOutputSchema,
|
|
6753
6768
|
webSearchPreview,
|
|
6754
6769
|
webSearchPreviewArgsSchema,
|
|
6755
|
-
webSearchPreviewInputSchema
|
|
6770
|
+
webSearchPreviewInputSchema,
|
|
6771
|
+
webSearchToolFactory
|
|
6756
6772
|
});
|
|
6757
6773
|
//# sourceMappingURL=index.js.map
|