Skip to content

Commit d39a27f

Browse files
perf: Knowledge base workflow adjustment
1 parent 9255089 commit d39a27f

File tree

10 files changed

+202
-124
lines changed

10 files changed

+202
-124
lines changed

ui/src/components/ai-chat/component/knowledge-source-component/ExecutionDetailCard.vue

Lines changed: 95 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,105 +1079,112 @@
10791079
</div>
10801080
</div>
10811081
</template>
1082-
<slot></slot>
1083-
</template>
1084-
<!-- 文本文件 -->
1085-
<template v-if="data.type === WorkflowType.DataSourceLocalNode">
1086-
<div class="card-never border-r-6">
1087-
<h5 class="p-8-12">
1088-
{{ $t('common.param.outputParam') }}
1089-
</h5>
1082+
<!-- 文本文件 -->
1083+
<template v-if="data.type === WorkflowType.DataSourceLocalNode">
1084+
<div class="card-never border-r-6">
1085+
<h5 class="p-8-12">
1086+
{{ $t('common.param.outputParam') }}
1087+
</h5>
10901088

1091-
<div class="p-8-12 border-t-dashed lighter">
1092-
<div class="mb-8">
1093-
{{ data.file_list || '-' }}
1089+
<div class="p-8-12 border-t-dashed lighter">
1090+
<div class="mb-8">
1091+
{{ data.file_list || '-' }}
1092+
</div>
10941093
</div>
10951094
</div>
1096-
</div>
1097-
</template>
1098-
<!-- 文档分段 -->
1099-
<template v-if="data.type === WorkflowType.DocumentSplitNode">
1100-
<div class="card-never border-r-6">
1101-
<h5 class="p-8-12">
1102-
{{ $t('common.param.inputParam') }}
1103-
</h5>
1104-
<div class="p-8-12 border-t-dashed lighter">
1105-
<div v-for="(f, i) in data.result_list" :key="i" class="mb-8">
1106-
<span class="color-secondary">{{ f.name }}:</span> {{ f.input_value }}
1095+
</template>
1096+
<!-- 文档分段 -->
1097+
<template v-if="data.type === WorkflowType.DocumentSplitNode">
1098+
<div class="card-never border-r-6">
1099+
<h5 class="p-8-12">
1100+
{{ $t('common.param.inputParam') }}
1101+
</h5>
1102+
<div class="p-8-12 border-t-dashed lighter">
1103+
<div class="mb-8">
1104+
<span class="color-secondary"
1105+
>{{ $t('chat.executionDetails.paragraphRules') }}:</span
1106+
>
1107+
{{ data.split_strategy }}
1108+
</div>
1109+
<div class="mb-8">
1110+
<span class="color-secondary">{{ $t('common.inputContent') }}:</span>
1111+
{{ data.document_list }}
1112+
</div>
11071113
</div>
11081114
</div>
1109-
</div>
1110-
<div class="card-never border-r-6 mt-8">
1111-
<h5 class="p-8-12">
1112-
{{ $t('common.param.outputParam') }}(每个文档仅能预览前五个分段)
1113-
</h5>
1114-
<div class="p-8-12 border-t-dashed lighter">
1115-
<el-radio-group v-model="currentParagraph" class="app-radio-button-group mb-8">
1116-
<template
1117-
v-for="(paragrapg, ParagraphIndex) in data.paragraph_list"
1118-
:key="ParagraphIndex"
1119-
>
1120-
<el-radio-button :label="paragrapg.name" :value="ParagraphIndex" />
1121-
</template>
1122-
</el-radio-group>
1123-
<template v-if="data.paragraph_list?.length > 0">
1124-
<template
1125-
v-for="(paragraph, pId) in data.paragraph_list?.[currentParagraph]?.paragraphs"
1126-
:key="pId"
1127-
>
1128-
<ParagraphCard :data="paragraph" :content="paragraph.content" :index="pId">
1129-
<template #footer>
1130-
<span class="color-secondary">
1131-
{{ $t('common.character') }}:{{ paragraph.content.length }}</span
1132-
>
1133-
</template>
1134-
</ParagraphCard>
1115+
<div class="card-never border-r-6 mt-8">
1116+
<h5 class="p-8-12">
1117+
{{ $t('common.param.outputParam') }}({{ $t('chat.executionDetails.documentSplitTip') }})
1118+
</h5>
1119+
<div class="p-8-12 border-t-dashed lighter">
1120+
<el-radio-group v-model="currentParagraph" class="app-radio-button-group mb-8">
1121+
<template
1122+
v-for="(paragrapg, ParagraphIndex) in data.paragraph_list"
1123+
:key="ParagraphIndex"
1124+
>
1125+
<el-radio-button :label="paragrapg.name" :value="ParagraphIndex" />
1126+
</template>
1127+
</el-radio-group>
1128+
<template v-if="data.paragraph_list?.length > 0">
1129+
<template
1130+
v-for="(paragraph, pId) in data.paragraph_list?.[currentParagraph]?.paragraphs"
1131+
:key="pId"
1132+
>
1133+
<ParagraphCard :data="paragraph" :content="paragraph.content" :index="pId">
1134+
<template #footer>
1135+
<span class="color-secondary">
1136+
{{ $t('common.character') }}:{{ paragraph.content.length }}</span
1137+
>
1138+
</template>
1139+
</ParagraphCard>
1140+
</template>
11351141
</template>
1136-
</template>
1137-
<template v-else> -</template>
1142+
<template v-else> -</template>
1143+
</div>
11381144
</div>
1139-
</div>
1140-
</template>
1141-
<!-- 知识库写入 -->
1142-
<template v-if="data.type === WorkflowType.KnowledgeWriteNode">
1143-
<div class="card-never border-r-6">
1144-
<h5 class="p-8-12">
1145-
{{ $t('common.param.inputParam') }}
1146-
</h5>
1147-
<div class="p-8-12 border-t-dashed lighter">
1148-
<div v-for="(f, i) in data.result_list" :key="i" class="mb-8">
1149-
<span class="color-secondary">{{ f.name }}:</span> {{ f.input_value }}
1145+
</template>
1146+
<!-- 知识库写入 -->
1147+
<template v-if="data.type === WorkflowType.KnowledgeWriteNode">
1148+
<div class="card-never border-r-6">
1149+
<h5 class="p-8-12">
1150+
{{ $t('common.param.inputParam') }}
1151+
</h5>
1152+
<div class="p-8-12 border-t-dashed lighter">
1153+
<span class="color-secondary">{{$t('chat.executionDetails.subBlockLength')}}:</span>
1154+
{{ data.size }}
11501155
</div>
11511156
</div>
1152-
</div>
1153-
<div class="card-never border-r-6 mt-8">
1154-
<h5 class="p-8-12">写入内容</h5>
1155-
<div class="p-8-12 border-t-dashed lighter">
1156-
<el-radio-group v-model="currentWriteContent" class="app-radio-button-group mb-8">
1157-
<template
1158-
v-for="(paragrapg, ParagraphIndex) in data.write_content"
1159-
:key="ParagraphIndex"
1160-
>
1161-
<el-radio-button :label="paragrapg.name" :value="ParagraphIndex" />
1162-
</template>
1163-
</el-radio-group>
1164-
<template v-if="data.write_content?.length > 0">
1165-
<template
1166-
v-for="(paragraph, pId) in data.write_content?.[currentWriteContent]?.paragraphs"
1167-
:key="pId"
1168-
>
1169-
<ParagraphCard :data="paragraph" :content="paragraph.content" :index="pId">
1170-
<template #footer>
1171-
<span class="color-secondary">
1172-
{{ $t('common.character') }}:{{ paragraph.content.length }}</span
1173-
>
1174-
</template>
1175-
</ParagraphCard>
1157+
<div class="card-never border-r-6 mt-8">
1158+
<h5 class="p-8-12">{{$t('chat.executionDetails.writeContent')}}</h5>
1159+
<div class="p-8-12 border-t-dashed lighter">
1160+
<el-radio-group v-model="currentWriteContent" class="app-radio-button-group mb-8">
1161+
<template
1162+
v-for="(paragrapg, ParagraphIndex) in data.write_content"
1163+
:key="ParagraphIndex"
1164+
>
1165+
<el-radio-button :label="paragrapg.name" :value="ParagraphIndex" />
1166+
</template>
1167+
</el-radio-group>
1168+
<template v-if="data.write_content?.length > 0">
1169+
<template
1170+
v-for="(paragraph, pId) in data.write_content?.[currentWriteContent]
1171+
?.paragraphs"
1172+
:key="pId"
1173+
>
1174+
<ParagraphCard :data="paragraph" :content="paragraph.content" :index="pId">
1175+
<template #footer>
1176+
<span class="color-secondary">
1177+
{{ $t('common.character') }}:{{ paragraph.content.length }}</span
1178+
>
1179+
</template>
1180+
</ParagraphCard>
1181+
</template>
11761182
</template>
1177-
</template>
1178-
<template v-else> -</template>
1183+
<template v-else> -</template>
1184+
</div>
11791185
</div>
1180-
</div>
1186+
</template>
1187+
<slot></slot>
11811188
</template>
11821189
<template v-else>
11831190
<div class="card-never border-r-6">

ui/src/locales/lang/en-US/ai-chat.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default {
8585
localUpload: 'Local Upload',
8686
urlPlaceholder: 'Please enter URL addresses, one per line',
8787
urlTitle: 'URL Address',
88-
urlErrorMessage: 'File type does not meet requirements'
88+
urlErrorMessage: 'File type does not meet requirements',
8989
},
9090
executionDetails: {
9191
title: 'Execution Details',
@@ -106,6 +106,10 @@ export default {
106106
noSubmit: 'No submission from user',
107107
errMessage: 'Error Log',
108108
knowedMessage: 'Known Information',
109+
documentSplitTip: 'Each document can preview only the first five segments',
110+
paragraphRules: 'Segmentation Rules',
111+
subBlockLength: 'Sub-block Length',
112+
writeContent: 'Content Written',
109113
},
110114
KnowledgeSource: {
111115
title: 'Knowledge Source',

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export default {
9696
next: 'Next',
9797
import: 'Start Import',
9898
preview: 'Apply',
99+
continueImporting: 'Continue Importing Documents',
99100
},
100101
tag: {
101102
label: 'Tag Management',

ui/src/locales/lang/zh-CN/ai-chat.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export default {
8383
localUpload: '本地上传',
8484
urlPlaceholder: '请输入 URL 地址,每行一个地址',
8585
urlTitle: 'URL 地址',
86-
urlErrorMessage: '文件类型不符合要求'
86+
urlErrorMessage: '文件类型不符合要求',
8787
},
8888
executionDetails: {
8989
title: '执行详情',
@@ -104,6 +104,10 @@ export default {
104104
noSubmit: '用户未提交',
105105
errMessage: '错误日志',
106106
knowedMessage: '已知信息',
107+
documentSplitTip: '每个文档仅能预览前五个分段',
108+
paragraphRules: '分段规则',
109+
subBlockLength: '子分块长度',
110+
writeContent: '写入内容',
107111
},
108112
KnowledgeSource: {
109113
title: '知识来源',

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export default {
9292
next: '下一步',
9393
import: '开始导入',
9494
preview: '生成预览',
95+
continueImporting: '继续导入文档',
9596
},
9697
tag: {
9798
label: '标签管理',

ui/src/locales/lang/zh-Hant/ai-chat.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export default {
8383
localUpload: '本地上傳',
8484
urlPlaceholder: '請輸入 URL 地址,每行一個地址',
8585
urlTitle: 'URL 地址',
86-
urlErrorMessage: '文件类型不符合要求'
86+
urlErrorMessage: '文件类型不符合要求',
8787
},
8888
executionDetails: {
8989
title: '執行詳細',
@@ -104,6 +104,10 @@ export default {
104104
noSubmit: '用戶未提交',
105105
errMessage: '錯誤日誌',
106106
knowedMessage: '已知資訊',
107+
documentSplitTip: '每個文件僅能預覽前五個段落',
108+
paragraphRules: '分段規則',
109+
subBlockLength: '子分塊長度',
110+
writeContent: '寫入內容',
107111
},
108112
KnowledgeSource: {
109113
title: '知識來源',

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export default {
9494
next: '下一步',
9595
import: '開始導入',
9696
preview: '生成預覽',
97+
continueImporting: '繼續導入文檔',
9798
},
9899
tag: {
99100
label: '標籤管理',

ui/src/views/knowledge-workflow/component/DebugDrawer.vue

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
</div>
2222
<template #footer>
2323
<el-button :loading="loading" @click="close">{{ $t('common.cancel') }}</el-button>
24+
<!-- <el-button v-if="active == 'result'" @click="continueImporting" :loading="loading">
25+
{{ $t('views.document.buttons.continueImporting') }}
26+
</el-button> -->
2427
<el-button
2528
v-if="base_form_list.length > 0 && active == 'knowledge_base'"
2629
:loading="loading"
@@ -43,6 +46,16 @@
4346
>
4447
{{ $t('views.document.buttons.import') }}
4548
</el-button>
49+
<!-- <el-button
50+
v-if="active == 'result'"
51+
type="primary"
52+
@click="
53+
router.push({
54+
path: `/knowledge/${id}/${folderId}/4/document`,
55+
})
56+
"
57+
>{{ $t('views.knowledge.ResultSuccess.buttons.toDocument') }}</el-button
58+
> -->
4659
</template>
4760
</el-drawer>
4861
</template>
@@ -54,13 +67,14 @@ import applicationApi from '@/api/application/application'
5467
import KnowledgeBase from '@/views/knowledge-workflow/component/action/KnowledgeBase.vue'
5568
import { WorkflowType } from '@/enums/application'
5669
import { loadSharedApi } from '@/utils/dynamics-api/shared-api.ts'
57-
import { useRoute } from 'vue-router'
70+
import { useRoute, useRouter } from 'vue-router'
5871
provide('upload', (file: any, loading?: Ref<boolean>) => {
5972
return applicationApi.postUploadFile(file, id, 'KNOWLEDGE', loading)
6073
})
74+
const router = useRouter()
6175
const route = useRoute()
6276
const {
63-
params: { id },
77+
params: { id, folderId },
6478
/*
6579
id 为 knowledge_id
6680
*/
@@ -125,6 +139,10 @@ const upload = () => {
125139
})
126140
})
127141
}
142+
const continueImporting = () => {
143+
action_id.value = undefined
144+
active.value = 'data_source'
145+
}
128146
defineExpose({ close, open })
129147
</script>
130148
<style lang="scss" scoped></style>

0 commit comments

Comments
 (0)