@ai-sdk/openai 4.0.22 → 4.0.23
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 +6 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +8 -0
- package/dist/internal/index.js +8 -2
- package/dist/internal/index.js.map +1 -1
- package/docs/03-openai.mdx +5 -1
- package/package.json +1 -1
- package/src/responses/openai-responses-api.ts +6 -1
- package/src/responses/openai-responses-prepare-tools.ts +4 -1
- package/src/tool/web-search.ts +12 -1
package/dist/internal/index.d.ts
CHANGED
|
@@ -1486,6 +1486,7 @@ declare const webSearchArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
1486
1486
|
externalWebAccess?: boolean | undefined;
|
|
1487
1487
|
filters?: {
|
|
1488
1488
|
allowedDomains?: string[] | undefined;
|
|
1489
|
+
blockedDomains?: string[] | undefined;
|
|
1489
1490
|
} | undefined;
|
|
1490
1491
|
searchContextSize?: "low" | "medium" | "high" | undefined;
|
|
1491
1492
|
userLocation?: {
|
|
@@ -1585,8 +1586,15 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderExecutedToolF
|
|
|
1585
1586
|
* Allowed domains for the search.
|
|
1586
1587
|
* If not provided, all domains are allowed.
|
|
1587
1588
|
* Subdomains of the provided domains are allowed as well.
|
|
1589
|
+
* Omit the HTTP or HTTPS prefix. Maximum 100 domains.
|
|
1588
1590
|
*/
|
|
1589
1591
|
allowedDomains?: string[];
|
|
1592
|
+
/**
|
|
1593
|
+
* Blocked domains for the search.
|
|
1594
|
+
* Subdomains of the provided domains are blocked as well.
|
|
1595
|
+
* Omit the HTTP or HTTPS prefix. Maximum 100 domains.
|
|
1596
|
+
*/
|
|
1597
|
+
blockedDomains?: string[];
|
|
1590
1598
|
};
|
|
1591
1599
|
/**
|
|
1592
1600
|
* Search context size to use for the web search.
|
package/dist/internal/index.js
CHANGED
|
@@ -5878,7 +5878,10 @@ var webSearchArgsSchema = lazySchema25(
|
|
|
5878
5878
|
() => zodSchema25(
|
|
5879
5879
|
z27.object({
|
|
5880
5880
|
externalWebAccess: z27.boolean().optional(),
|
|
5881
|
-
filters: z27.object({
|
|
5881
|
+
filters: z27.object({
|
|
5882
|
+
allowedDomains: z27.array(z27.string()).optional(),
|
|
5883
|
+
blockedDomains: z27.array(z27.string()).optional()
|
|
5884
|
+
}).optional(),
|
|
5882
5885
|
searchContextSize: z27.enum(["low", "medium", "high"]).optional(),
|
|
5883
5886
|
userLocation: z27.object({
|
|
5884
5887
|
type: z27.literal("approximate"),
|
|
@@ -6094,7 +6097,10 @@ async function prepareResponsesTools({
|
|
|
6094
6097
|
});
|
|
6095
6098
|
openaiTools.push({
|
|
6096
6099
|
type: "web_search",
|
|
6097
|
-
filters: args.filters != null ? {
|
|
6100
|
+
filters: args.filters != null ? {
|
|
6101
|
+
allowed_domains: args.filters.allowedDomains,
|
|
6102
|
+
blocked_domains: args.filters.blockedDomains
|
|
6103
|
+
} : void 0,
|
|
6098
6104
|
external_web_access: args.externalWebAccess,
|
|
6099
6105
|
search_context_size: args.searchContextSize,
|
|
6100
6106
|
user_location: args.userLocation
|