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

(cherry picked from commit 13093bb821)
This commit is contained in:
SuYao
2025-10-24 15:10:59 +08:00
committed by dev
parent 156ceca4a7
commit 91050899c4
+2 -1
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' }