@ai-sdk/openai 3.0.66 → 3.0.68
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 +16 -0
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -9
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +195 -1
- package/dist/internal/index.d.ts +195 -1
- package/dist/internal/index.js +21 -10
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +16 -9
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/internal/index.ts +1 -0
- package/src/responses/convert-to-openai-responses-input.ts +13 -0
- package/src/responses/openai-responses-api.ts +1 -0
|
@@ -1131,6 +1131,200 @@ declare const imageGeneration: (args?: ImageGenerationArgs) => _ai_sdk_provider_
|
|
|
1131
1131
|
result: string;
|
|
1132
1132
|
}>;
|
|
1133
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
|
+
|
|
1134
1328
|
declare const webSearchPreviewArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1135
1329
|
searchContextSize?: "low" | "medium" | "high" | undefined;
|
|
1136
1330
|
userLocation?: {
|
|
@@ -1214,4 +1408,4 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOu
|
|
|
1214
1408
|
};
|
|
1215
1409
|
}>;
|
|
1216
1410
|
|
|
1217
|
-
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
|
@@ -1131,6 +1131,200 @@ declare const imageGeneration: (args?: ImageGenerationArgs) => _ai_sdk_provider_
|
|
|
1131
1131
|
result: string;
|
|
1132
1132
|
}>;
|
|
1133
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
|
+
|
|
1134
1328
|
declare const webSearchPreviewArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1135
1329
|
searchContextSize?: "low" | "medium" | "high" | undefined;
|
|
1136
1330
|
userLocation?: {
|
|
@@ -1214,4 +1408,4 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOu
|
|
|
1214
1408
|
};
|
|
1215
1409
|
}>;
|
|
1216
1410
|
|
|
1217
|
-
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
|
|
|
@@ -2695,7 +2699,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2695
2699
|
hasApplyPatchTool = false,
|
|
2696
2700
|
customProviderToolNames
|
|
2697
2701
|
}) {
|
|
2698
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
2702
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
2699
2703
|
let input = [];
|
|
2700
2704
|
const warnings = [];
|
|
2701
2705
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -2796,6 +2800,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2796
2800
|
}
|
|
2797
2801
|
case "tool-call": {
|
|
2798
2802
|
const id = (_f = (_c = (_b = part.providerOptions) == null ? void 0 : _b[providerOptionsName]) == null ? void 0 : _c.itemId) != null ? _f : (_e = (_d = part.providerMetadata) == null ? void 0 : _d[providerOptionsName]) == null ? void 0 : _e.itemId;
|
|
2803
|
+
const namespace = (_k = (_h = (_g = part.providerOptions) == null ? void 0 : _g[providerOptionsName]) == null ? void 0 : _h.namespace) != null ? _k : (_j = (_i = part.providerMetadata) == null ? void 0 : _i[providerOptionsName]) == null ? void 0 : _j.namespace;
|
|
2799
2804
|
if (hasConversation && id != null) {
|
|
2800
2805
|
break;
|
|
2801
2806
|
}
|
|
@@ -2819,7 +2824,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2819
2824
|
type: "tool_search_call",
|
|
2820
2825
|
id: id != null ? id : part.toolCallId,
|
|
2821
2826
|
execution,
|
|
2822
|
-
call_id: (
|
|
2827
|
+
call_id: (_l = parsedInput.call_id) != null ? _l : null,
|
|
2823
2828
|
status: "completed",
|
|
2824
2829
|
arguments: parsedInput.arguments
|
|
2825
2830
|
});
|
|
@@ -2905,7 +2910,8 @@ async function convertToOpenAIResponsesInput({
|
|
|
2905
2910
|
call_id: part.toolCallId,
|
|
2906
2911
|
name: resolvedToolName,
|
|
2907
2912
|
arguments: serializeToolCallArguments2(part.input),
|
|
2908
|
-
id
|
|
2913
|
+
id,
|
|
2914
|
+
...namespace != null && { namespace }
|
|
2909
2915
|
});
|
|
2910
2916
|
break;
|
|
2911
2917
|
}
|
|
@@ -2921,7 +2927,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2921
2927
|
part.toolName
|
|
2922
2928
|
);
|
|
2923
2929
|
if (resolvedResultToolName === "tool_search") {
|
|
2924
|
-
const itemId = (
|
|
2930
|
+
const itemId = (_o = (_n = (_m = part.providerOptions) == null ? void 0 : _m[providerOptionsName]) == null ? void 0 : _n.itemId) != null ? _o : part.toolCallId;
|
|
2925
2931
|
if (store) {
|
|
2926
2932
|
input.push({ type: "item_reference", id: itemId });
|
|
2927
2933
|
} else if (part.output.type === "json") {
|
|
@@ -2962,7 +2968,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2962
2968
|
break;
|
|
2963
2969
|
}
|
|
2964
2970
|
if (store) {
|
|
2965
|
-
const itemId = (
|
|
2971
|
+
const itemId = (_r = (_q = (_p = part.providerOptions) == null ? void 0 : _p[providerOptionsName]) == null ? void 0 : _q.itemId) != null ? _r : part.toolCallId;
|
|
2966
2972
|
input.push({ type: "item_reference", id: itemId });
|
|
2967
2973
|
} else {
|
|
2968
2974
|
warnings.push({
|
|
@@ -3072,7 +3078,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3072
3078
|
}
|
|
3073
3079
|
const output = part.output;
|
|
3074
3080
|
if (output.type === "execution-denied") {
|
|
3075
|
-
const approvalId = (
|
|
3081
|
+
const approvalId = (_t = (_s = output.providerOptions) == null ? void 0 : _s.openai) == null ? void 0 : _t.approvalId;
|
|
3076
3082
|
if (approvalId) {
|
|
3077
3083
|
continue;
|
|
3078
3084
|
}
|
|
@@ -3146,7 +3152,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3146
3152
|
outputValue = output.value;
|
|
3147
3153
|
break;
|
|
3148
3154
|
case "execution-denied":
|
|
3149
|
-
outputValue = (
|
|
3155
|
+
outputValue = (_u = output.reason) != null ? _u : "Tool execution denied.";
|
|
3150
3156
|
break;
|
|
3151
3157
|
case "json":
|
|
3152
3158
|
case "error-json":
|
|
@@ -3207,7 +3213,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3207
3213
|
contentValue = output.value;
|
|
3208
3214
|
break;
|
|
3209
3215
|
case "execution-denied":
|
|
3210
|
-
contentValue = (
|
|
3216
|
+
contentValue = (_v = output.reason) != null ? _v : "Tool execution denied.";
|
|
3211
3217
|
break;
|
|
3212
3218
|
case "json":
|
|
3213
3219
|
case "error-json":
|
|
@@ -4678,6 +4684,7 @@ var webSearchToolFactory = (0, import_provider_utils32.createProviderToolFactory
|
|
|
4678
4684
|
inputSchema: webSearchInputSchema,
|
|
4679
4685
|
outputSchema: webSearchOutputSchema
|
|
4680
4686
|
});
|
|
4687
|
+
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
4681
4688
|
|
|
4682
4689
|
// src/tool/web-search-preview.ts
|
|
4683
4690
|
var import_provider_utils33 = require("@ai-sdk/provider-utils");
|
|
@@ -6757,8 +6764,12 @@ function escapeJSONDelta(delta) {
|
|
|
6757
6764
|
openaiLanguageModelChatOptions,
|
|
6758
6765
|
openaiLanguageModelCompletionOptions,
|
|
6759
6766
|
openaiSpeechModelOptionsSchema,
|
|
6767
|
+
webSearch,
|
|
6768
|
+
webSearchArgsSchema,
|
|
6769
|
+
webSearchOutputSchema,
|
|
6760
6770
|
webSearchPreview,
|
|
6761
6771
|
webSearchPreviewArgsSchema,
|
|
6762
|
-
webSearchPreviewInputSchema
|
|
6772
|
+
webSearchPreviewInputSchema,
|
|
6773
|
+
webSearchToolFactory
|
|
6763
6774
|
});
|
|
6764
6775
|
//# sourceMappingURL=index.js.map
|