chore: add i18n

This commit is contained in:
eeee0717
2025-06-28 19:37:48 +08:00
parent 8e34b024e2
commit 98de63b0f3
11 changed files with 165 additions and 308 deletions
+28 -62
View File
@@ -1843,7 +1843,34 @@
"apikey": "APIキー",
"free": "無料",
"content_limit": "コンテンツ制限",
"content_limit_tooltip": "検索結果のコンテンツの長さを制限します。制限を超えるコンテンツは切り捨てられます。"
"content_limit_tooltip": "検索結果のコンテンツの長さを制限します。制限を超えるコンテンツは切り捨てられます。",
"compression": {
"title": "検索結果の圧縮",
"method": "圧縮方法",
"method.none": "圧縮しない",
"method.cutoff": "切り捨て",
"cutoff.limit": "切り捨て長",
"cutoff.limit.placeholder": "長さを入力",
"cutoff.limit.tooltip": "検索結果の内容長を制限し、制限を超える内容は切り捨てられます(例:2000文字)",
"cutoff.unit.char": "文字",
"cutoff.unit.token": "トークン",
"method.rag": "RAG",
"rag.document_count": "文書数",
"rag.document_count.default": "デフォルト",
"rag.document_count.tooltip": "単一の検索結果から抽出する文書数。実際に抽出される文書数は、この値に検索結果数を乗じたものです。",
"rag.embedding_dimensions.auto_get": "次元を自動取得",
"rag.embedding_dimensions.placeholder": "次元を設定しない",
"rag.embedding_dimensions.tooltip": "空の場合、dimensions パラメーターは渡されません",
"info": {
"dimensions_auto_success": "次元が自動取得されました。次元: {{dimensions}}"
},
"error": {
"embedding_model_required": "まず埋め込みモデルを選択してください",
"dimensions_auto_failed": "次元の自動取得に失敗しました",
"provider_not_found": "プロバイダーが見つかりません",
"rag_failed": "RAG に失敗しました"
}
}
},
"preprocess": {
"title": "前処理",
@@ -1873,67 +1900,6 @@
"tray.onclose": "閉じるときにトレイに最小化",
"tray.show": "トレイアイコンを表示",
"tray.title": "トレイ",
"websearch": {
"blacklist": "ブラックリスト",
"blacklist_description": "以下のウェブサイトの結果は検索結果に表示されません",
"check": "チェック",
"check_failed": "検証に失敗しました",
"check_success": "検証に成功しました",
"get_api_key": "APIキーを取得",
"no_provider_selected": "検索サービスプロバイダーを選択してから再確認してください。",
"search_max_result": "検索結果の数",
"search_provider": "検索サービスプロバイダー",
"search_provider_placeholder": "検索サービスプロバイダーを選択する",
"search_result_default": "デフォルト",
"search_with_time": "日付を含む検索",
"tavily": {
"api_key": "Tavily API キー",
"api_key.placeholder": "Tavily API キーを入力してください",
"description": "Tavily は、AI エージェントのために特別に開発された検索エンジンで、最新の結果、インテリジェントな検索提案、そして深い研究能力を提供します",
"title": "Tavily"
},
"title": "ウェブ検索",
"blacklist_tooltip": "マッチパターン: *://*.example.com/*\n正規表現: /example\\.(net|org)/",
"subscribe": "ブラックリスト購読",
"subscribe_update": "更新",
"subscribe_add": "サブスクリプションを追加",
"subscribe_url": "フィードのURL",
"subscribe_name": "代替名",
"subscribe_name.placeholder": "ダウンロードしたフィードに名前がない場合に使用される代替名",
"subscribe_add_success": "フィードの追加が成功しました!",
"subscribe_delete": "削除",
"overwrite": "サービス検索を上書き",
"overwrite_tooltip": "大規模言語モデルではなく、サービス検索を使用する",
"apikey": "API キー",
"free": "無料",
"compression": {
"title": "検索結果の圧縮",
"method": "圧縮方法",
"method.none": "圧縮しない",
"method.cutoff": "切り捨て",
"cutoff.limit": "切り捨て長",
"cutoff.limit.placeholder": "長さを入力",
"cutoff.limit.tooltip": "検索結果の内容長を制限し、制限を超える内容は切り捨てられます(例:2000文字)",
"cutoff.unit.char": "文字",
"cutoff.unit.token": "トークン",
"method.rag": "RAG",
"rag.document_count": "文書数",
"rag.document_count.default": "デフォルト",
"rag.document_count.tooltip": "単一の検索結果から抽出する文書数。実際に抽出される文書数は、この値に検索結果数を乗じたものです。",
"rag.embedding_dimensions.auto_get": "次元を自動取得",
"rag.embedding_dimensions.placeholder": "次元を設定しない",
"rag.embedding_dimensions.tooltip": "空の場合、dimensions パラメーターは渡されません",
"info": {
"dimensions_auto_success": "次元が自動取得されました。次元: {{dimensions}}"
},
"error": {
"embedding_model_required": "まず埋め込みモデルを選択してください",
"dimensions_auto_failed": "次元の自動取得に失敗しました",
"provider_not_found": "プロバイダーが見つかりません",
"rag_failed": "RAG に失敗しました"
}
}
},
"general.auto_check_update.title": "自動更新",
"general.test_plan.title": "テストプラン",
"general.test_plan.tooltip": "テストプランに参加すると、最新の機能をより早く体験できますが、同時により多くのリスクが伴います。データを事前にバックアップしてください。",
+29 -63
View File
@@ -998,7 +998,7 @@
"per_images": "за изображения",
"required_field": "Обязательное поле",
"uploaded_input": "Загруженный ввод",
"prompt_placeholder_en": "[to be translated]:Enter your image description, currently Imagen only supports English prompts"
"prompt_placeholder_en": "Введите описание изображения, в настоящее время Imagen поддерживает только английские подсказки"
},
"prompts": {
"explanation": "Объясните мне этот концепт",
@@ -1843,7 +1843,34 @@
"apikey": "API ключ",
"free": "Бесплатно",
"content_limit": "Ограничение длины контента",
"content_limit_tooltip": "Ограничить длину контента в результатах поиска; контент, превышающий лимит, будет усечен."
"content_limit_tooltip": "Ограничить длину контента в результатах поиска; контент, превышающий лимит, будет усечен.",
"compression": {
"title": "Сжатие результатов поиска",
"method": "Метод сжатия",
"method.none": "Не сжимать",
"method.cutoff": "Обрезка",
"cutoff.limit": "Лимит обрезки",
"cutoff.limit.placeholder": "Введите длину",
"cutoff.limit.tooltip": "Ограничьте длину содержимого результатов поиска, контент, превышающий ограничение, будет обрезан (например, 2000 символов)",
"cutoff.unit.char": "Символы",
"cutoff.unit.token": "Токены",
"method.rag": "RAG",
"rag.document_count": "Количество документов",
"rag.document_count.default": "По умолчанию",
"rag.document_count.tooltip": "Ожидаемое количество документов, которые будут извлечены из каждого результата поиска. Фактическое количество извлеченных документов равно этому значению, умноженному на количество результатов поиска.",
"rag.embedding_dimensions.auto_get": "Автоматически получить размерности",
"rag.embedding_dimensions.placeholder": "Не устанавливать размерности",
"rag.embedding_dimensions.tooltip": "Если оставить пустым, параметр dimensions не будет передан",
"info": {
"dimensions_auto_success": "Размерности успешно получены, размерности: {{dimensions}}"
},
"error": {
"embedding_model_required": "Пожалуйста, сначала выберите модель встраивания",
"dimensions_auto_failed": "Не удалось получить размерности",
"provider_not_found": "Поставщик не найден",
"rag_failed": "RAG не удалось"
}
}
},
"preprocess": {
"title": "Предварительная обработка",
@@ -1873,67 +1900,6 @@
"tray.onclose": "Свернуть в трей при закрытии",
"tray.show": "Показать значок в трее",
"tray.title": "Трей",
"websearch": {
"blacklist": "Черный список",
"blacklist_description": "Результаты из следующих веб-сайтов не будут отображаться в результатах поиска",
"check": "проверка",
"check_failed": "Проверка не прошла",
"check_success": "Проверка успешна",
"get_api_key": "Получить ключ API",
"no_provider_selected": "Пожалуйста, выберите поставщика поисковых услуг, затем проверьте.",
"search_max_result": "Количество результатов поиска",
"search_provider": "поиск сервисного провайдера",
"search_provider_placeholder": "Выберите поставщика поисковых услуг",
"search_result_default": "По умолчанию",
"search_with_time": "Поиск, содержащий дату",
"tavily": {
"api_key": "Ключ API Tavily",
"api_key.placeholder": "Введите ключ API Tavily",
"description": "Tavily — это поисковая система, специально разработанная для ИИ-агентов, предоставляющая актуальные результаты, умные предложения по запросам и глубокие исследовательские возможности",
"title": "Tavily"
},
"title": "Поиск в Интернете",
"blacklist_tooltip": "Шаблон: *://*.example.com/*\nРегулярное выражение: /example\\.(net|org)/",
"subscribe": "Подписка на черный список",
"subscribe_update": "Обновить",
"subscribe_add": "Добавить",
"subscribe_url": "URL подписки",
"subscribe_name": "Альтернативное имя",
"subscribe_name.placeholder": "Альтернативное имя, если в подписке нет названия.",
"subscribe_add_success": "Подписка успешно добавлена!",
"subscribe_delete": "Удалить",
"overwrite": "Переопределить провайдера поиска",
"overwrite_tooltip": "Использовать провайдера поиска вместо LLM",
"apikey": "API ключ",
"free": "Бесплатно",
"compression": {
"title": "Сжатие результатов поиска",
"method": "Метод сжатия",
"method.none": "Не сжимать",
"method.cutoff": "Обрезка",
"cutoff.limit": "Лимит обрезки",
"cutoff.limit.placeholder": "Введите длину",
"cutoff.limit.tooltip": "Ограничьте длину содержимого результатов поиска, контент, превышающий ограничение, будет обрезан (например, 2000 символов)",
"cutoff.unit.char": "Символы",
"cutoff.unit.token": "Токены",
"method.rag": "RAG",
"rag.document_count": "Количество документов",
"rag.document_count.default": "По умолчанию",
"rag.document_count.tooltip": "Ожидаемое количество документов, которые будут извлечены из каждого результата поиска. Фактическое количество извлеченных документов равно этому значению, умноженному на количество результатов поиска.",
"rag.embedding_dimensions.auto_get": "Автоматически получить размерности",
"rag.embedding_dimensions.placeholder": "Не устанавливать размерности",
"rag.embedding_dimensions.tooltip": "Если оставить пустым, параметр dimensions не будет передан",
"info": {
"dimensions_auto_success": "Размерности успешно получены, размерности: {{dimensions}}"
},
"error": {
"embedding_model_required": "Пожалуйста, сначала выберите модель встраивания",
"dimensions_auto_failed": "Не удалось получить размерности",
"provider_not_found": "Поставщик не найден",
"rag_failed": "RAG не удалось"
}
}
},
"general.auto_check_update.title": "Автоматическое обновление",
"general.test_plan.title": "Тестовый план",
"general.test_plan.tooltip": "Участвовать в тестовом плане, чтобы быстрее получать новые функции, но при этом возникает больше рисков, пожалуйста, сделайте резервную копию данных заранее",
+28 -62
View File
@@ -1833,67 +1833,6 @@
"tray.onclose": "关闭时最小化到托盘",
"tray.show": "显示托盘图标",
"tray.title": "托盘",
"websearch": {
"blacklist": "黑名单",
"blacklist_description": "在搜索结果中不会出现以下网站的结果",
"blacklist_tooltip": "请使用以下格式(换行分隔)\n匹配模式: *://*.example.com/*\n正则表达式: /example\\.(net|org)/",
"check": "检测",
"check_failed": "验证失败",
"check_success": "验证成功",
"overwrite": "覆盖服务商搜索",
"overwrite_tooltip": "强制使用搜索服务商而不是大语言模型进行搜索",
"get_api_key": "点击这里获取密钥",
"no_provider_selected": "请选择搜索服务商后再检测",
"search_max_result": "搜索结果个数",
"search_provider": "搜索服务商",
"search_provider_placeholder": "选择一个搜索服务商",
"subscribe": "黑名单订阅",
"subscribe_update": "立即更新",
"subscribe_add": "添加订阅",
"subscribe_url": "订阅源地址",
"subscribe_name": "替代名字",
"subscribe_name.placeholder": "当下载的订阅源没有名称时所使用的替代名称",
"subscribe_add_success": "订阅源添加成功!",
"subscribe_delete": "删除订阅源",
"search_result_default": "默认",
"search_with_time": "搜索包含日期",
"tavily": {
"api_key": "Tavily API 密钥",
"api_key.placeholder": "请输入 Tavily API 密钥",
"description": "Tavily 是一个为 AI 代理量身定制的搜索引擎,提供实时、准确的结果、智能查询建议和深入的研究能力",
"title": "Tavily"
},
"title": "网络搜索",
"apikey": "API 密钥",
"free": "免费",
"compression": {
"title": "搜索结果压缩",
"method": "压缩方法",
"method.none": "不压缩",
"method.cutoff": "截断",
"cutoff.limit": "截断长度",
"cutoff.limit.placeholder": "输入长度",
"cutoff.limit.tooltip": "限制搜索结果的内容长度, 超过限制的内容将被截断(例如 2000 字符)",
"cutoff.unit.char": "字符",
"cutoff.unit.token": "Token",
"method.rag": "RAG",
"rag.document_count": "文档数量",
"rag.document_count.default": "默认",
"rag.document_count.tooltip": "预期从单个搜索结果中提取的文档数量,实际提取的总数量是这个值乘以搜索结果数量。",
"rag.embedding_dimensions.auto_get": "自动获取维度",
"rag.embedding_dimensions.placeholder": "不设置维度",
"rag.embedding_dimensions.tooltip": "留空则不传递 dimensions 参数",
"info": {
"dimensions_auto_success": "维度自动获取成功,维度为 {{dimensions}}"
},
"error": {
"embedding_model_required": "请先选择嵌入模型",
"dimensions_auto_failed": "维度自动获取失败",
"provider_not_found": "未找到服务商",
"rag_failed": "RAG 失败"
}
}
},
"quickPhrase": {
"title": "快捷短语",
"add": "添加短语",
@@ -1994,7 +1933,34 @@
"apikey": "API 密钥",
"free": "免费",
"content_limit": "内容长度限制",
"content_limit_tooltip": "限制搜索结果的内容长度, 超过限制的内容将被截断"
"content_limit_tooltip": "限制搜索结果的内容长度, 超过限制的内容将被截断",
"compression": {
"title": "搜索结果压缩",
"method": "压缩方法",
"method.none": "不压缩",
"method.cutoff": "截断",
"cutoff.limit": "截断长度",
"cutoff.limit.placeholder": "输入长度",
"cutoff.limit.tooltip": "限制搜索结果的内容长度, 超过限制的内容将被截断(例如 2000 字符)",
"cutoff.unit.char": "字符",
"cutoff.unit.token": "Token",
"method.rag": "RAG",
"rag.document_count": "文档数量",
"rag.document_count.default": "默认",
"rag.document_count.tooltip": "预期从单个搜索结果中提取的文档数量,实际提取的总数量是这个值乘以搜索结果数量。",
"rag.embedding_dimensions.auto_get": "自动获取维度",
"rag.embedding_dimensions.placeholder": "不设置维度",
"rag.embedding_dimensions.tooltip": "留空则不传递 dimensions 参数",
"info": {
"dimensions_auto_success": "维度自动获取成功,维度为 {{dimensions}}"
},
"error": {
"embedding_model_required": "请先选择嵌入模型",
"dimensions_auto_failed": "维度自动获取失败",
"provider_not_found": "未找到服务商",
"rag_failed": "RAG 失败"
}
}
},
"preprocessOrOcr.tooltip": "在设置 -> 工具中设置文档预处理服务商或OCR,文档预处理可以有效提升复杂格式文档与扫描版文档的检索效果,OCR仅可识别文档内图片或扫描版PDF的文本"
},
+28 -62
View File
@@ -1846,7 +1846,34 @@
"apikey": "API 金鑰",
"free": "免費",
"content_limit": "內容長度限制",
"content_limit_tooltip": "限制搜尋結果的內容長度;超過限制的內容將被截斷。"
"content_limit_tooltip": "限制搜尋結果的內容長度;超過限制的內容將被截斷。",
"compression": {
"title": "搜尋結果壓縮",
"method": "壓縮方法",
"method.none": "不壓縮",
"method.cutoff": "截斷",
"cutoff.limit": "截斷長度",
"cutoff.limit.placeholder": "輸入長度",
"cutoff.limit.tooltip": "限制搜尋結果的內容長度,超過限制的內容將被截斷(例如 2000 字符)",
"cutoff.unit.char": "字符",
"cutoff.unit.token": "Token",
"method.rag": "RAG",
"rag.document_count": "文檔數量",
"rag.document_count.default": "預設",
"rag.document_count.tooltip": "預期從單個搜尋結果中提取的文檔數量,實際提取的總數量是這個值乘以搜尋結果數量。",
"rag.embedding_dimensions.auto_get": "自動獲取維度",
"rag.embedding_dimensions.placeholder": "不設置維度",
"rag.embedding_dimensions.tooltip": "留空則不傳遞 dimensions 參數",
"info": {
"dimensions_auto_success": "維度自動獲取成功,維度為 {{dimensions}}"
},
"error": {
"embedding_model_required": "請先選擇嵌入模型",
"dimensions_auto_failed": "維度自動獲取失敗",
"provider_not_found": "未找到服務商",
"rag_failed": "RAG 失敗"
}
}
},
"preprocess": {
"title": "前置處理",
@@ -1876,67 +1903,6 @@
"tray.onclose": "關閉時最小化到系统匣",
"tray.show": "顯示系统匣圖示",
"tray.title": "系统匣",
"websearch": {
"check_success": "驗證成功",
"get_api_key": "點選這裡取得金鑰",
"search_with_time": "搜尋包含日期",
"tavily": {
"api_key": "Tavily API 金鑰",
"api_key.placeholder": "請輸入 Tavily API 金鑰",
"description": "Tavily 是一個為 AI 代理量身訂製的搜尋引擎,提供即時、準確的結果、智慧查詢建議和深入的研究能力",
"title": "Tavily"
},
"blacklist": "黑名單",
"blacklist_description": "以下網站不會出現在搜索結果中",
"search_max_result": "搜尋結果個數",
"search_result_default": "預設",
"check": "檢查",
"search_provider": "搜尋服務商",
"search_provider_placeholder": "選擇一個搜尋服務商",
"no_provider_selected": "請選擇搜索服務商後再檢查",
"check_failed": "驗證失敗",
"blacklist_tooltip": "匹配模式: *://*.example.com/*\n正则表达式: /example\\.(net|org)/",
"subscribe": "黑名單訂閱",
"subscribe_update": "更新",
"subscribe_add": "添加訂閱",
"subscribe_url": "訂閱源地址",
"subscribe_name": "替代名稱",
"subscribe_name.placeholder": "當下載的訂閱源沒有名稱時所使用的替代名稱",
"subscribe_add_success": "訂閱源添加成功!",
"subscribe_delete": "刪除",
"title": "網路搜尋",
"overwrite": "覆蓋搜尋服務商",
"overwrite_tooltip": "強制使用搜尋服務商而不是大語言模型進行搜尋",
"apikey": "API 金鑰",
"free": "免費",
"compression": {
"title": "搜尋結果壓縮",
"method": "壓縮方法",
"method.none": "不壓縮",
"method.cutoff": "截斷",
"cutoff.limit": "截斷長度",
"cutoff.limit.placeholder": "輸入長度",
"cutoff.limit.tooltip": "限制搜尋結果的內容長度,超過限制的內容將被截斷(例如 2000 字符)",
"cutoff.unit.char": "字符",
"cutoff.unit.token": "Token",
"method.rag": "RAG",
"rag.document_count": "文檔數量",
"rag.document_count.default": "預設",
"rag.document_count.tooltip": "預期從單個搜尋結果中提取的文檔數量,實際提取的總數量是這個值乘以搜尋結果數量。",
"rag.embedding_dimensions.auto_get": "自動獲取維度",
"rag.embedding_dimensions.placeholder": "不設置維度",
"rag.embedding_dimensions.tooltip": "留空則不傳遞 dimensions 參數",
"info": {
"dimensions_auto_success": "維度自動獲取成功,維度為 {{dimensions}}"
},
"error": {
"embedding_model_required": "請先選擇嵌入模型",
"dimensions_auto_failed": "維度自動獲取失敗",
"provider_not_found": "未找到服務商",
"rag_failed": "RAG 失敗"
}
}
},
"general.auto_check_update.title": "自動更新",
"general.test_plan.title": "測試計畫",
"general.test_plan.tooltip": "參與測試計畫,體驗最新功能,但同時也帶來更多風險,請務必提前備份數據",
@@ -32,7 +32,7 @@ const BasicSettings: FC = () => {
min={1}
max={50}
step={1}
marks={{ 1: '1', 5: t('settings.websearch.search_result_default'), 20: '20', 50: '50' }}
marks={{ 1: '1', 5: t('settings.tool.websearch.search_result_default'), 20: '20', 50: '50' }}
onChangeComplete={(value) => dispatch(setMaxResult(value))}
/>
</SettingRow>
@@ -7,9 +7,9 @@ import { FC, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { SettingContainer, SettingDivider, SettingGroup, SettingRow, SettingRowTitle, SettingTitle } from '../..'
import CompressionSettings from '../../WebSearchSettings/CompressionSettings'
import BasicSettings from './BasicSettings'
import BlacklistSettings from './BlacklistSettings'
import CompressionSettings from './CompressionSettings'
import WebSearchProviderSetting from './WebSearchProviderSetting'
const WebSearchSettings: FC = () => {
@@ -19,22 +19,22 @@ const CutoffSettings = () => {
}
const unitOptions = [
{ value: 'char', label: t('settings.websearch.compression.cutoff.unit.char') },
{ value: 'token', label: t('settings.websearch.compression.cutoff.unit.token') }
{ value: 'char', label: t('settings.tool.websearch.compression.cutoff.unit.char') },
{ value: 'token', label: t('settings.tool.websearch.compression.cutoff.unit.token') }
]
return (
<SettingRow>
<SettingRowTitle>
{t('settings.websearch.compression.cutoff.limit')}
<Tooltip title={t('settings.websearch.compression.cutoff.limit.tooltip')} placement="right">
{t('settings.tool.websearch.compression.cutoff.limit')}
<Tooltip title={t('settings.tool.websearch.compression.cutoff.limit.tooltip')} placement="right">
<Info size={16} color="var(--color-icon)" style={{ marginLeft: 5, cursor: 'pointer' }} />
</Tooltip>
</SettingRowTitle>
<Space.Compact style={{ width: INPUT_BOX_WIDTH }}>
<Input
style={{ maxWidth: '60%' }}
placeholder={t('settings.websearch.compression.cutoff.limit.placeholder')}
placeholder={t('settings.tool.websearch.compression.cutoff.limit.placeholder')}
value={compressionConfig?.cutoffLimit === undefined ? '' : compressionConfig.cutoffLimit}
onChange={(e) => {
const value = e.target.value
@@ -92,14 +92,14 @@ const RagSettings = () => {
const handleAutoGetDimensions = async () => {
if (!compressionConfig?.embeddingModel) {
Logger.log('[RagSettings] handleAutoGetDimensions: no embedding model')
window.message.error(t('settings.websearch.compression.error.embedding_model_required'))
window.message.error(t('settings.tool.websearch.compression.error.embedding_model_required'))
return
}
const provider = providers.find((p) => p.id === compressionConfig.embeddingModel?.provider)
if (!provider) {
Logger.log('[RagSettings] handleAutoGetDimensions: provider not found')
window.message.error(t('settings.websearch.compression.error.provider_not_found'))
window.message.error(t('settings.tool.websearch.compression.error.provider_not_found'))
return
}
@@ -110,10 +110,10 @@ const RagSettings = () => {
updateCompressionConfig({ embeddingDimensions: dimensions })
window.message.success(t('settings.websearch.compression.info.dimensions_auto_success', { dimensions }))
window.message.success(t('settings.tool.websearch.compression.info.dimensions_auto_success', { dimensions }))
} catch (error) {
Logger.error('[RagSettings] handleAutoGetDimensions: failed to get embedding dimensions', error)
window.message.error(t('settings.websearch.compression.error.dimensions_auto_failed'))
window.message.error(t('settings.tool.websearch.compression.error.dimensions_auto_failed'))
} finally {
setLoadingDimensions(false)
}
@@ -147,11 +147,11 @@ const RagSettings = () => {
<InputNumber
value={compressionConfig?.embeddingDimensions}
style={{ flex: 1 }}
placeholder={t('settings.websearch.compression.rag.embedding_dimensions.placeholder')}
placeholder={t('settings.tool.websearch.compression.rag.embedding_dimensions.placeholder')}
min={0}
onChange={handleEmbeddingDimensionsChange}
/>
<Tooltip title={t('settings.websearch.compression.rag.embedding_dimensions.auto_get')}>
<Tooltip title={t('settings.tool.websearch.compression.rag.embedding_dimensions.auto_get')}>
<Button
icon={<RefreshCw size={16} />}
loading={loadingDimensions}
@@ -180,8 +180,8 @@ const RagSettings = () => {
<SettingRow>
<SettingRowTitle>
{t('settings.websearch.compression.rag.document_count')}
<Tooltip title={t('settings.websearch.compression.rag.document_count.tooltip')} placement="right">
{t('settings.tool.websearch.compression.rag.document_count')}
<Tooltip title={t('settings.tool.websearch.compression.rag.document_count.tooltip')} placement="right">
<Info size={16} color="var(--color-icon)" style={{ marginLeft: 5, cursor: 'pointer' }} />
</Tooltip>
</SettingRowTitle>
@@ -193,7 +193,7 @@ const RagSettings = () => {
step={1}
onChange={handleDocumentCountChange}
marks={{
1: t('settings.websearch.compression.rag.document_count.default'),
1: t('settings.tool.websearch.compression.rag.document_count.default'),
3: '3',
10: '10'
}}
@@ -12,9 +12,9 @@ const CompressionSettings = () => {
const { compressionConfig, updateCompressionConfig } = useWebSearchSettings()
const compressionMethodOptions = [
{ value: 'none', label: t('settings.websearch.compression.method.none') },
{ value: 'cutoff', label: t('settings.websearch.compression.method.cutoff') },
{ value: 'rag', label: t('settings.websearch.compression.method.rag') }
{ value: 'none', label: t('settings.tool.websearch.compression.method.none') },
{ value: 'cutoff', label: t('settings.tool.websearch.compression.method.cutoff') },
{ value: 'rag', label: t('settings.tool.websearch.compression.method.rag') }
]
const handleCompressionMethodChange = (method: 'none' | 'cutoff' | 'rag') => {
@@ -23,11 +23,11 @@ const CompressionSettings = () => {
return (
<SettingGroup>
<SettingTitle>{t('settings.websearch.compression.title')}</SettingTitle>
<SettingTitle>{t('settings.tool.websearch.compression.title')}</SettingTitle>
<SettingDivider />
<SettingRow>
<SettingRowTitle>{t('settings.websearch.compression.method')}</SettingRowTitle>
<SettingRowTitle>{t('settings.tool.websearch.compression.method')}</SettingRowTitle>
<Select
value={compressionConfig?.method || 'none'}
style={{ width: '200px' }}
+3 -3
View File
@@ -3,7 +3,7 @@ import Logger from '@renderer/config/logger'
import db from '@renderer/databases'
import FileManager from '@renderer/services/FileManager'
import store from '@renderer/store'
import { FileType } from '@renderer/types'
import { FileMetadata } from '@renderer/types'
import { Message } from '@renderer/types/newMessage'
import dayjs from 'dayjs'
@@ -11,7 +11,7 @@ import dayjs from 'dayjs'
export type SortField = 'created_at' | 'size' | 'name'
export type SortOrder = 'asc' | 'desc'
export function tempFilesSort(files: FileType[]): FileType[] {
export function tempFilesSort(files: FileMetadata[]): FileMetadata[] {
return files.sort((a, b) => {
const aIsTemp = a.origin_name.startsWith('temp_file')
const bIsTemp = b.origin_name.startsWith('temp_file')
@@ -21,7 +21,7 @@ export function tempFilesSort(files: FileType[]): FileType[] {
})
}
export function sortFiles(files: FileType[], sortField: SortField, sortOrder: SortOrder): FileType[] {
export function sortFiles(files: FileMetadata[], sortField: SortField, sortOrder: SortOrder): FileMetadata[] {
return [...files].sort((a, b) => {
let comparison = 0
switch (sortField) {
+28 -35
View File
@@ -1632,41 +1632,6 @@ const migrateConfig = {
}
}
})
return state
} catch (error) {
return state
}
},
'116': (state: RootState) => {
try {
if (state.websearch) {
// migrate contentLimit to cutoffLimit
// @ts-ignore eslint-disable-next-line
if (state.websearch.contentLimit) {
state.websearch.compressionConfig = {
method: 'cutoff',
cutoffUnit: 'char',
// @ts-ignore eslint-disable-next-line
cutoffLimit: state.websearch.contentLimit
}
} else {
state.websearch.compressionConfig = { method: 'none', cutoffUnit: 'char' }
}
// @ts-ignore eslint-disable-next-line
delete state.websearch.contentLimit
}
if (state.settings) {
state.settings.testChannel = UpgradeChannel.LATEST
}
return state
} catch (error) {
return state
}
},
'115': (state: RootState) => {
try {
if (!state.settings.userId) {
state.settings.userId = uuid()
}
@@ -1715,6 +1680,34 @@ const migrateConfig = {
console.error(error)
return state
}
},
'116': (state: RootState) => {
try {
if (state.websearch) {
// migrate contentLimit to cutoffLimit
// @ts-ignore eslint-disable-next-line
if (state.websearch.contentLimit) {
state.websearch.compressionConfig = {
method: 'cutoff',
cutoffUnit: 'char',
// @ts-ignore eslint-disable-next-line
cutoffLimit: state.websearch.contentLimit
}
} else {
state.websearch.compressionConfig = { method: 'none', cutoffUnit: 'char' }
}
// @ts-ignore eslint-disable-next-line
delete state.websearch.contentLimit
}
if (state.settings) {
state.settings.testChannel = UpgradeChannel.LATEST
}
return state
} catch (error) {
return state
}
}
}