feat: Improve knowledge base threshold tooltip and input

This commit is contained in:
kangfenmao 2025-02-16 12:20:08 +08:00
parent 5f2cddee09
commit cbd6a30e14
6 changed files with 13 additions and 13 deletions

View File

@ -297,8 +297,8 @@
"url_added": "URL added", "url_added": "URL added",
"url_placeholder": "Enter URL, multiple URLs separated by Enter", "url_placeholder": "Enter URL, multiple URLs separated by Enter",
"urls": "URLs", "urls": "URLs",
"threshold_tooltip": "Match threshold", "threshold_tooltip": "Used to evaluate the relevance between the user's question and the content in the knowledge base (0-1)",
"threshold_placeholder": "Default value (0.0)", "threshold_placeholder": "Not set",
"threshold_too_large_or_small": "Threshold cannot be greater than 1 or less than 0", "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.", "no_match": "No matching content found in the knowledge base.",
"threshold": "Matching threshold" "threshold": "Matching threshold"

View File

@ -297,8 +297,8 @@
"url_added": "URLが追加されました", "url_added": "URLが追加されました",
"url_placeholder": "URLを入力, 複数のURLはEnterで区切る", "url_placeholder": "URLを入力, 複数のURLはEnterで区切る",
"urls": "URL", "urls": "URL",
"threshold_tooltip": "マッチングしきい値", "threshold_tooltip": "ユーザーの質問と知識ベースの内容の関連性を評価するためのしきい値0-1",
"threshold_placeholder": "デフォルト値(0.0)", "threshold_placeholder": "未設置",
"threshold_too_large_or_small": "しきい値は0より大きく1より小さい必要があります", "threshold_too_large_or_small": "しきい値は0より大きく1より小さい必要があります",
"no_match": "知識ベースの内容が見つかりませんでした。", "no_match": "知識ベースの内容が見つかりませんでした。",
"threshold": "マッチング度閾値" "threshold": "マッチング度閾値"

View File

@ -297,8 +297,8 @@
"url_added": "URL добавлен", "url_added": "URL добавлен",
"url_placeholder": "Введите URL, несколько URL через Enter", "url_placeholder": "Введите URL, несколько URL через Enter",
"urls": "URL-адреса", "urls": "URL-адреса",
"threshold_tooltip": "Порог совпадения", "threshold_tooltip": "Используется для оценки соответствия между пользовательским вопросом и содержимым в базе знаний (0-1)",
"threshold_placeholder": "По умолчанию (0.0)", "threshold_placeholder": "Не установлено",
"threshold_too_large_or_small": "Порог не может быть больше 1 или меньше 0", "threshold_too_large_or_small": "Порог не может быть больше 1 или меньше 0",
"no_match": "Не найдено содержимого в базе знаний.", "no_match": "Не найдено содержимого в базе знаний.",
"threshold": "Порог соответствия" "threshold": "Порог соответствия"

View File

@ -295,8 +295,8 @@
"status_pending": "等待中", "status_pending": "等待中",
"status_processing": "处理中", "status_processing": "处理中",
"threshold": "匹配度阈值", "threshold": "匹配度阈值",
"threshold_tooltip": "用于衡量用户问题与知识库内容之间的相关性", "threshold_tooltip": "用于衡量用户问题与知识库内容之间的相关性0-1",
"threshold_placeholder": "默认值(0.0)", "threshold_placeholder": "未设置",
"threshold_too_large_or_small": "阈值不能大于1或小于0", "threshold_too_large_or_small": "阈值不能大于1或小于0",
"title": "知识库", "title": "知识库",
"url_added": "网址已添加", "url_added": "网址已添加",
@ -773,4 +773,4 @@
"title": "帮助文档" "title": "帮助文档"
} }
} }
} }

View File

@ -297,8 +297,8 @@
"url_added": "網址已添加", "url_added": "網址已添加",
"url_placeholder": "請輸入網址, 多個網址用回車分隔", "url_placeholder": "請輸入網址, 多個網址用回車分隔",
"urls": "網址", "urls": "網址",
"threshold_tooltip": "匹配度閾值", "threshold_tooltip": "用於衡量用戶問題與知識庫內容之間的相關性0-1",
"threshold_placeholder": "預設值(0.0)", "threshold_placeholder": "未設置",
"threshold_too_large_or_small": "閾值不能大於1或小於0", "threshold_too_large_or_small": "閾值不能大於1或小於0",
"no_match": "未匹配到知識庫內容", "no_match": "未匹配到知識庫內容",
"threshold": "匹配度閾值" "threshold": "匹配度閾值"

View File

@ -68,7 +68,7 @@ const PopupContainer: React.FC<Props> = ({ base: _base, resolve }) => {
documentCount: values.documentCount || DEFAULT_KNOWLEDGE_DOCUMENT_COUNT, documentCount: values.documentCount || DEFAULT_KNOWLEDGE_DOCUMENT_COUNT,
chunkSize: values.chunkSize, chunkSize: values.chunkSize,
chunkOverlap: values.chunkOverlap, chunkOverlap: values.chunkOverlap,
threshold: values.threshold threshold: values.threshold ?? undefined
} }
updateKnowledgeBase(newBase) updateKnowledgeBase(newBase)
setOpen(false) setOpen(false)
@ -191,7 +191,7 @@ const PopupContainer: React.FC<Props> = ({ base: _base, resolve }) => {
} }
} }
]}> ]}>
<Input placeholder={t('knowledge.threshold_placeholder')} /> <InputNumber placeholder={t('knowledge.threshold_placeholder')} step={0.1} style={{ width: '100%' }} />
</Form.Item> </Form.Item>
</Form> </Form>
<Alert message={t('knowledge.chunk_size_change_warning')} type="warning" showIcon icon={<WarningOutlined />} /> <Alert message={t('knowledge.chunk_size_change_warning')} type="warning" showIcon icon={<WarningOutlined />} />