diff --git a/web/src/locales/en.ts b/web/src/locales/en.ts index 9d2f8e606..c5c850b11 100644 --- a/web/src/locales/en.ts +++ b/web/src/locales/en.ts @@ -325,6 +325,7 @@ When you want to search the given knowledge base at first place, set a higher pa ellipse: 'Ellipse', graph: 'Knowledge graph', mind: 'Mind map', + question: 'Question', }, chat: { newConversation: 'New conversation', diff --git a/web/src/locales/zh-traditional.ts b/web/src/locales/zh-traditional.ts index c3cc5e1c6..311b40833 100644 --- a/web/src/locales/zh-traditional.ts +++ b/web/src/locales/zh-traditional.ts @@ -309,6 +309,7 @@ export default { ellipse: '省略', graph: '知識圖譜', mind: '心智圖', + question: '問題', }, chat: { newConversation: '新會話', diff --git a/web/src/locales/zh.ts b/web/src/locales/zh.ts index 29a03b330..e4fc4a8b8 100644 --- a/web/src/locales/zh.ts +++ b/web/src/locales/zh.ts @@ -326,6 +326,7 @@ export default { ellipse: '省略', graph: '知识图谱', mind: '思维导图', + question: '问题', }, chat: { newConversation: '新会话', diff --git a/web/src/pages/add-knowledge/components/knowledge-chunk/components/chunk-creating-modal/index.tsx b/web/src/pages/add-knowledge/components/knowledge-chunk/components/chunk-creating-modal/index.tsx index 791d14ee4..922a1c9a1 100644 --- a/web/src/pages/add-knowledge/components/knowledge-chunk/components/chunk-creating-modal/index.tsx +++ b/web/src/pages/add-knowledge/components/knowledge-chunk/components/chunk-creating-modal/index.tsx @@ -25,6 +25,7 @@ const ChunkCreatingModal: React.FC & kFProps> = ({ const [form] = Form.useForm(); const [checked, setChecked] = useState(false); const [keywords, setKeywords] = useState([]); + const [question, setQuestion] = useState([]); const { removeChunk } = useDeleteChunkByIds(); const { data } = useFetchChunk(chunkId); const { t } = useTranslation(); @@ -35,14 +36,17 @@ const ChunkCreatingModal: React.FC & kFProps> = ({ content_with_weight, important_kwd = [], available_int, + question_kwd = [], } = data.data; form.setFieldsValue({ content: content_with_weight }); setKeywords(important_kwd); + setQuestion(question_kwd); setChecked(available_int === 1); } if (!chunkId) { setKeywords([]); + setQuestion([]); form.setFieldsValue({ content: undefined }); } }, [data, form, chunkId]); @@ -53,6 +57,7 @@ const ChunkCreatingModal: React.FC & kFProps> = ({ onOk?.({ content: values.content, keywords, // keywords + question_kwd: question, available_int: checked ? 1 : 0, // available_int }); } catch (errorInfo) { @@ -91,6 +96,10 @@ const ChunkCreatingModal: React.FC & kFProps> = ({

{t('chunk.keyword')} *

+
+

{t('chunk.question')} *

+ +
{chunkId && (
diff --git a/web/src/pages/add-knowledge/components/knowledge-chunk/hooks.ts b/web/src/pages/add-knowledge/components/knowledge-chunk/hooks.ts index 70e3dc364..e5debcb58 100644 --- a/web/src/pages/add-knowledge/components/knowledge-chunk/hooks.ts +++ b/web/src/pages/add-knowledge/components/knowledge-chunk/hooks.ts @@ -99,10 +99,12 @@ export const useUpdateChunk = () => { content, keywords, available_int, + question_kwd, }: { content: string; keywords: string; available_int: number; + question_kwd: string; }) => { const code = await createChunk({ content_with_weight: content, @@ -110,6 +112,7 @@ export const useUpdateChunk = () => { chunk_id: chunkId, important_kwd: keywords, // keywords available_int, + question_kwd, }); if (code === 0) {