balibabu commited on
Commit
36b496a
·
1 Parent(s): d44c6e8

fix: test chunk by @tanstack/react-query #1306 (#1719)

Browse files

### What problem does this PR solve?

fix: test chunk by @tanstack/react-query #1306

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

web/src/hooks/file-manager-hooks.ts CHANGED
@@ -7,7 +7,10 @@ import { PaginationProps, UploadFile, message } from 'antd';
7
  import React, { useCallback } from 'react';
8
  import { useTranslation } from 'react-i18next';
9
  import { useSearchParams } from 'umi';
10
- import { useGetNextPagination, useHandleSearchChange } from './logic-hooks';
 
 
 
11
  import { useSetPaginationParams } from './route-hook';
12
 
13
  export const useGetFolderId = () => {
@@ -27,7 +30,7 @@ export interface IListResult {
27
 
28
  export const useFetchFileList = (): ResponseType<any> & IListResult => {
29
  const { searchString, handleInputChange } = useHandleSearchChange();
30
- const { pagination, setPagination } = useGetNextPagination();
31
  const id = useGetFolderId();
32
 
33
  const { data, isFetching: loading } = useQuery({
 
7
  import React, { useCallback } from 'react';
8
  import { useTranslation } from 'react-i18next';
9
  import { useSearchParams } from 'umi';
10
+ import {
11
+ useGetPaginationWithRouter,
12
+ useHandleSearchChange,
13
+ } from './logic-hooks';
14
  import { useSetPaginationParams } from './route-hook';
15
 
16
  export const useGetFolderId = () => {
 
30
 
31
  export const useFetchFileList = (): ResponseType<any> & IListResult => {
32
  const { searchString, handleInputChange } = useHandleSearchChange();
33
+ const { pagination, setPagination } = useGetPaginationWithRouter();
34
  const id = useGetFolderId();
35
 
36
  const { data, isFetching: loading } = useQuery({
web/src/hooks/knowledge-hooks.ts CHANGED
@@ -1,11 +1,19 @@
1
  import { useShowDeleteConfirm } from '@/hooks/common-hooks';
2
- import { IKnowledge } from '@/interfaces/database/knowledge';
 
3
  import i18n from '@/locales/config';
4
  import kbService from '@/services/knowledge-service';
5
- import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
 
 
 
 
 
 
6
  import { message } from 'antd';
7
  import { useCallback, useEffect } from 'react';
8
  import { useDispatch, useSearchParams, useSelector } from 'umi';
 
9
 
10
  export const useKnowledgeBaseId = (): string => {
11
  const [searchParams] = useSearchParams();
@@ -217,41 +225,65 @@ export const useUpdateKnowledge = () => {
217
 
218
  //#region Retrieval testing
219
 
220
- export const useTestChunkRetrieval = () => {
221
- const dispatch = useDispatch();
 
222
  const knowledgeBaseId = useKnowledgeBaseId();
 
223
 
224
- const testChunk = useCallback(
225
- (values: any) => {
226
- dispatch({
227
- type: 'testingModel/testDocumentChunk',
228
- payload: {
229
- ...values,
230
- kb_id: knowledgeBaseId,
231
- },
232
- });
233
- },
234
- [dispatch, knowledgeBaseId],
235
- );
236
-
237
- return testChunk;
238
- };
239
-
240
- export const useTestNextChunkRetrieval = () => {
241
  const {
242
  data,
243
  isPending: loading,
244
  mutateAsync,
245
  } = useMutation({
246
- mutationKey: ['testChunk'],
247
- mutationFn: async (canvasIds: string[]) => {
248
- const { data } = await kbService.retrieval_test({ canvasIds });
 
 
 
 
 
249
  if (data.retcode === 0) {
 
 
 
 
 
 
250
  }
251
- return data?.data ?? [];
 
 
 
 
 
 
252
  },
253
  });
254
 
255
- return { data, loading, testChunk: mutateAsync };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  };
257
  //#endregion
 
1
  import { useShowDeleteConfirm } from '@/hooks/common-hooks';
2
+ import { ResponsePostType } from '@/interfaces/database/base';
3
+ import { IKnowledge, ITestingResult } from '@/interfaces/database/knowledge';
4
  import i18n from '@/locales/config';
5
  import kbService from '@/services/knowledge-service';
6
+ import {
7
+ useIsMutating,
8
+ useMutation,
9
+ useMutationState,
10
+ useQuery,
11
+ useQueryClient,
12
+ } from '@tanstack/react-query';
13
  import { message } from 'antd';
14
  import { useCallback, useEffect } from 'react';
15
  import { useDispatch, useSearchParams, useSelector } from 'umi';
16
+ import { useSetPaginationParams } from './route-hook';
17
 
18
  export const useKnowledgeBaseId = (): string => {
19
  const [searchParams] = useSearchParams();
 
225
 
226
  //#region Retrieval testing
227
 
228
+ export const useTestChunkRetrieval = (): ResponsePostType<ITestingResult> & {
229
+ testChunk: (...params: any[]) => void;
230
+ } => {
231
  const knowledgeBaseId = useKnowledgeBaseId();
232
+ const { page, size: pageSize } = useSetPaginationParams();
233
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  const {
235
  data,
236
  isPending: loading,
237
  mutateAsync,
238
  } = useMutation({
239
+ mutationKey: ['testChunk'], // This method is invalid
240
+ mutationFn: async (values: any) => {
241
+ const { data } = await kbService.retrieval_test({
242
+ ...values,
243
+ kb_id: knowledgeBaseId,
244
+ page,
245
+ size: pageSize,
246
+ });
247
  if (data.retcode === 0) {
248
+ const res = data.data;
249
+ return {
250
+ chunks: res.chunks,
251
+ documents: res.doc_aggs,
252
+ total: res.total,
253
+ };
254
  }
255
+ return (
256
+ data?.data ?? {
257
+ chunks: [],
258
+ documents: [],
259
+ total: 0,
260
+ }
261
+ );
262
  },
263
  });
264
 
265
+ return {
266
+ data: data ?? { chunks: [], documents: [], total: 0 },
267
+ loading,
268
+ testChunk: mutateAsync,
269
+ };
270
+ };
271
+
272
+ export const useChunkIsTesting = () => {
273
+ return useIsMutating({ mutationKey: ['testChunk'] }) > 0;
274
+ };
275
+
276
+ export const useSelectTestingResult = (): ITestingResult => {
277
+ const data = useMutationState({
278
+ filters: { mutationKey: ['testChunk'] },
279
+ select: (mutation) => {
280
+ return mutation.state.data;
281
+ },
282
+ });
283
+ return (data.at(-1) ?? {
284
+ chunks: [],
285
+ documents: [],
286
+ total: 0,
287
+ }) as ITestingResult;
288
  };
289
  //#endregion
web/src/hooks/logic-hooks.ts CHANGED
@@ -95,7 +95,7 @@ export const useChangeLanguage = () => {
95
  return changeLanguage;
96
  };
97
 
98
- export const useGetNextPagination = () => {
99
  const { t } = useTranslate('common');
100
  const {
101
  setPaginationParams,
@@ -136,29 +136,32 @@ export const useGetNextPagination = () => {
136
  };
137
  };
138
 
139
- export const useGetPagination = (
140
- total: number,
141
- page: number,
142
- pageSize: number,
143
- onPageChange: PaginationProps['onChange'],
144
- ) => {
145
  const { t } = useTranslate('common');
146
 
147
- const pagination: PaginationProps = useMemo(() => {
 
 
 
 
 
 
 
148
  return {
149
  showQuickJumper: true,
150
- total,
151
  showSizeChanger: true,
152
- current: page,
153
- pageSize: pageSize,
154
  pageSizeOptions: [1, 2, 10, 20, 50, 100],
155
  onChange: onPageChange,
156
  showTotal: (total) => `${t('total')} ${total}`,
157
  };
158
- }, [t, onPageChange, page, pageSize, total]);
159
 
160
  return {
161
- pagination,
162
  };
163
  };
164
 
 
95
  return changeLanguage;
96
  };
97
 
98
+ export const useGetPaginationWithRouter = () => {
99
  const { t } = useTranslate('common');
100
  const {
101
  setPaginationParams,
 
136
  };
137
  };
138
 
139
+ export const useGetPagination = () => {
140
+ const [pagination, setPagination] = useState({ page: 1, pageSize: 10 });
 
 
 
 
141
  const { t } = useTranslate('common');
142
 
143
+ const onPageChange: PaginationProps['onChange'] = useCallback(
144
+ (pageNumber: number, pageSize: number) => {
145
+ setPagination({ page: pageNumber, pageSize });
146
+ },
147
+ [],
148
+ );
149
+
150
+ const currentPagination: PaginationProps = useMemo(() => {
151
  return {
152
  showQuickJumper: true,
153
+ total: 0,
154
  showSizeChanger: true,
155
+ current: pagination.page,
156
+ pageSize: pagination.pageSize,
157
  pageSizeOptions: [1, 2, 10, 20, 50, 100],
158
  onChange: onPageChange,
159
  showTotal: (total) => `${t('total')} ${total}`,
160
  };
161
+ }, [t, onPageChange, pagination]);
162
 
163
  return {
164
+ pagination: currentPagination,
165
  };
166
  };
167
 
web/src/interfaces/database/base.ts CHANGED
@@ -9,3 +9,9 @@ export interface ResponseGetType<T = any> {
9
  data: T;
10
  loading?: boolean;
11
  }
 
 
 
 
 
 
 
9
  data: T;
10
  loading?: boolean;
11
  }
12
+
13
+ export interface ResponsePostType<T = any> {
14
+ data: T;
15
+ loading?: boolean;
16
+ [key: string]: unknown;
17
+ }
web/src/interfaces/database/knowledge.ts CHANGED
@@ -107,6 +107,6 @@ export interface ITestingDocument {
107
 
108
  export interface ITestingResult {
109
  chunks: ITestingChunk[];
110
- doc_aggs: Record<string, number>;
111
  total: number;
112
  }
 
107
 
108
  export interface ITestingResult {
109
  chunks: ITestingChunk[];
110
+ documents: ITestingDocument[];
111
  total: number;
112
  }
web/src/pages/add-knowledge/components/knowledge-testing/index.tsx CHANGED
@@ -1,7 +1,5 @@
1
  import { useTestChunkRetrieval } from '@/hooks/knowledge-hooks';
2
  import { Flex, Form } from 'antd';
3
- import { useEffect } from 'react';
4
- import { useDispatch } from 'umi';
5
  import TestingControl from './testing-control';
6
  import TestingResult from './testing-result';
7
 
@@ -9,24 +7,17 @@ import styles from './index.less';
9
 
10
  const KnowledgeTesting = () => {
11
  const [form] = Form.useForm();
12
- const testChunk = useTestChunkRetrieval();
13
 
14
- const dispatch = useDispatch();
15
-
16
- const handleTesting = async () => {
17
  const values = await form.validateFields();
18
  testChunk({
19
  ...values,
 
20
  vector_similarity_weight: 1 - values.vector_similarity_weight,
21
  });
22
  };
23
 
24
- useEffect(() => {
25
- return () => {
26
- dispatch({ type: 'testingModel/reset' });
27
- };
28
- }, [dispatch]);
29
-
30
  return (
31
  <Flex className={styles.testingWrapper} gap={16}>
32
  <TestingControl
 
1
  import { useTestChunkRetrieval } from '@/hooks/knowledge-hooks';
2
  import { Flex, Form } from 'antd';
 
 
3
  import TestingControl from './testing-control';
4
  import TestingResult from './testing-result';
5
 
 
7
 
8
  const KnowledgeTesting = () => {
9
  const [form] = Form.useForm();
10
+ const { testChunk } = useTestChunkRetrieval();
11
 
12
+ const handleTesting = async (documentIds: string[] = []) => {
 
 
13
  const values = await form.validateFields();
14
  testChunk({
15
  ...values,
16
+ doc_ids: Array.isArray(documentIds) ? documentIds : [],
17
  vector_similarity_weight: 1 - values.vector_similarity_weight,
18
  });
19
  };
20
 
 
 
 
 
 
 
21
  return (
22
  <Flex className={styles.testingWrapper} gap={16}>
23
  <TestingControl
web/src/pages/add-knowledge/components/knowledge-testing/model.ts DELETED
@@ -1,72 +0,0 @@
1
- import { BaseState } from '@/interfaces/common';
2
- import {
3
- ITestingChunk,
4
- ITestingDocument,
5
- } from '@/interfaces/database/knowledge';
6
- import kbService from '@/services/knowledge-service';
7
- import { DvaModel } from 'umi';
8
-
9
- export interface TestingModelState extends Pick<BaseState, 'pagination'> {
10
- chunks: ITestingChunk[];
11
- documents: ITestingDocument[];
12
- total: number;
13
- selectedDocumentIds: string[] | undefined;
14
- }
15
-
16
- const initialState = {
17
- chunks: [],
18
- documents: [],
19
- total: 0,
20
- pagination: {
21
- current: 1,
22
- pageSize: 10,
23
- },
24
- selectedDocumentIds: undefined,
25
- };
26
-
27
- const model: DvaModel<TestingModelState> = {
28
- namespace: 'testingModel',
29
- state: initialState,
30
- reducers: {
31
- setChunksAndDocuments(state, { payload }) {
32
- return {
33
- ...state,
34
- ...payload,
35
- };
36
- },
37
- setPagination(state, { payload }) {
38
- return { ...state, pagination: { ...state.pagination, ...payload } };
39
- },
40
- setSelectedDocumentIds(state, { payload }) {
41
- return { ...state, selectedDocumentIds: payload };
42
- },
43
- reset() {
44
- return initialState;
45
- },
46
- },
47
- effects: {
48
- *testDocumentChunk({ payload = {} }, { call, put, select }) {
49
- const { pagination, selectedDocumentIds }: TestingModelState =
50
- yield select((state: any) => state.testingModel);
51
-
52
- const { data } = yield call(kbService.retrieval_test, {
53
- ...payload,
54
- doc_ids: selectedDocumentIds,
55
- page: pagination.current,
56
- size: pagination.pageSize,
57
- });
58
- const { retcode, data: res } = data;
59
- if (retcode === 0) {
60
- yield put({
61
- type: 'setChunksAndDocuments',
62
- payload: {
63
- chunks: res.chunks,
64
- documents: res.doc_aggs,
65
- total: res.total,
66
- },
67
- });
68
- }
69
- },
70
- },
71
- };
72
- export default model;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
web/src/pages/add-knowledge/components/knowledge-testing/testing-control/index.tsx CHANGED
@@ -1,10 +1,10 @@
1
  import Rerank from '@/components/rerank';
2
  import SimilaritySlider from '@/components/similarity-slider';
3
  import { useTranslate } from '@/hooks/common-hooks';
4
- import { useOneNamespaceEffectsLoading } from '@/hooks/store-hooks';
5
  import { Button, Card, Divider, Flex, Form, Input } from 'antd';
6
  import { FormInstance } from 'antd/lib';
7
 
 
8
  import styles from './index.less';
9
 
10
  type FieldType = {
@@ -20,9 +20,7 @@ interface IProps {
20
 
21
  const TestingControl = ({ form, handleTesting }: IProps) => {
22
  const question = Form.useWatch('question', { form, preserve: true });
23
- const loading = useOneNamespaceEffectsLoading('testingModel', [
24
- 'testDocumentChunk',
25
- ]);
26
  const { t } = useTranslate('knowledgeDetails');
27
 
28
  const buttonDisabled =
 
1
  import Rerank from '@/components/rerank';
2
  import SimilaritySlider from '@/components/similarity-slider';
3
  import { useTranslate } from '@/hooks/common-hooks';
 
4
  import { Button, Card, Divider, Flex, Form, Input } from 'antd';
5
  import { FormInstance } from 'antd/lib';
6
 
7
+ import { useChunkIsTesting } from '@/hooks/knowledge-hooks';
8
  import styles from './index.less';
9
 
10
  type FieldType = {
 
20
 
21
  const TestingControl = ({ form, handleTesting }: IProps) => {
22
  const question = Form.useWatch('question', { form, preserve: true });
23
+ const loading = useChunkIsTesting();
 
 
24
  const { t } = useTranslate('knowledgeDetails');
25
 
26
  const buttonDisabled =
web/src/pages/add-knowledge/components/knowledge-testing/testing-result/index.tsx CHANGED
@@ -12,10 +12,11 @@ import {
12
  Space,
13
  } from 'antd';
14
  import camelCase from 'lodash/camelCase';
15
- import { useDispatch, useSelector } from 'umi';
16
- import { TestingModelState } from '../model';
17
  import SelectFiles from './select-files';
18
 
 
 
 
19
  import styles from './index.less';
20
 
21
  const similarityList: Array<{ field: keyof ITestingChunk; label: string }> = [
@@ -41,29 +42,28 @@ const ChunkTitle = ({ item }: { item: ITestingChunk }) => {
41
  };
42
 
43
  interface IProps {
44
- handleTesting: () => Promise<any>;
45
  }
46
 
47
  const TestingResult = ({ handleTesting }: IProps) => {
48
- const {
49
- documents,
50
- chunks,
51
- total,
52
- pagination,
53
- selectedDocumentIds,
54
- }: TestingModelState = useSelector((state: any) => state.testingModel);
55
- const dispatch = useDispatch();
56
  const { t } = useTranslate('knowledgeDetails');
 
57
 
58
  const onChange: PaginationProps['onChange'] = (pageNumber, pageSize) => {
59
- console.log('Page: ', pageNumber, pageSize);
60
- dispatch({
61
- type: 'testingModel/setPagination',
62
- payload: { current: pageNumber, pageSize },
63
- });
64
- handleTesting();
65
  };
66
 
 
 
 
 
 
 
 
 
67
  return (
68
  <section className={styles.testingResultWrapper}>
69
  <Collapse
@@ -94,7 +94,10 @@ const TestingResult = ({ handleTesting }: IProps) => {
94
  ),
95
  children: (
96
  <div>
97
- <SelectFiles handleTesting={handleTesting}></SelectFiles>
 
 
 
98
  </div>
99
  ),
100
  },
@@ -128,12 +131,9 @@ const TestingResult = ({ handleTesting }: IProps) => {
128
  ))}
129
  </Flex>
130
  <Pagination
 
131
  size={'small'}
132
- showQuickJumper
133
- current={pagination.current}
134
- pageSize={pagination.pageSize}
135
  total={total}
136
- showSizeChanger
137
  onChange={onChange}
138
  />
139
  </section>
 
12
  Space,
13
  } from 'antd';
14
  import camelCase from 'lodash/camelCase';
 
 
15
  import SelectFiles from './select-files';
16
 
17
+ import { useSelectTestingResult } from '@/hooks/knowledge-hooks';
18
+ import { useGetPaginationWithRouter } from '@/hooks/logic-hooks';
19
+ import { useCallback, useState } from 'react';
20
  import styles from './index.less';
21
 
22
  const similarityList: Array<{ field: keyof ITestingChunk; label: string }> = [
 
42
  };
43
 
44
  interface IProps {
45
+ handleTesting: (documentIds?: string[]) => Promise<any>;
46
  }
47
 
48
  const TestingResult = ({ handleTesting }: IProps) => {
49
+ const [selectedDocumentIds, setSelectedDocumentIds] = useState<string[]>([]);
50
+ const { documents, chunks, total } = useSelectTestingResult();
 
 
 
 
 
 
51
  const { t } = useTranslate('knowledgeDetails');
52
+ const { pagination, setPagination } = useGetPaginationWithRouter();
53
 
54
  const onChange: PaginationProps['onChange'] = (pageNumber, pageSize) => {
55
+ pagination.onChange?.(pageNumber, pageSize);
56
+ handleTesting(selectedDocumentIds);
 
 
 
 
57
  };
58
 
59
+ const onTesting = useCallback(
60
+ (ids: string[]) => {
61
+ setPagination({ page: 1 });
62
+ handleTesting(ids);
63
+ },
64
+ [setPagination, handleTesting],
65
+ );
66
+
67
  return (
68
  <section className={styles.testingResultWrapper}>
69
  <Collapse
 
94
  ),
95
  children: (
96
  <div>
97
+ <SelectFiles
98
+ setSelectedDocumentIds={setSelectedDocumentIds}
99
+ handleTesting={onTesting}
100
+ ></SelectFiles>
101
  </div>
102
  ),
103
  },
 
131
  ))}
132
  </Flex>
133
  <Pagination
134
+ {...pagination}
135
  size={'small'}
 
 
 
136
  total={total}
 
137
  onChange={onChange}
138
  />
139
  </section>
web/src/pages/add-knowledge/components/knowledge-testing/testing-result/select-files.tsx CHANGED
@@ -1,22 +1,19 @@
1
  import NewDocumentLink from '@/components/new-document-link';
2
  import { useTranslate } from '@/hooks/common-hooks';
 
3
  import { ITestingDocument } from '@/interfaces/database/knowledge';
4
  import { EyeOutlined } from '@ant-design/icons';
5
  import { Button, Table, TableProps, Tooltip } from 'antd';
6
- import { useDispatch, useSelector } from 'umi';
7
 
8
  interface IProps {
9
- handleTesting: () => Promise<any>;
 
10
  }
11
 
12
- const SelectFiles = ({ handleTesting }: IProps) => {
13
- const documents: ITestingDocument[] = useSelector(
14
- (state: any) => state.testingModel.documents,
15
- );
16
  const { t } = useTranslate('fileManager');
17
 
18
- const dispatch = useDispatch();
19
-
20
  const columns: TableProps<ITestingDocument>['columns'] = [
21
  {
22
  title: 'Name',
@@ -53,11 +50,8 @@ const SelectFiles = ({ handleTesting }: IProps) => {
53
 
54
  const rowSelection = {
55
  onChange: (selectedRowKeys: React.Key[]) => {
56
- dispatch({
57
- type: 'testingModel/setSelectedDocumentIds',
58
- payload: selectedRowKeys,
59
- });
60
- handleTesting();
61
  },
62
  getCheckboxProps: (record: ITestingDocument) => ({
63
  disabled: record.doc_name === 'Disabled User', // Column configuration not to be checked
 
1
  import NewDocumentLink from '@/components/new-document-link';
2
  import { useTranslate } from '@/hooks/common-hooks';
3
+ import { useSelectTestingResult } from '@/hooks/knowledge-hooks';
4
  import { ITestingDocument } from '@/interfaces/database/knowledge';
5
  import { EyeOutlined } from '@ant-design/icons';
6
  import { Button, Table, TableProps, Tooltip } from 'antd';
 
7
 
8
  interface IProps {
9
+ handleTesting: (ids: string[]) => void;
10
+ setSelectedDocumentIds: (ids: string[]) => void;
11
  }
12
 
13
+ const SelectFiles = ({ setSelectedDocumentIds, handleTesting }: IProps) => {
14
+ const { documents } = useSelectTestingResult();
 
 
15
  const { t } = useTranslate('fileManager');
16
 
 
 
17
  const columns: TableProps<ITestingDocument>['columns'] = [
18
  {
19
  title: 'Name',
 
50
 
51
  const rowSelection = {
52
  onChange: (selectedRowKeys: React.Key[]) => {
53
+ handleTesting(selectedRowKeys as string[]);
54
+ setSelectedDocumentIds(selectedRowKeys as string[]);
 
 
 
55
  },
56
  getCheckboxProps: (record: ITestingDocument) => ({
57
  disabled: record.doc_name === 'Disabled User', // Column configuration not to be checked
web/typings.d.ts CHANGED
@@ -1,6 +1,5 @@
1
  import { ChunkModelState } from '@/pages/add-knowledge/components/knowledge-chunk/model';
2
  import { KFModelState } from '@/pages/add-knowledge/components/knowledge-file/model';
3
- import { TestingModelState } from '@/pages/add-knowledge/components/knowledge-testing/model';
4
  import { ChatModelState } from '@/pages/chat/model';
5
 
6
  declare module 'lodash';
@@ -14,7 +13,6 @@ export interface RootState {
14
  chatModel: ChatModelState;
15
  kFModel: KFModelState;
16
  chunkModel: ChunkModelState;
17
- testingModel: TestingModelState;
18
  }
19
 
20
  declare global {
 
1
  import { ChunkModelState } from '@/pages/add-knowledge/components/knowledge-chunk/model';
2
  import { KFModelState } from '@/pages/add-knowledge/components/knowledge-file/model';
 
3
  import { ChatModelState } from '@/pages/chat/model';
4
 
5
  declare module 'lodash';
 
13
  chatModel: ChatModelState;
14
  kFModel: KFModelState;
15
  chunkModel: ChunkModelState;
 
16
  }
17
 
18
  declare global {