Skip to content

Commit 72d9833

Browse files
feat: paragraph
1 parent ba078a9 commit 72d9833

File tree

12 files changed

+213
-156
lines changed

12 files changed

+213
-156
lines changed

ui/src/api/knowledge/document.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,29 @@ Object.defineProperty(prefix, 'value', {
1414
})
1515

1616
/**
17-
* 文档分页列表
17+
* 文档列表(无分页)
1818
* @param 参数 knowledge_id,
1919
* param {
2020
" name": "string",
2121
}
2222
*/
2323

24+
const getDocumentList: (knowledge_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
25+
knowledge_id,
26+
loading,
27+
) => {
28+
return get(`${prefix.value}/${knowledge_id}/document`, undefined, loading)
29+
}
30+
31+
/**
32+
* 文档分页列表
33+
* @param 参数 knowledge_id,
34+
* param {
35+
"name": "string",
36+
folder_id: "string",
37+
}
38+
*/
39+
2440
const getDocumentPage: (
2541
knowledge_id: string,
2642
page: pageRequest,
@@ -549,15 +565,9 @@ const importLarkDocument: (
549565
return post(`${prefix.value}/lark/${knowledge_id}/import`, data, null, loading)
550566
}
551567

552-
// todo
553-
const getAllDocument: (knowledge_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
554-
knowledge_id,
555-
loading,
556-
) => {
557-
return get(`${prefix.value}/${knowledge_id}/document`, undefined, loading)
558-
}
559568

560569
export default {
570+
getDocumentList,
561571
getDocumentPage,
562572
getDocumentDetail,
563573
putDocument,

ui/src/api/knowledge/paragraph.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ const putBatchGenerateRelated: (
239239
/**
240240
* 批量迁移段落
241241
* @param 参数 knowledge_id,target_knowledge_id,
242+
* {
243+
"id_list": [
244+
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
245+
]
246+
}
242247
*/
243248
const putMigrateMulParagraph: (
244249
knowledge_id: string,

ui/src/components/generate-related-dialog/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
width="650"
66
:close-on-click-modal="false"
77
:close-on-press-escape="false"
8+
@click.stop
89
>
910
<div class="content-height">
1011
<el-form

ui/src/locales/lang/en-US/views/document.ts

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ export default {
44
syncDocument: 'Sync Document',
55
selected: 'Selected',
66
items: 'Items',
7+
migrateDocument: 'Migrate to',
78
searchBar: {
8-
placeholder: 'Search by document name'
9+
placeholder: 'Search by document name',
910
},
1011
setting: {
1112
migration: 'Move',
1213
cancelGenerateQuestion: 'Cancel Generating Questions',
1314
cancelVectorization: 'Cancel Vectorization',
1415
cancelGenerate: 'Cancel Generation',
15-
export: 'Export to'
16+
export: 'Export to',
1617
},
1718
tip: {
1819
saveMessage: 'Current changes have not been saved. Confirm exit?',
@@ -21,7 +22,7 @@ export default {
2122
vectorizationSuccess: 'Successful',
2223
nameMessage: 'Document name cannot be empty!',
2324
importMessage: 'Successful',
24-
migrationSuccess: 'Successful'
25+
migrationSuccess: 'Successful',
2526
},
2627
upload: {
2728
selectFile: 'Select File',
@@ -34,71 +35,71 @@ export default {
3435
errorMessage3: 'File cannot be empty',
3536
errorMessage4: 'Up to 50 files can be uploaded at once',
3637
template: 'Template',
37-
download: 'Download'
38+
download: 'Download',
3839
},
3940

4041
fileType: {
4142
txt: {
4243
label: 'Text File',
4344
tip1: '1. It is recommended to standardize the segment markers in the file before uploading.',
44-
tip2: '2. Up to 50 files can be uploaded at once, with each file not exceeding 100MB.'
45+
tip2: '2. Up to 50 files can be uploaded at once, with each file not exceeding 100MB.',
4546
},
4647
table: {
4748
label: 'Table',
4849
tip1: '1. Click to download the corresponding template and complete the information:',
4950
tip2: '2. The first row must be column headers, and the column headers must be meaningful terms. Each record in the table will be treated as a segment.',
5051
tip3: '3. Each sheet in the uploaded spreadsheet file will be treated as a document, with the sheet name as the document name.',
51-
tip4: '4. Up to 50 files can be uploaded at once, with each file not exceeding 100MB.'
52+
tip4: '4. Up to 50 files can be uploaded at once, with each file not exceeding 100MB.',
5253
},
5354
QA: {
5455
label: 'QA Pairs',
5556
tip1: '1. Click to download the corresponding template and complete the information:',
5657
tip2: '2. Each sheet in the uploaded spreadsheet file will be treated as a document, with the sheet name as the document name.',
57-
tip3: '3. Up to 50 files can be uploaded at once, with each file not exceeding 100MB.'
58-
}
58+
tip3: '3. Up to 50 files can be uploaded at once, with each file not exceeding 100MB.',
59+
},
5960
},
6061
setRules: {
6162
title: {
6263
setting: 'Set Segment Rules',
63-
preview: 'Preview'
64+
preview: 'Preview',
6465
},
6566
intelligent: {
6667
label: 'Automatic Segmentation (Recommended)',
67-
text: 'If you are unsure how to set segmentation rules, it is recommended to use automatic segmentation.'
68+
text: 'If you are unsure how to set segmentation rules, it is recommended to use automatic segmentation.',
6869
},
6970
advanced: {
7071
label: 'Advanced Segmentation',
71-
text: 'Users can customize segmentation delimiters, segment length, and cleaning rules based on document standards.'
72+
text: 'Users can customize segmentation delimiters, segment length, and cleaning rules based on document standards.',
7273
},
7374
patterns: {
7475
label: 'Segment Delimiters',
7576
tooltip:
7677
'Recursively split according to the selected symbols in order. If the split result exceeds the segment length, it will be truncated to the segment length.',
77-
placeholder: 'Please select'
78+
placeholder: 'Please select',
7879
},
7980
limit: {
80-
label: 'Segment Length'
81+
label: 'Segment Length',
8182
},
8283
with_filter: {
8384
label: 'Auto Clean',
84-
text: 'Remove duplicate extra symbols, spaces, blank lines, and tab words.'
85+
text: 'Remove duplicate extra symbols, spaces, blank lines, and tab words.',
8586
},
8687
checkedConnect: {
87-
label: 'Add "Related Questions" section for question-based QA pairs during import.'
88-
}
88+
label: 'Add "Related Questions" section for question-based QA pairs during import.',
89+
},
8990
},
9091
buttons: {
9192
prev: 'Previous',
9293
next: 'Next',
9394
import: 'Start Import',
94-
preview: 'Apply'
95+
preview: 'Apply',
9596
},
9697
table: {
9798
name: 'Document Name',
9899
char_length: 'Character',
99100
paragraph: 'Segment',
100101
all: 'All',
101-
updateTime: 'Update Time'
102+
updateTime: 'Update Time',
102103
},
103104
fileStatus: {
104105
label: 'File Status',
@@ -109,20 +110,20 @@ export default {
109110
GENERATE: 'Generating',
110111
SYNC: 'Syncing',
111112
REVOKE: 'Cancelling',
112-
finish: 'Finish'
113+
finish: 'Finish',
113114
},
114115
enableStatus: {
115116
label: 'Status',
116117
enable: 'Enabled',
117-
close: 'Disabled'
118+
close: 'Disabled',
118119
},
119120
sync: {
120121
label: 'Sync',
121122
confirmTitle: 'Confirm sync document?',
122123
confirmMessage1:
123124
'Syncing will delete existing data and retrieve new data. Please proceed with caution.',
124125
confirmMessage2: 'Cannot sync, please set the document URL first.',
125-
successMessage: 'Successful'
126+
successMessage: 'Successful',
126127
},
127128
delete: {
128129
confirmTitle1: 'Confirm batch deletion of',
@@ -132,31 +133,31 @@ export default {
132133
successMessage: 'Successful',
133134
confirmTitle3: 'Confirm deleting document:',
134135
confirmMessage1: 'Under this document',
135-
confirmMessage2: 'All segments will be deleted, please operate with caution. '
136+
confirmMessage2: 'All segments will be deleted, please operate with caution. ',
136137
},
137138
form: {
138139
source_url: {
139140
label: 'Document URL',
140141
placeholder: 'Enter document URL, one per line. Incorrect URL will cause import failure.',
141-
requiredMessage: 'Please enter a document URL'
142+
requiredMessage: 'Please enter a document URL',
142143
},
143144
selector: {
144145
label: 'Selector',
145-
placeholder: 'Default is body, you can input .classname/#idname/tagname'
146+
placeholder: 'Default is body, you can input .classname/#idname/tagname',
146147
},
147148
hit_handling_method: {
148149
label: 'Retrieve-Respond',
149-
tooltip: 'When user asks a question, handle matched segments according to the set method.'
150+
tooltip: 'When user asks a question, handle matched segments according to the set method.',
150151
},
151152
similarity: {
152153
label: 'Similarity Higher Than',
153154
placeholder: 'Directly return segment content',
154-
requiredMessage: 'Please enter similarity value'
155-
}
155+
requiredMessage: 'Please enter similarity value',
156+
},
156157
},
157158
hitHandlingMethod: {
158159
optimization: 'Model optimization',
159-
directly_return: 'Respond directly'
160+
directly_return: 'Respond directly',
160161
},
161162
generateQuestion: {
162163
title: 'Generate Questions',
@@ -167,12 +168,12 @@ export default {
167168
tip4: 'The generation effect depends on the selected model and prompt. Users can adjust to achieve the best effect.',
168169
prompt1:
169170
'Content: {data}\n \n Please summarize the above and generate 5 questions based on the summary. \nAnswer requirements: \n - Please output only questions; \n - Please place each question in',
170-
prompt2: 'tag.'
171+
prompt2: 'tag.',
171172
},
172173
feishu: {
173174
selectDocument: 'Select Document',
174175
tip1: 'Only documents and tables are supported. Documents will be segmented based on titles, and tables will be converted to Markdown format before segmentation.',
175176
tip2: 'The system does not store the original document. Before importing the document, it is recommended to standardize the document segmentation markers.',
176-
allCheck: 'Select All'
177-
}
177+
allCheck: 'Select All',
178+
},
178179
}

ui/src/locales/lang/zh-CN/views/document.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export default {
44
syncDocument: '同步文档',
55
selected: '已选',
66
items: '项',
7+
migrateDocument:'文档迁移到',
78
searchBar: {
89
placeholder: '按 文档名称 搜索'
910
},

0 commit comments

Comments
 (0)