From ba65ce74cc5ff1d72bed570444937dadd4e3d82f Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Sun, 16 Feb 2025 12:20:08 +0800 Subject: [PATCH] feat: Improve knowledge base threshold tooltip and input --- src/renderer/src/i18n/locales/en-us.json | 4 ++-- src/renderer/src/i18n/locales/ja-jp.json | 4 ++-- src/renderer/src/i18n/locales/ru-ru.json | 4 ++-- src/renderer/src/i18n/locales/zh-cn.json | 6 +++--- src/renderer/src/i18n/locales/zh-tw.json | 4 ++-- .../pages/knowledge/components/KnowledgeSettingsPopup.tsx | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/renderer/src/i18n/locales/en-us.json b/src/renderer/src/i18n/locales/en-us.json index b1016d83f5..a39c26378f 100644 --- a/src/renderer/src/i18n/locales/en-us.json +++ b/src/renderer/src/i18n/locales/en-us.json @@ -297,8 +297,8 @@ "url_added": "URL added", "url_placeholder": "Enter URL, multiple URLs separated by Enter", "urls": "URLs", - "threshold_tooltip": "Match threshold", - "threshold_placeholder": "Default value (0.0)", + "threshold_tooltip": "Used to evaluate the relevance between the user's question and the content in the knowledge base (0-1)", + "threshold_placeholder": "Not set", "threshold_too_large_or_small": "Threshold cannot be greater than 1 or less than 0", "no_match": "No matching content found in the knowledge base.", "threshold": "Matching threshold" diff --git a/src/renderer/src/i18n/locales/ja-jp.json b/src/renderer/src/i18n/locales/ja-jp.json index 62052c3ce1..94ee718208 100644 --- a/src/renderer/src/i18n/locales/ja-jp.json +++ b/src/renderer/src/i18n/locales/ja-jp.json @@ -297,8 +297,8 @@ "url_added": "URLが追加されました", "url_placeholder": "URLを入力, 複数のURLはEnterで区切る", "urls": "URL", - "threshold_tooltip": "マッチングしきい値", - "threshold_placeholder": "デフォルト値(0.0)", + "threshold_tooltip": "ユーザーの質問と知識ベースの内容の関連性を評価するためのしきい値(0-1)", + "threshold_placeholder": "未設置", "threshold_too_large_or_small": "しきい値は0より大きく1より小さい必要があります", "no_match": "知識ベースの内容が見つかりませんでした。", "threshold": "マッチング度閾値" diff --git a/src/renderer/src/i18n/locales/ru-ru.json b/src/renderer/src/i18n/locales/ru-ru.json index 22bcf4e6b1..cdf67b7486 100644 --- a/src/renderer/src/i18n/locales/ru-ru.json +++ b/src/renderer/src/i18n/locales/ru-ru.json @@ -297,8 +297,8 @@ "url_added": "URL добавлен", "url_placeholder": "Введите URL, несколько URL через Enter", "urls": "URL-адреса", - "threshold_tooltip": "Порог совпадения", - "threshold_placeholder": "По умолчанию (0.0)", + "threshold_tooltip": "Используется для оценки соответствия между пользовательским вопросом и содержимым в базе знаний (0-1)", + "threshold_placeholder": "Не установлено", "threshold_too_large_or_small": "Порог не может быть больше 1 или меньше 0", "no_match": "Не найдено содержимого в базе знаний.", "threshold": "Порог соответствия" diff --git a/src/renderer/src/i18n/locales/zh-cn.json b/src/renderer/src/i18n/locales/zh-cn.json index 4370f64543..bccc8b19ae 100644 --- a/src/renderer/src/i18n/locales/zh-cn.json +++ b/src/renderer/src/i18n/locales/zh-cn.json @@ -295,8 +295,8 @@ "status_pending": "等待中", "status_processing": "处理中", "threshold": "匹配度阈值", - "threshold_tooltip": "用于衡量用户问题与知识库内容之间的相关性", - "threshold_placeholder": "默认值(0.0)", + "threshold_tooltip": "用于衡量用户问题与知识库内容之间的相关性(0-1)", + "threshold_placeholder": "未设置", "threshold_too_large_or_small": "阈值不能大于1或小于0", "title": "知识库", "url_added": "网址已添加", @@ -773,4 +773,4 @@ "title": "帮助文档" } } -} \ No newline at end of file +} diff --git a/src/renderer/src/i18n/locales/zh-tw.json b/src/renderer/src/i18n/locales/zh-tw.json index 523c8e6cc6..2c6e97dd7d 100644 --- a/src/renderer/src/i18n/locales/zh-tw.json +++ b/src/renderer/src/i18n/locales/zh-tw.json @@ -297,8 +297,8 @@ "url_added": "網址已添加", "url_placeholder": "請輸入網址, 多個網址用回車分隔", "urls": "網址", - "threshold_tooltip": "匹配度閾值", - "threshold_placeholder": "預設值(0.0)", + "threshold_tooltip": "用於衡量用戶問題與知識庫內容之間的相關性(0-1)", + "threshold_placeholder": "未設置", "threshold_too_large_or_small": "閾值不能大於1或小於0", "no_match": "未匹配到知識庫內容", "threshold": "匹配度閾值" diff --git a/src/renderer/src/pages/knowledge/components/KnowledgeSettingsPopup.tsx b/src/renderer/src/pages/knowledge/components/KnowledgeSettingsPopup.tsx index 8dc16e1d4f..3a1e2b18a0 100644 --- a/src/renderer/src/pages/knowledge/components/KnowledgeSettingsPopup.tsx +++ b/src/renderer/src/pages/knowledge/components/KnowledgeSettingsPopup.tsx @@ -68,7 +68,7 @@ const PopupContainer: React.FC = ({ base: _base, resolve }) => { documentCount: values.documentCount || DEFAULT_KNOWLEDGE_DOCUMENT_COUNT, chunkSize: values.chunkSize, chunkOverlap: values.chunkOverlap, - threshold: values.threshold + threshold: values.threshold ?? undefined } updateKnowledgeBase(newBase) setOpen(false) @@ -191,7 +191,7 @@ const PopupContainer: React.FC = ({ base: _base, resolve }) => { } } ]}> - + } />