mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-10 15:49:29 +08:00
fix: optimize excluded websites handling in xai provider configuration (#10894)
(cherry picked from commit 13093bb821)
This commit is contained in:
parent
156ceca4a7
commit
91050899c4
@ -78,6 +78,7 @@ export function buildProviderBuiltinWebSearchConfig(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 'xai': {
|
case 'xai': {
|
||||||
|
const excludeDomains = mapRegexToPatterns(webSearchConfig.excludeDomains)
|
||||||
return {
|
return {
|
||||||
xai: {
|
xai: {
|
||||||
maxSearchResults: webSearchConfig.maxResults,
|
maxSearchResults: webSearchConfig.maxResults,
|
||||||
@ -85,7 +86,7 @@ export function buildProviderBuiltinWebSearchConfig(
|
|||||||
sources: [
|
sources: [
|
||||||
{
|
{
|
||||||
type: 'web',
|
type: 'web',
|
||||||
excludedWebsites: mapRegexToPatterns(webSearchConfig.excludeDomains)
|
excludedWebsites: excludeDomains.slice(0, Math.min(excludeDomains.length, 5))
|
||||||
},
|
},
|
||||||
{ type: 'news' },
|
{ type: 'news' },
|
||||||
{ type: 'x' }
|
{ type: 'x' }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user