feat: add fallback response handling and UI indicators

- Introduced a new `is_fallback` property to track when responses are generated without knowledge base matches.
- Updated the chat components to display fallback hints and indicators in the UI, enhancing user awareness of fallback responses.
- Added translations for fallback hints in multiple languages, improving accessibility for diverse users.
- Modified backend logic to emit fallback status in response events, ensuring consistent handling across the application.

These changes improve the user experience by providing clear feedback on fallback responses, enhancing the overall interaction with the chat system.
This commit is contained in:
wizardchen
2026-03-04 21:32:19 +08:00
committed by lyingbug
parent 5ae076e22c
commit 44f38ca6c3
16 changed files with 177 additions and 36 deletions
+1
View File
@@ -1528,6 +1528,7 @@ export default {
referencesDocCount: 'Referenced {count} document(s)',
referencesDocAndWebCount: 'Referenced {docCount} document(s) and {webCount} web page(s)',
referenceChunkCount: '{count} chunk(s)',
fallbackHint: 'No relevant content found in knowledge base. Above is a direct response from the model.',
chunkLabel: 'Chunk {index}:',
navigateToDocument: 'View document details',
referenceIconAlt: 'Reference materials icon',
+1
View File
@@ -283,6 +283,7 @@ export default {
referencesDocCount: "{count}개 문서 참조",
referencesDocAndWebCount: "{docCount}개 문서와 {webCount}개 웹페이지 참조",
referenceChunkCount: "{count}개 청크",
fallbackHint: "지식 베이스에서 관련 내용을 찾지 못했습니다. 위는 모델의 직접 응답입니다.",
chunkLabel: "청크 {index}:",
navigateToDocument: "문서 상세 보기",
referenceIconAlt: "참조 내용 아이콘",
+1
View File
@@ -1353,6 +1353,7 @@ export default {
referencesDocCount: 'Использовано {count} документ(ов)',
referencesDocAndWebCount: 'Использовано {docCount} документ(ов) и {webCount} веб-страниц(ы)',
referenceChunkCount: '{count} фрагмент(ов)',
fallbackHint: 'В базе знаний не найдено релевантного содержимого. Выше представлен прямой ответ модели.',
chunkLabel: 'Фрагмент {index}:',
navigateToDocument: 'Просмотр документа',
referenceIconAlt: 'Иконка ссылок на материалы',
+1
View File
@@ -285,6 +285,7 @@ export default {
referencesDocCount: "引用了{count}篇文档",
referencesDocAndWebCount: "引用了{docCount}篇文档和{webCount}条网页",
referenceChunkCount: "{count}个片段",
fallbackHint: "未从知识库中检索到相关内容,以上为模型直接回答",
chunkLabel: "片段{index}:",
navigateToDocument: "查看文档详情",
referenceIconAlt: "参考内容图标",