fix: optimize excluded websites handling in xai provider configuration (#10894)

This commit is contained in:
SuYao 2025-10-24 15:10:59 +08:00 committed by GitHub
parent c7c9e1ee44
commit 13093bb821
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -78,6 +78,7 @@ export function buildProviderBuiltinWebSearchConfig(
}
}
case 'xai': {
const excludeDomains = mapRegexToPatterns(webSearchConfig.excludeDomains)
return {
xai: {
maxSearchResults: webSearchConfig.maxResults,
@ -85,7 +86,7 @@ export function buildProviderBuiltinWebSearchConfig(
sources: [
{
type: 'web',
excludedWebsites: mapRegexToPatterns(webSearchConfig.excludeDomains)
excludedWebsites: excludeDomains.slice(0, Math.min(excludeDomains.length, 5))
},
{ type: 'news' },
{ type: 'x' }