diff --git a/src/renderer/src/i18n/locales/en-us.json b/src/renderer/src/i18n/locales/en-us.json index 6932cf2d8d..fb0cd52eb8 100644 --- a/src/renderer/src/i18n/locales/en-us.json +++ b/src/renderer/src/i18n/locales/en-us.json @@ -268,6 +268,8 @@ "input.web_search.builtin": "Model Built-in", "input.web_search.builtin.enabled_content": "Use the built-in web search function of the model", "input.web_search.builtin.disabled_content": "The current model does not support web search", + "input.web_search.no_web_search": "Disable Web Search", + "input.web_search.no_web_search.description": "Do not enable web search", "input.thinking": "Thinking", "input.thinking.mode.default": "Default", "input.thinking.mode.default.tip": "The model will automatically determine the number of tokens to think", diff --git a/src/renderer/src/i18n/locales/ja-jp.json b/src/renderer/src/i18n/locales/ja-jp.json index f492ab71e9..2c0ad9c1fe 100644 --- a/src/renderer/src/i18n/locales/ja-jp.json +++ b/src/renderer/src/i18n/locales/ja-jp.json @@ -268,6 +268,8 @@ "input.web_search.builtin": "モデル内蔵", "input.web_search.builtin.enabled_content": "モデル内蔵のウェブ検索機能を使用", "input.web_search.builtin.disabled_content": "現在のモデルはウェブ検索をサポートしていません", + "input.web_search.no_web_search": "ウェブ検索を無効にする", + "input.web_search.no_web_search.description": "ウェブ検索を無効にする", "input.thinking": "思考", "input.thinking.mode.default": "デフォルト", "input.thinking.mode.custom": "カスタム", diff --git a/src/renderer/src/i18n/locales/ru-ru.json b/src/renderer/src/i18n/locales/ru-ru.json index 2f5f03fa3c..b686874718 100644 --- a/src/renderer/src/i18n/locales/ru-ru.json +++ b/src/renderer/src/i18n/locales/ru-ru.json @@ -268,6 +268,8 @@ "input.web_search.builtin": "Модель встроена", "input.web_search.builtin.enabled_content": "Используйте встроенную функцию веб-поиска модели", "input.web_search.builtin.disabled_content": "Текущая модель не поддерживает веб-поиск", + "input.web_search.no_web_search": "Отключить веб-поиск", + "input.web_search.no_web_search.description": "Отключить веб-поиск", "input.thinking": "Мыслим", "input.thinking.mode.default": "По умолчанию", "input.thinking.mode.default.tip": "Модель автоматически определяет количество токенов для размышления", @@ -1579,4 +1581,4 @@ "visualization": "Визуализация" } } -} \ No newline at end of file +} diff --git a/src/renderer/src/i18n/locales/zh-cn.json b/src/renderer/src/i18n/locales/zh-cn.json index 283c7377fd..eff35502d4 100644 --- a/src/renderer/src/i18n/locales/zh-cn.json +++ b/src/renderer/src/i18n/locales/zh-cn.json @@ -168,6 +168,8 @@ "input.web_search.builtin": "模型内置", "input.web_search.builtin.enabled_content": "使用模型内置的网络搜索功能", "input.web_search.builtin.disabled_content": "当前模型不支持网络搜索功能", + "input.web_search.no_web_search": "不使用网络", + "input.web_search.no_web_search.description": "不启用网络搜索功能", "message.new.branch": "分支", "message.new.branch.created": "新分支已创建", "message.new.context": "清除上下文", diff --git a/src/renderer/src/i18n/locales/zh-tw.json b/src/renderer/src/i18n/locales/zh-tw.json index e0beba9b41..d3b2bcbe44 100644 --- a/src/renderer/src/i18n/locales/zh-tw.json +++ b/src/renderer/src/i18n/locales/zh-tw.json @@ -267,6 +267,8 @@ "input.web_search.builtin": "模型內置", "input.web_search.builtin.enabled_content": "使用模型內置的網路搜尋功能", "input.web_search.builtin.disabled_content": "當前模型不支持網路搜尋功能", + "input.web_search.no_web_search": "關閉網路搜尋", + "input.web_search.no_web_search.description": "關閉網路搜尋", "input.thinking": "思考", "input.thinking.mode.default": "預設", "input.thinking.mode.default.tip": "模型會自動確定思考的 token 數", diff --git a/src/renderer/src/pages/home/Inputbar/WebSearchButton.tsx b/src/renderer/src/pages/home/Inputbar/WebSearchButton.tsx index de6f6a51f4..b9b0f53b43 100644 --- a/src/renderer/src/pages/home/Inputbar/WebSearchButton.tsx +++ b/src/renderer/src/pages/home/Inputbar/WebSearchButton.tsx @@ -29,7 +29,7 @@ const WebSearchButton: FC = ({ ref, assistant, ToolbarButton }) => { const { updateAssistant } = useAssistant(assistant.id) const updateSelectedWebSearchProvider = useCallback( - (providerId: WebSearchProvider['id']) => { + (providerId?: WebSearchProvider['id']) => { // TODO: updateAssistant有性能问题,会导致关闭快捷面板卡顿 setTimeout(() => { const currentWebSearchProviderId = assistant.webSearchProviderId @@ -79,6 +79,16 @@ const WebSearchButton: FC = ({ ref, assistant, ToolbarButton }) => { action: () => navigate('/settings/web-search') }) + items.unshift({ + label: t('chat.input.web_search.no_web_search'), + description: t('chat.input.web_search.no_web_search.description'), + icon: , + isSelected: !assistant.enableWebSearch && !assistant.webSearchProviderId, + action: () => { + updateSelectedWebSearchProvider(undefined) + } + }) + return items }, [ assistant.model,