refactor: remove search enhanceMode
This commit is contained in:
parent
49a7b2dc8b
commit
6e91066e5d
@ -1342,8 +1342,6 @@
|
|||||||
"check": "Check",
|
"check": "Check",
|
||||||
"check_failed": "Verification failed",
|
"check_failed": "Verification failed",
|
||||||
"check_success": "Verification successful",
|
"check_success": "Verification successful",
|
||||||
"enhance_mode": "Search enhance mode",
|
|
||||||
"enhance_mode_tooltip": "Use the default model to extract search keywords from the problem and search",
|
|
||||||
"get_api_key": "Get API Key",
|
"get_api_key": "Get API Key",
|
||||||
"no_provider_selected": "Please select a search service provider before checking.",
|
"no_provider_selected": "Please select a search service provider before checking.",
|
||||||
"search_max_result": "Number of search results",
|
"search_max_result": "Number of search results",
|
||||||
|
|||||||
@ -1340,8 +1340,6 @@
|
|||||||
"check": "チェック",
|
"check": "チェック",
|
||||||
"check_failed": "検証に失敗しました",
|
"check_failed": "検証に失敗しました",
|
||||||
"check_success": "検証に成功しました",
|
"check_success": "検証に成功しました",
|
||||||
"enhance_mode": "検索強化モード",
|
|
||||||
"enhance_mode_tooltip": "デフォルトモデルを使用して問題から検索キーワードを抽出し、検索を実行します",
|
|
||||||
"get_api_key": "APIキーを取得",
|
"get_api_key": "APIキーを取得",
|
||||||
"no_provider_selected": "検索サービスプロバイダーを選択してから再確認してください。",
|
"no_provider_selected": "検索サービスプロバイダーを選択してから再確認してください。",
|
||||||
"search_max_result": "検索結果の数",
|
"search_max_result": "検索結果の数",
|
||||||
|
|||||||
@ -1340,8 +1340,6 @@
|
|||||||
"check": "проверка",
|
"check": "проверка",
|
||||||
"check_failed": "Проверка не прошла",
|
"check_failed": "Проверка не прошла",
|
||||||
"check_success": "Проверка успешна",
|
"check_success": "Проверка успешна",
|
||||||
"enhance_mode": "Режим улучшения поиска",
|
|
||||||
"enhance_mode_tooltip": "Используйте модель по умолчанию для извлечения ключевых слов из проблемы и поиска",
|
|
||||||
"get_api_key": "Получить ключ API",
|
"get_api_key": "Получить ключ API",
|
||||||
"no_provider_selected": "Пожалуйста, выберите поставщика поисковых услуг, затем проверьте.",
|
"no_provider_selected": "Пожалуйста, выберите поставщика поисковых услуг, затем проверьте.",
|
||||||
"search_max_result": "Количество результатов поиска",
|
"search_max_result": "Количество результатов поиска",
|
||||||
|
|||||||
@ -1342,8 +1342,6 @@
|
|||||||
"check": "检查",
|
"check": "检查",
|
||||||
"check_failed": "验证失败",
|
"check_failed": "验证失败",
|
||||||
"check_success": "验证成功",
|
"check_success": "验证成功",
|
||||||
"enhance_mode": "搜索增强模式",
|
|
||||||
"enhance_mode_tooltip": "使用默认模型提取关键词后搜索",
|
|
||||||
"overwrite": "覆盖服务商搜索",
|
"overwrite": "覆盖服务商搜索",
|
||||||
"overwrite_tooltip": "强制使用搜索服务商而不是大语言模型进行搜索",
|
"overwrite_tooltip": "强制使用搜索服务商而不是大语言模型进行搜索",
|
||||||
"get_api_key": "点击这里获取密钥",
|
"get_api_key": "点击这里获取密钥",
|
||||||
|
|||||||
@ -1336,8 +1336,6 @@
|
|||||||
"tray.title": "系统匣",
|
"tray.title": "系统匣",
|
||||||
"websearch": {
|
"websearch": {
|
||||||
"check_success": "驗證成功",
|
"check_success": "驗證成功",
|
||||||
"enhance_mode": "搜索增強模式",
|
|
||||||
"enhance_mode_tooltip": "使用預設模型提取關鍵詞後搜索",
|
|
||||||
"get_api_key": "點選這裡取得金鑰",
|
"get_api_key": "點選這裡取得金鑰",
|
||||||
"search_with_time": "搜尋包含日期",
|
"search_with_time": "搜尋包含日期",
|
||||||
"tavily": {
|
"tavily": {
|
||||||
|
|||||||
@ -1114,8 +1114,6 @@
|
|||||||
"check": "Έλεγχος",
|
"check": "Έλεγχος",
|
||||||
"check_failed": "Αποτυχία του έλεγχου",
|
"check_failed": "Αποτυχία του έλεγχου",
|
||||||
"check_success": "Έλεγχος επιτυχής",
|
"check_success": "Έλεγχος επιτυχής",
|
||||||
"enhance_mode": "Ρύθμιση βελτιστοποίησης αναζήτησης",
|
|
||||||
"enhance_mode_tooltip": "Αναζητήστε με βάση τις λέξεις-κλειδιά που αντικαταστάθηκαν από το πρότυπο μοντέλο",
|
|
||||||
"get_api_key": "Κάντε κλικ εδώ για να λάβετε το κλειδί",
|
"get_api_key": "Κάντε κλικ εδώ για να λάβετε το κλειδί",
|
||||||
"no_provider_selected": "Παρακαλούμε επιλέξτε παρόχο αναζήτησης πριν να ελέγξετε",
|
"no_provider_selected": "Παρακαλούμε επιλέξτε παρόχο αναζήτησης πριν να ελέγξετε",
|
||||||
"search_max_result": "Αριθμός αποτελεσμάτων αναζήτησης",
|
"search_max_result": "Αριθμός αποτελεσμάτων αναζήτησης",
|
||||||
|
|||||||
@ -1114,8 +1114,6 @@
|
|||||||
"check": "Comprobar",
|
"check": "Comprobar",
|
||||||
"check_failed": "Verificación fallida",
|
"check_failed": "Verificación fallida",
|
||||||
"check_success": "Verificación exitosa",
|
"check_success": "Verificación exitosa",
|
||||||
"enhance_mode": "Modo de búsqueda mejorada",
|
|
||||||
"enhance_mode_tooltip": "Utilice el modelo predeterminado para extraer palabras clave y luego busque",
|
|
||||||
"get_api_key": "Haz clic aquí para obtener la clave",
|
"get_api_key": "Haz clic aquí para obtener la clave",
|
||||||
"no_provider_selected": "Por favor, seleccione un proveedor de búsqueda antes de comprobar",
|
"no_provider_selected": "Por favor, seleccione un proveedor de búsqueda antes de comprobar",
|
||||||
"search_max_result": "Número de resultados de búsqueda",
|
"search_max_result": "Número de resultados de búsqueda",
|
||||||
|
|||||||
@ -1114,8 +1114,6 @@
|
|||||||
"check": "Vérifier",
|
"check": "Vérifier",
|
||||||
"check_failed": "Échec de la vérification",
|
"check_failed": "Échec de la vérification",
|
||||||
"check_success": "Vérification réussie",
|
"check_success": "Vérification réussie",
|
||||||
"enhance_mode": "Mode de recherche amélioré",
|
|
||||||
"enhance_mode_tooltip": "Utilisez le modèle par défaut pour extraire les mots-clés avant de rechercher",
|
|
||||||
"get_api_key": "Cliquez ici pour obtenir la clé",
|
"get_api_key": "Cliquez ici pour obtenir la clé",
|
||||||
"no_provider_selected": "Veuillez sélectionner un fournisseur de recherche avant de vérifier",
|
"no_provider_selected": "Veuillez sélectionner un fournisseur de recherche avant de vérifier",
|
||||||
"search_max_result": "Nombre de résultats de recherche",
|
"search_max_result": "Nombre de résultats de recherche",
|
||||||
|
|||||||
@ -1114,8 +1114,6 @@
|
|||||||
"check": "Verificar",
|
"check": "Verificar",
|
||||||
"check_failed": "Verificação falhou",
|
"check_failed": "Verificação falhou",
|
||||||
"check_success": "Verificação bem-sucedida",
|
"check_success": "Verificação bem-sucedida",
|
||||||
"enhance_mode": "Modo de pesquisa avançada",
|
|
||||||
"enhance_mode_tooltip": "Use o modelo padrão para extrair palavras-chave e depois pesquise",
|
|
||||||
"get_api_key": "Clique aqui para obter a chave",
|
"get_api_key": "Clique aqui para obter a chave",
|
||||||
"no_provider_selected": "Selecione um provedor de pesquisa antes de verificar",
|
"no_provider_selected": "Selecione um provedor de pesquisa antes de verificar",
|
||||||
"search_max_result": "Número de resultados da pesquisa",
|
"search_max_result": "Número de resultados da pesquisa",
|
||||||
|
|||||||
@ -1,12 +1,6 @@
|
|||||||
import { useTheme } from '@renderer/context/ThemeProvider'
|
import { useTheme } from '@renderer/context/ThemeProvider'
|
||||||
import { useAppDispatch, useAppSelector } from '@renderer/store'
|
import { useAppDispatch, useAppSelector } from '@renderer/store'
|
||||||
import {
|
import { setContentLimit, setMaxResult, setOverwrite, setSearchWithTime } from '@renderer/store/websearch'
|
||||||
setContentLimit,
|
|
||||||
setEnhanceMode,
|
|
||||||
setMaxResult,
|
|
||||||
setOverwrite,
|
|
||||||
setSearchWithTime
|
|
||||||
} from '@renderer/store/websearch'
|
|
||||||
import { Input, Slider, Switch, Tooltip } from 'antd'
|
import { Input, Slider, Switch, Tooltip } from 'antd'
|
||||||
import { t } from 'i18next'
|
import { t } from 'i18next'
|
||||||
import { Info } from 'lucide-react'
|
import { Info } from 'lucide-react'
|
||||||
@ -17,7 +11,6 @@ import { SettingDivider, SettingGroup, SettingRow, SettingRowTitle, SettingTitle
|
|||||||
const BasicSettings: FC = () => {
|
const BasicSettings: FC = () => {
|
||||||
const { theme } = useTheme()
|
const { theme } = useTheme()
|
||||||
const searchWithTime = useAppSelector((state) => state.websearch.searchWithTime)
|
const searchWithTime = useAppSelector((state) => state.websearch.searchWithTime)
|
||||||
const enhanceMode = useAppSelector((state) => state.websearch.enhanceMode)
|
|
||||||
const overwrite = useAppSelector((state) => state.websearch.overwrite)
|
const overwrite = useAppSelector((state) => state.websearch.overwrite)
|
||||||
const maxResults = useAppSelector((state) => state.websearch.maxResults)
|
const maxResults = useAppSelector((state) => state.websearch.maxResults)
|
||||||
const contentLimit = useAppSelector((state) => state.websearch.contentLimit)
|
const contentLimit = useAppSelector((state) => state.websearch.contentLimit)
|
||||||
@ -43,16 +36,6 @@ const BasicSettings: FC = () => {
|
|||||||
</SettingRowTitle>
|
</SettingRowTitle>
|
||||||
<Switch checked={overwrite} onChange={(checked) => dispatch(setOverwrite(checked))} />
|
<Switch checked={overwrite} onChange={(checked) => dispatch(setOverwrite(checked))} />
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
<SettingDivider style={{ marginTop: 15, marginBottom: 12 }} />
|
|
||||||
<SettingRow>
|
|
||||||
<SettingRowTitle>
|
|
||||||
{t('settings.websearch.enhance_mode')}
|
|
||||||
<Tooltip title={t('settings.websearch.enhance_mode_tooltip')} placement="right">
|
|
||||||
<Info size={16} color="var(--color-icon)" style={{ marginLeft: 5, cursor: 'pointer' }} />
|
|
||||||
</Tooltip>
|
|
||||||
</SettingRowTitle>
|
|
||||||
<Switch checked={enhanceMode} onChange={(checked) => dispatch(setEnhanceMode(checked))} />
|
|
||||||
</SettingRow>
|
|
||||||
<SettingDivider style={{ marginTop: 15, marginBottom: 10 }} />
|
<SettingDivider style={{ marginTop: 15, marginBottom: 10 }} />
|
||||||
<SettingRow style={{ height: 40 }}>
|
<SettingRow style={{ height: 40 }}>
|
||||||
<SettingRowTitle>{t('settings.websearch.search_max_result')}</SettingRowTitle>
|
<SettingRowTitle>{t('settings.websearch.search_max_result')}</SettingRowTitle>
|
||||||
|
|||||||
@ -48,16 +48,6 @@ class WebSearchService {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查是否启用搜索增强模式
|
|
||||||
* @public
|
|
||||||
* @returns 如果启用搜索增强模式则返回true,否则返回false
|
|
||||||
*/
|
|
||||||
public isEnhanceModeEnabled(): boolean {
|
|
||||||
const { enhanceMode } = this.getWebSearchState()
|
|
||||||
return enhanceMode
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查是否启用覆盖搜索
|
* 检查是否启用覆盖搜索
|
||||||
* @public
|
* @public
|
||||||
|
|||||||
@ -1221,9 +1221,6 @@ const migrateConfig = {
|
|||||||
// @ts-ignore eslint-disable-next-line
|
// @ts-ignore eslint-disable-next-line
|
||||||
delete state.settings.showAssistantIcon
|
delete state.settings.showAssistantIcon
|
||||||
state.settings.enableBackspaceDeleteModel = true
|
state.settings.enableBackspaceDeleteModel = true
|
||||||
if (state.websearch) {
|
|
||||||
state.websearch.enhanceMode = true
|
|
||||||
}
|
|
||||||
return state
|
return state
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return state
|
return state
|
||||||
|
|||||||
@ -20,8 +20,6 @@ export interface WebSearchState {
|
|||||||
excludeDomains: string[]
|
excludeDomains: string[]
|
||||||
// 订阅源列表
|
// 订阅源列表
|
||||||
subscribeSources: SubscribeSource[]
|
subscribeSources: SubscribeSource[]
|
||||||
// 是否启用搜索增强模式
|
|
||||||
enhanceMode: boolean
|
|
||||||
// 是否覆盖服务商搜索
|
// 是否覆盖服务商搜索
|
||||||
overwrite: boolean
|
overwrite: boolean
|
||||||
contentLimit?: number
|
contentLimit?: number
|
||||||
@ -65,7 +63,6 @@ const initialState: WebSearchState = {
|
|||||||
maxResults: 5,
|
maxResults: 5,
|
||||||
excludeDomains: [],
|
excludeDomains: [],
|
||||||
subscribeSources: [],
|
subscribeSources: [],
|
||||||
enhanceMode: true,
|
|
||||||
overwrite: false
|
overwrite: false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,9 +123,6 @@ const websearchSlice = createSlice({
|
|||||||
setSubscribeSources: (state, action: PayloadAction<SubscribeSource[]>) => {
|
setSubscribeSources: (state, action: PayloadAction<SubscribeSource[]>) => {
|
||||||
state.subscribeSources = action.payload
|
state.subscribeSources = action.payload
|
||||||
},
|
},
|
||||||
setEnhanceMode: (state, action: PayloadAction<boolean>) => {
|
|
||||||
state.enhanceMode = action.payload
|
|
||||||
},
|
|
||||||
setOverwrite: (state, action: PayloadAction<boolean>) => {
|
setOverwrite: (state, action: PayloadAction<boolean>) => {
|
||||||
state.overwrite = action.payload
|
state.overwrite = action.payload
|
||||||
},
|
},
|
||||||
@ -159,7 +153,6 @@ export const {
|
|||||||
removeSubscribeSource,
|
removeSubscribeSource,
|
||||||
updateSubscribeBlacklist,
|
updateSubscribeBlacklist,
|
||||||
setSubscribeSources,
|
setSubscribeSources,
|
||||||
setEnhanceMode,
|
|
||||||
setOverwrite,
|
setOverwrite,
|
||||||
addWebSearchProvider,
|
addWebSearchProvider,
|
||||||
setContentLimit
|
setContentLimit
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user