mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-05-06 10:17:49 +08:00
### 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)
33 lines
929 B
TypeScript
33 lines
929 B
TypeScript
import { useTestChunkRetrieval } from '@/hooks/knowledge-hooks';
|
|
import { Flex, Form } from 'antd';
|
|
import TestingControl from './testing-control';
|
|
import TestingResult from './testing-result';
|
|
|
|
import styles from './index.less';
|
|
|
|
const KnowledgeTesting = () => {
|
|
const [form] = Form.useForm();
|
|
const { testChunk } = useTestChunkRetrieval();
|
|
|
|
const handleTesting = async (documentIds: string[] = []) => {
|
|
const values = await form.validateFields();
|
|
testChunk({
|
|
...values,
|
|
doc_ids: Array.isArray(documentIds) ? documentIds : [],
|
|
vector_similarity_weight: 1 - values.vector_similarity_weight,
|
|
});
|
|
};
|
|
|
|
return (
|
|
<Flex className={styles.testingWrapper} gap={16}>
|
|
<TestingControl
|
|
form={form}
|
|
handleTesting={handleTesting}
|
|
></TestingControl>
|
|
<TestingResult handleTesting={handleTesting}></TestingResult>
|
|
</Flex>
|
|
);
|
|
};
|
|
|
|
export default KnowledgeTesting;
|