feat: add pages to ChunkMethodModal (#143)

This commit is contained in:
balibabu
2024-03-22 16:57:09 +08:00
committed by GitHub
parent 1edbd36baf
commit 2f4c71b4b4
36 changed files with 1036 additions and 1322 deletions

View File

@ -1,4 +1,5 @@
import { IChunk, IKnowledgeFile } from '@/interfaces/database/knowledge';
import { IChangeParserConfigRequestBody } from '@/interfaces/request/document';
import { api_host } from '@/utils/api';
import { buildChunkHighlights } from '@/utils/documentUtils';
import { useCallback, useMemo } from 'react';
@ -117,7 +118,11 @@ export const useSetDocumentParser = () => {
const { knowledgeId } = useGetKnowledgeSearchParams();
const setDocumentParser = useCallback(
(parserId: string, documentId: string) => {
(
parserId: string,
documentId: string,
parserConfig: IChangeParserConfigRequestBody,
) => {
try {
return dispatch<any>({
type: 'kFModel/document_change_parser',
@ -125,6 +130,7 @@ export const useSetDocumentParser = () => {
parser_id: parserId,
doc_id: documentId,
kb_id: knowledgeId,
parser_config: parserConfig,
},
});
} catch (errorInfo) {