feat: After selecting the parsing method as knowledge graph, the delimiter and chunk token number are displayed. #1594 (#1929)

### What problem does this PR solve?

feat: After selecting the parsing method as knowledge graph, the
delimiter and chunk token number are displayed. #1594

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-08-13 15:21:03 +08:00
committed by GitHub
parent 77f0fb03e3
commit 7a08e91909
7 changed files with 67 additions and 11 deletions

View File

@ -1,4 +1,6 @@
import { useHandleChunkMethodSelectChange } from '@/hooks/logic-hooks';
import { useSelectParserList } from '@/hooks/user-setting-hooks';
import { FormInstance } from 'antd';
import { useEffect, useMemo, useState } from 'react';
const ParserListMap = new Map([
@ -84,9 +86,11 @@ export const useFetchParserListOnMount = (
documentId: string,
parserId: string,
documentExtension: string,
form: FormInstance,
) => {
const [selectedTag, setSelectedTag] = useState('');
const parserList = useSelectParserList();
const handleChunkMethodSelectChange = useHandleChunkMethodSelectChange(form);
const nextParserList = useMemo(() => {
const key = [...ParserListMap.keys()].find((x) =>
@ -108,7 +112,7 @@ export const useFetchParserListOnMount = (
}, [parserId, documentId]);
const handleChange = (tag: string) => {
// const nextSelectedTag = checked ? tag : selectedTag;
handleChunkMethodSelectChange(tag);
setSelectedTag(tag);
};