@ai-sdk/openai 3.0.88 → 3.0.90

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.
@@ -500,6 +500,7 @@ const result = await generateText({
500
500
  },
501
501
  filters: {
502
502
  allowedDomains: ['sfchronicle.com', 'sfgate.com'],
503
+ blockedDomains: ['example.com'],
503
504
  },
504
505
  }),
505
506
  },
@@ -526,7 +527,10 @@ The web search tool supports the following configuration options:
526
527
  - **searchContextSize** _'low' | 'medium' | 'high'_ - Controls the amount of context used for the search. Higher values provide more comprehensive results but may have higher latency and cost.
527
528
  - **userLocation** - Optional location information to provide geographically relevant results. Includes `type` (always `'approximate'`), `country`, `city`, `region`, and `timezone`.
528
529
  - **filters** - Optional filter configuration to restrict search results.
529
- - **allowedDomains** _string[]_ - Array of allowed domains for the search. Subdomains of the provided domains are automatically included.
530
+ - **allowedDomains** _string[]_ - Up to 100 allowed domains for the search.
531
+ - **blockedDomains** _string[]_ - Up to 100 blocked domains for the search.
532
+
533
+ Omit the HTTP or HTTPS prefix from domain filters. Subdomains of configured domains are automatically included or excluded.
530
534
 
531
535
  For detailed information on configuration options see the [OpenAI Web Search Tool documentation](https://platform.openai.com/docs/guides/tools-web-search?api-mode=responses).
532
536
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/openai",
3
- "version": "3.0.88",
3
+ "version": "3.0.90",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@ai-sdk/provider": "3.0.14",
40
- "@ai-sdk/provider-utils": "4.0.40"
40
+ "@ai-sdk/provider-utils": "4.0.41"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "20.17.24",
@@ -351,7 +351,12 @@ export type OpenAIResponsesTool =
351
351
  | {
352
352
  type: 'web_search';
353
353
  external_web_access: boolean | undefined;
354
- filters: { allowed_domains: string[] | undefined } | undefined;
354
+ filters:
355
+ | {
356
+ allowed_domains: string[] | undefined;
357
+ blocked_domains: string[] | undefined;
358
+ }
359
+ | undefined;
355
360
  search_context_size: 'low' | 'medium' | 'high' | undefined;
356
361
  user_location:
357
362
  | {
@@ -187,7 +187,10 @@ export async function prepareResponsesTools({
187
187
  type: 'web_search',
188
188
  filters:
189
189
  args.filters != null
190
- ? { allowed_domains: args.filters.allowedDomains }
190
+ ? {
191
+ allowed_domains: args.filters.allowedDomains,
192
+ blocked_domains: args.filters.blockedDomains,
193
+ }
191
194
  : undefined,
192
195
  external_web_access: args.externalWebAccess,
193
196
  search_context_size: args.searchContextSize,
@@ -10,7 +10,10 @@ export const webSearchArgsSchema = lazySchema(() =>
10
10
  z.object({
11
11
  externalWebAccess: z.boolean().optional(),
12
12
  filters: z
13
- .object({ allowedDomains: z.array(z.string()).optional() })
13
+ .object({
14
+ allowedDomains: z.array(z.string()).optional(),
15
+ blockedDomains: z.array(z.string()).optional(),
16
+ })
14
17
  .optional(),
15
18
  searchContextSize: z.enum(['low', 'medium', 'high']).optional(),
16
19
  userLocation: z
@@ -140,8 +143,16 @@ export const webSearchToolFactory = createProviderToolFactoryWithOutputSchema<
140
143
  * Allowed domains for the search.
141
144
  * If not provided, all domains are allowed.
142
145
  * Subdomains of the provided domains are allowed as well.
146
+ * Omit the HTTP or HTTPS prefix. Maximum 100 domains.
143
147
  */
144
148
  allowedDomains?: string[];
149
+
150
+ /**
151
+ * Blocked domains for the search.
152
+ * Subdomains of the provided domains are blocked as well.
153
+ * Omit the HTTP or HTTPS prefix. Maximum 100 domains.
154
+ */
155
+ blockedDomains?: string[];
145
156
  };
146
157
 
147
158
  /**