chore: remove useless test code

This commit is contained in:
Joel 2024-12-11 18:23:46 +08:00
parent db01c5c89d
commit f2eeaba8d7
2 changed files with 1 additions and 173 deletions

View File

@ -9,7 +9,6 @@ import { omit } from 'lodash-es'
import { RiArrowLeftLine, RiLayoutRight2Line } from '@remixicon/react'
import { OperationAction, StatusItem } from '../list'
import DocumentPicker from '../../common/document-picker'
import PreviewDocumentPicker from '../../common/document-picker/preview-document-picker'
import Completed from './completed'
import Embedding from './embedding'
import Metadata from './metadata'
@ -22,7 +21,7 @@ import Loading from '@/app/components/base/loading'
import type { MetadataType } from '@/service/datasets'
import { checkSegmentBatchImportProgress, fetchDocumentDetail, segmentBatchImport } from '@/service/datasets'
import { ToastContext } from '@/app/components/base/toast'
import type { DocForm, DocumentItem, ParentMode, ProcessMode } from '@/models/datasets'
import type { DocForm, ParentMode, ProcessMode } from '@/models/datasets'
import { useDatasetDetailContext } from '@/context/dataset-detail'
import FloatRightContainer from '@/app/components/base/float-right-container'
import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'
@ -54,21 +53,6 @@ type DocumentTitleProps = {
}
export const DocumentTitle: FC<DocumentTitleProps> = ({ datasetId, extension, name, processMode, parent_mode, wrapperCls }) => {
const testPreviewFiles = [
{
id: '1',
name: 'EOS R3',
extension: 'pdf',
},
{
id: '2',
name: 'EOS R5',
extension: 'pdf',
},
]
const [previewFile, setPreviewFile] = useState<DocumentItem>(testPreviewFiles[0])
return (
<div className={cn('flex items-center justify-start flex-1 cursor-pointer', wrapperCls)}>
{/* // todo: handle file change */}
@ -82,12 +66,6 @@ export const DocumentTitle: FC<DocumentTitleProps> = ({ datasetId, extension, na
}}
onChange={(doc) => { console.log(doc) }}
/>
{/* todo: another document picker demo */}
<PreviewDocumentPicker
value={previewFile}
onChange={setPreviewFile}
files={testPreviewFiles}
/>
</div>
)
}

View File

@ -1,150 +0,0 @@
import type { HitTesting } from '@/models/datasets'
export const generalResultData: HitTesting[] = [
{
segment: {
id: 'b621b153-f8a7-4e85-bd3d-07feaf61bd9e',
position: 1,
document_id: '990c1ba7-a170-42ed-a71f-579e4875eaba',
content: '张家界森林覆盖率达 90%以上,生物多样性丰富。这里是许多珍稀动植物的栖息地,例\r\n如银杉、中华秋沙鸭等。清新的空气和丰富的负氧离子让它成为“ 天然氧吧”。\r\n历史背景\r\n1. 古代历史\r\n张家界地区在古代是土家族和苗族等少数民族的居住地历史可以追溯到新石器时代。\r\n这里曾是楚国的属地后来成为武陵山地区的重要组成部分。\r\n2. 近代发展\r\n张家界介绍\r\n张家界概述\r\n张家界位于中国湖南省西北部是中国知名的旅游胜地以独特的喀斯特地貌和壮美的\r\n自然风光闻名世界。它不仅是自然景观的瑰宝还蕴含了丰富的历史与人文底蕴。\r\n地理特色\r\n1. 地貌特征\r\n张家界以其石英砂岩峰林地貌而著称峰峦如刀劈斧削形态各异被誉为“ 天然山水\r\n画卷”。\r\n• 武陵源风景名胜区\r\n被列入联合国教科文组织世界自然遗产名录其中包括张家界国家森林公园、天子山、\r\n索溪峪等景区。',
answer: null,
word_count: 387,
tokens: 471,
keywords: [
'氧吧',
'丰富',
'90%',
'天子山',
'地貌',
'历史',
'张家界',
'索溪峪',
'天然',
'负氧离子',
],
index_node_id: '483fad87-3b7e-486d-afae-75e4f0b2f3dd',
index_node_hash: '61bb7556a32e3e09ed83f2de731c2ac2d669c598de6d85708e11f78817c882bb',
hit_count: 0,
enabled: true,
disabled_at: null,
disabled_by: null,
status: 'completed',
created_by: '6d8ad01f-edf9-43a6-b863-a034b1828ac7',
created_at: 1732605173,
indexing_at: 1732605173,
completed_at: 1732605177,
error: null,
stopped_at: null,
document: {
id: '990c1ba7-a170-42ed-a71f-579e4875eaba',
data_source_type: 'upload_file',
name: '张家界介绍.pdf',
doc_type: null,
},
},
child_chunks: [
{
id: '1',
score: 0.8771945,
content: 'It is quite natural for academics who are continuously told to “publish or perish” to want to always create something from scratch that is their own fresh creation.',
},
{
id: '2',
score: 0.5,
content: 'It is quite natural for ',
},
],
score: 0.99,
tsne_position: null,
},
{
segment: {
id: '0859a14d-697e-4703-b59d-2ff69a7a9795',
position: 5,
document_id: '990c1ba7-a170-42ed-a71f-579e4875eaba',
content: '茅岩河漂流和黄石寨徒步是体验张家界山水魅力的绝佳方式。\r\n总结\r\n张家界是集自然奇观与人文风情于一体的旅游胜地。无论是其独特的地貌景观还是浓\r\n郁的土家文化都展现了人与自然的和谐之美。这里的每一座山、每一片森林似乎都\r\n在诉说着古老的故事吸引着来自世界各地的游客流连忘返。',
answer: null,
word_count: 140,
tokens: 173,
keywords: [
'绝佳',
'徒步',
'人与自然',
'流连忘返',
'河漂流',
'之美',
'张家界',
'黄石寨',
'诉说着',
'茅岩',
],
index_node_id: '1d8e46bd-27ea-47fa-b8c4-87737bf2e021',
index_node_hash: '8ac318494724ac44120b2f9db397bb02186b456fff76f9f8b86156fb8a864999',
hit_count: 0,
enabled: true,
disabled_at: null,
disabled_by: null,
status: 'completed',
created_by: '6d8ad01f-edf9-43a6-b863-a034b1828ac7',
created_at: 1732605173,
indexing_at: 1732605173,
completed_at: 1732605177,
error: null,
stopped_at: null,
document: {
id: '990c1ba7-a170-42ed-a71f-579e4875eaba',
data_source_type: 'upload_file',
name: '张家界介绍.pdf',
doc_type: null,
},
},
child_chunks: null,
score: 1,
tsne_position: null,
},
{
segment: {
id: 'f5e63d62-984f-419f-a8ec-781e1280c739',
position: 4,
document_id: '990c1ba7-a170-42ed-a71f-579e4875eaba',
content: '葛粉汤\r\n一种用当地葛根制成的食品清热解毒深受游客喜爱。\r\n3. 艺术与传说\r\n张家界的山水常与中国传统文化和神话传说相结合例如天子山据说是土家族起义领袖',
answer: null,
word_count: 80,
tokens: 94,
keywords: [
'葛根',
'清热解毒',
'葛粉',
'天子山',
'起义领袖',
'深受',
'张家界',
'神话传说',
'土家族',
'山水',
],
index_node_id: '80f71f0d-6218-4160-8575-c59d58ac15e3',
index_node_hash: '155ad96a96b984d7058fdb377f98bd50158d58574b75bea0187c9e3af5680ad5',
hit_count: 0,
enabled: true,
disabled_at: null,
disabled_by: null,
status: 'completed',
created_by: '6d8ad01f-edf9-43a6-b863-a034b1828ac7',
created_at: 1732605173,
indexing_at: 1732605173,
completed_at: 1732605177,
error: null,
stopped_at: null,
document: {
id: '990c1ba7-a170-42ed-a71f-579e4875eaba',
data_source_type: 'upload_file',
name: '张家界介绍.pdf',
doc_type: null,
},
},
child_chunks: null,
score: 0.2,
tsne_position: null,
},
]