You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.tsx 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import { useTestRetrieval } from '@/hooks/use-knowledge-request';
  2. import { useState } from 'react';
  3. import { TopTitle } from '../dataset-title';
  4. import TestingForm from './testing-form';
  5. import { TestingResult } from './testing-result';
  6. export default function RetrievalTesting() {
  7. const {
  8. loading,
  9. setValues,
  10. refetch,
  11. data,
  12. onPaginationChange,
  13. page,
  14. pageSize,
  15. handleFilterSubmit,
  16. filterValue,
  17. } = useTestRetrieval();
  18. const [count] = useState(1);
  19. return (
  20. <div className="p-5">
  21. <section className="flex justify-between items-center">
  22. <TopTitle
  23. title={'Retrieval testing'}
  24. description={`Conduct a retrieval test to check if RAGFlow can recover the intended content for the LLM.`}
  25. ></TopTitle>
  26. {/* <Button>Save as Preset</Button> */}
  27. </section>
  28. {count === 1 ? (
  29. <section className="flex divide-x h-full">
  30. <div className="p-4 flex-1">
  31. <div className="flex justify-between pb-2.5">
  32. <span className="text-text-primary font-semibold text-2xl">
  33. Test setting
  34. </span>
  35. {/* <Button variant={'outline'} onClick={addCount}>
  36. <Plus /> Add New Test
  37. </Button> */}
  38. </div>
  39. <TestingForm
  40. loading={loading}
  41. setValues={setValues}
  42. refetch={refetch}
  43. ></TestingForm>
  44. </div>
  45. <TestingResult
  46. data={data}
  47. page={page}
  48. pageSize={pageSize}
  49. filterValue={filterValue}
  50. handleFilterSubmit={handleFilterSubmit}
  51. onPaginationChange={onPaginationChange}
  52. ></TestingResult>
  53. </section>
  54. ) : (
  55. <section className="flex gap-2">
  56. <div className="flex-1">
  57. <TestingForm
  58. loading={loading}
  59. setValues={setValues}
  60. refetch={refetch}
  61. ></TestingForm>
  62. <TestingResult
  63. data={data}
  64. page={page}
  65. pageSize={pageSize}
  66. filterValue={filterValue}
  67. handleFilterSubmit={handleFilterSubmit}
  68. onPaginationChange={onPaginationChange}
  69. ></TestingResult>
  70. </div>
  71. <div className="flex-1">
  72. <TestingForm
  73. loading={loading}
  74. setValues={setValues}
  75. refetch={refetch}
  76. ></TestingForm>
  77. <TestingResult
  78. data={data}
  79. page={page}
  80. pageSize={pageSize}
  81. filterValue={filterValue}
  82. handleFilterSubmit={handleFilterSubmit}
  83. onPaginationChange={onPaginationChange}
  84. ></TestingResult>
  85. </div>
  86. </section>
  87. )}
  88. </div>
  89. );
  90. }