2025-04-18 16:29:41 +08:00
|
|
|
import { useTestRetrieval } from '@/hooks/use-knowledge-request';
|
2025-05-19 19:34:43 +08:00
|
|
|
import { useCallback, useState } from 'react';
|
2025-05-16 18:56:48 +08:00
|
|
|
import { TopTitle } from '../dataset-title';
|
2024-12-02 19:33:20 +08:00
|
|
|
import TestingForm from './testing-form';
|
2025-05-19 19:34:43 +08:00
|
|
|
import { TestingResult } from './testing-result';
|
2024-12-02 19:33:20 +08:00
|
|
|
|
2025-05-19 19:34:43 +08:00
|
|
|
function Vertical() {
|
|
|
|
|
return <div>xxx</div>;
|
|
|
|
|
}
|
2025-04-18 16:29:41 +08:00
|
|
|
|
2024-11-27 18:06:05 +08:00
|
|
|
export default function RetrievalTesting() {
|
2025-05-16 18:56:48 +08:00
|
|
|
const {
|
|
|
|
|
loading,
|
|
|
|
|
setValues,
|
|
|
|
|
refetch,
|
|
|
|
|
data,
|
|
|
|
|
onPaginationChange,
|
|
|
|
|
page,
|
|
|
|
|
pageSize,
|
|
|
|
|
handleFilterSubmit,
|
2025-05-19 19:34:43 +08:00
|
|
|
filterValue,
|
2025-05-16 18:56:48 +08:00
|
|
|
} = useTestRetrieval();
|
|
|
|
|
|
2025-05-19 19:34:43 +08:00
|
|
|
const [count, setCount] = useState(1);
|
|
|
|
|
|
|
|
|
|
const addCount = useCallback(() => {
|
|
|
|
|
setCount(2);
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
const removeCount = useCallback(() => {
|
|
|
|
|
setCount(1);
|
|
|
|
|
}, []);
|
2025-04-18 16:29:41 +08:00
|
|
|
|
2024-12-02 19:33:20 +08:00
|
|
|
return (
|
2025-05-16 18:56:48 +08:00
|
|
|
<div className="p-5">
|
|
|
|
|
<section className="flex justify-between items-center">
|
|
|
|
|
<TopTitle
|
2025-07-08 19:19:07 +08:00
|
|
|
title={'Retrieval testing'}
|
|
|
|
|
description={`Conduct a retrieval test to check if RAGFlow can recover the intended content for the LLM.`}
|
2025-05-16 18:56:48 +08:00
|
|
|
></TopTitle>
|
2025-06-19 16:40:30 +08:00
|
|
|
{/* <Button>Save as Preset</Button> */}
|
2025-05-16 18:56:48 +08:00
|
|
|
</section>
|
2025-05-19 19:34:43 +08:00
|
|
|
{count === 1 ? (
|
|
|
|
|
<section className="flex divide-x h-full">
|
|
|
|
|
<div className="p-4 flex-1">
|
|
|
|
|
<div className="flex justify-between pb-2.5">
|
|
|
|
|
<span className="text-text-title font-semibold text-2xl">
|
|
|
|
|
Test setting
|
|
|
|
|
</span>
|
2025-06-19 16:40:30 +08:00
|
|
|
{/* <Button variant={'outline'} onClick={addCount}>
|
2025-05-19 19:34:43 +08:00
|
|
|
<Plus /> Add New Test
|
2025-06-19 16:40:30 +08:00
|
|
|
</Button> */}
|
2025-05-19 19:34:43 +08:00
|
|
|
</div>
|
|
|
|
|
<TestingForm
|
|
|
|
|
loading={loading}
|
|
|
|
|
setValues={setValues}
|
|
|
|
|
refetch={refetch}
|
|
|
|
|
></TestingForm>
|
2025-05-16 18:56:48 +08:00
|
|
|
</div>
|
2025-05-19 19:34:43 +08:00
|
|
|
<TestingResult
|
|
|
|
|
data={data}
|
|
|
|
|
page={page}
|
2025-05-16 18:56:48 +08:00
|
|
|
pageSize={pageSize}
|
2025-05-19 19:34:43 +08:00
|
|
|
filterValue={filterValue}
|
|
|
|
|
handleFilterSubmit={handleFilterSubmit}
|
|
|
|
|
onPaginationChange={onPaginationChange}
|
|
|
|
|
></TestingResult>
|
|
|
|
|
</section>
|
|
|
|
|
) : (
|
|
|
|
|
<section className="flex gap-2">
|
|
|
|
|
<div className="flex-1">
|
|
|
|
|
<TestingForm
|
|
|
|
|
loading={loading}
|
|
|
|
|
setValues={setValues}
|
|
|
|
|
refetch={refetch}
|
|
|
|
|
></TestingForm>
|
|
|
|
|
<TestingResult
|
|
|
|
|
data={data}
|
|
|
|
|
page={page}
|
|
|
|
|
pageSize={pageSize}
|
|
|
|
|
filterValue={filterValue}
|
|
|
|
|
handleFilterSubmit={handleFilterSubmit}
|
|
|
|
|
onPaginationChange={onPaginationChange}
|
|
|
|
|
></TestingResult>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flex-1">
|
|
|
|
|
<TestingForm
|
|
|
|
|
loading={loading}
|
|
|
|
|
setValues={setValues}
|
|
|
|
|
refetch={refetch}
|
|
|
|
|
></TestingForm>
|
|
|
|
|
<TestingResult
|
|
|
|
|
data={data}
|
|
|
|
|
page={page}
|
|
|
|
|
pageSize={pageSize}
|
|
|
|
|
filterValue={filterValue}
|
|
|
|
|
handleFilterSubmit={handleFilterSubmit}
|
|
|
|
|
onPaginationChange={onPaginationChange}
|
|
|
|
|
></TestingResult>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
)}
|
2025-05-16 18:56:48 +08:00
|
|
|
</div>
|
2024-12-02 19:33:20 +08:00
|
|
|
);
|
2024-11-27 18:06:05 +08:00
|
|
|
}
|