Skip to content

Commit 93efd15

Browse files
feat: Add Document Search node function
1 parent 5189816 commit 93efd15

File tree

10 files changed

+158
-79
lines changed

10 files changed

+158
-79
lines changed
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

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

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="flex-between cursor" @click="data['show'] = !data['show']">
44
<div class="flex align-center">
55
<el-icon class="mr-8 arrow-icon" :class="data['show'] ? 'rotate-90' : ''">
6-
<CaretRight/>
6+
<CaretRight />
77
</el-icon>
88
<component
99
:is="iconComponent(`${data.type}-icon`)"
@@ -24,14 +24,14 @@
2424
data.type === WorkflowType.Application ||
2525
data.type == WorkflowType.IntentNode
2626
"
27-
>{{ data?.message_tokens + data?.answer_tokens }} tokens</span
27+
>{{ data?.message_tokens + data?.answer_tokens }} tokens</span
2828
>
2929
<span class="mr-16 color-secondary">{{ data?.run_time?.toFixed(2) || 0.0 }} s</span>
3030
<el-icon class="color-success" :size="16" v-if="data.status === 200">
31-
<CircleCheck/>
31+
<CircleCheck />
3232
</el-icon>
3333
<el-icon class="color-danger" :size="16" v-else>
34-
<CircleClose/>
34+
<CircleClose />
3535
</el-icon>
3636
</div>
3737
</div>
@@ -64,7 +64,7 @@
6464
<template v-for="(f, i) in data.document_list" :key="i">
6565
<el-card shadow="never" style="--el-card-padding: 8px" class="file cursor">
6666
<div class="flex align-center">
67-
<img :src="getImgUrl(f && f?.name)" alt="" width="24"/>
67+
<img :src="getImgUrl(f && f?.name)" alt="" width="24" />
6868
<div class="ml-4 ellipsis" :title="f && f?.name">
6969
{{ f && f?.name }}
7070
</div>
@@ -124,7 +124,7 @@
124124
<template v-for="(f, i) in data.other_list" :key="i">
125125
<el-card shadow="never" style="--el-card-padding: 8px" class="file cursor">
126126
<div class="flex align-center">
127-
<img :src="getImgUrl(f && f?.name)" alt="" width="24"/>
127+
<img :src="getImgUrl(f && f?.name)" alt="" width="24" />
128128
<div class="ml-4 ellipsis" :title="f && f?.name">
129129
{{ f && f?.name }}
130130
</div>
@@ -463,8 +463,7 @@
463463
<template v-if="data.type === WorkflowType.FormNode">
464464
<div class="card-never border-r-6">
465465
<h5 class="p-8-12">
466-
{{
467-
$t('common.param.outputParam')
466+
{{ $t('common.param.outputParam')
468467
}}<span style="color: #f54a45">{{
469468
data.is_submit ? '' : `(${$t('chat.executionDetails.noSubmit')})`
470469
}}</span>
@@ -516,7 +515,7 @@
516515
class="border-r-6 mr-8"
517516
/>
518517

519-
<span v-else>{{ h.text }}<br/></span>
518+
<span v-else>{{ h.text }}<br /></span>
520519
</template>
521520
</span>
522521

@@ -600,7 +599,7 @@
600599
class="border-r-6 mr-8"
601600
/>
602601

603-
<span v-else>{{ h.text }}<br/></span>
602+
<span v-else>{{ h.text }}<br /></span>
604603
</template>
605604
</span>
606605

@@ -919,7 +918,7 @@
919918
<template v-if="data.type === WorkflowType.LoopNode">
920919
<el-radio-group v-model="currentLoopNode" class="app-radio-button-group mb-8">
921920
<template v-for="(loop, loopIndex) in data.loop_node_data" :key="loopIndex">
922-
<el-radio-button :label="loopIndex" :value="loopIndex"/>
921+
<el-radio-button :label="loopIndex" :value="loopIndex" />
923922
</template>
924923
</el-radio-group>
925924
<template
@@ -994,6 +993,24 @@
994993
</div>
995994
</div>
996995
</template>
996+
<!-- 文档检索 -->
997+
<template v-if="data.type === WorkflowType.SearchDocument">
998+
<div class="card-never border-r-6">
999+
<h5 class="p-8-12 flex align-center">
1000+
<span class="mr-4"> {{ $t('common.param.outputParam') }}</span>
1001+
</h5>
1002+
<div class="p-8-12 border-t-dashed lighter">
1003+
<div class="mb-8">
1004+
<span class="color-secondary"> knowledge_list:</span>
1005+
{{ data.knowledge_items?.map((v:any) => v.name).join(',') }}
1006+
</div>
1007+
<div class="mb-8">
1008+
<span class="color-secondary"> document_list:</span>
1009+
{{ data.document_items?.map((v:any) => v.name).join(',') }}
1010+
</div>
1011+
</div>
1012+
</div>
1013+
</template>
9971014
<slot></slot>
9981015
</template>
9991016
<template v-else>
@@ -1007,16 +1024,15 @@
10071024
</el-card>
10081025
</template>
10091026
<script setup lang="ts">
1010-
import {ref, computed} from 'vue'
1011-
import ParagraphCard
1012-
from '@/components/ai-chat/component/knowledge-source-component/ParagraphCard.vue'
1027+
import { ref, computed } from 'vue'
1028+
import ParagraphCard from '@/components/ai-chat/component/knowledge-source-component/ParagraphCard.vue'
10131029
import DynamicsForm from '@/components/dynamics-form/index.vue'
1014-
import {iconComponent} from '@/workflow/icons/utils'
1015-
import {WorkflowType} from '@/enums/application'
1016-
import {getImgUrl} from '@/utils/common'
1017-
import {arraySort} from '@/utils/array'
1030+
import { iconComponent } from '@/workflow/icons/utils'
1031+
import { WorkflowType } from '@/enums/application'
1032+
import { getImgUrl } from '@/utils/common'
1033+
import { arraySort } from '@/utils/array'
10181034
1019-
import {t} from '@/locales'
1035+
import { t } from '@/locales'
10201036
10211037
const props = defineProps<{
10221038
data: any

ui/src/locales/lang/en-US/views/application-workflow.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export default {
8282
aiCapability: 'AI capability',
8383
businessLogic: 'Business logic',
8484
other: 'Other',
85+
dataProcessing: 'Data Processing',
8586
},
8687
startNode: {
8788
label: 'Start',
@@ -145,12 +146,15 @@ export default {
145146
selectKnowledge: 'Search Scope',
146147
searchSetting: 'Search Settings',
147148
custom: 'Manual',
149+
customTooltip: 'Manually set tag filtering conditions',
148150
auto: 'Automatic',
151+
autoTooltip: 'Automatically filter setting tag conditions based on the search question',
149152
document_list: 'Document List',
150153
knowledge_list: 'Knowledge Base List',
151154
result: 'Search Results',
152155
searchParam: 'Search Parameters',
153156
select_variable: 'Select Variable',
157+
valueMessage: `Value or {variable} `,
154158
showKnowledge: {
155159
label: 'Results are displayed in the knowledge source',
156160
requiredMessage: 'Please set parameters',

ui/src/locales/lang/zh-CN/views/application-workflow.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export default {
8585
aiCapability: 'AI能力',
8686
businessLogic: '业务逻辑',
8787
other: '其他',
88+
dataProcessing: '数据处理',
8889
},
8990
startNode: {
9091
label: '开始',
@@ -153,12 +154,15 @@ export default {
153154
selectKnowledge: '检索范围',
154155
searchSetting: '检索设置',
155156
custom: '手动',
157+
customTooltip: '手动设置标签过滤条件',
156158
auto: '自动',
159+
autoTooltip: '根据检索问题自动匹配文档标签',
157160
document_list: '文档列表',
158161
knowledge_list: '知识库列表',
159162
result: '检索结果',
160163
searchParam: '检索参数',
161164
select_variable: '选择变量',
165+
valueMessage: `值或{变量}`,
162166
showKnowledge: {
163167
label: '结果显示在知识来源中',
164168
requiredMessage: '请设置参数',

ui/src/locales/lang/zh-Hant/views/application-workflow.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export default {
8383
aiCapability: 'AI能力',
8484
businessLogic: '業務邏輯',
8585
other: '其他',
86+
dataProcessing: '數據處理',
8687
},
8788
startNode: {
8889
label: '開始',
@@ -146,12 +147,15 @@ export default {
146147
selectKnowledge: '檢索範圍',
147148
searchSetting: '檢索設定',
148149
custom: '手動',
150+
customTooltip: '手動設置標籤過濾條件',
149151
auto: '自動',
152+
autoTooltip: '根據檢索問題自動匹配文檔標簽',
150153
document_list: '文件清單',
151154
knowledge_list: '知識庫列表',
152155
result: '檢索結果',
153156
searchParam: '檢索參數',
154157
select_variable: '選擇變數',
158+
valueMessage: `值或{變量}`,
155159
showKnowledge: {
156160
label: '結果顯示在知識來源',
157161
requiredMessage: '請設定參數',
@@ -398,13 +402,13 @@ export default {
398402
loopItem: '循環元素',
399403
loopVariable: '循環變量',
400404
},
401-
loopBodyNode: {label: '循環體', text: '循環體'},
405+
loopBodyNode: { label: '循環體', text: '循環體' },
402406
loopContinueNode: {
403407
label: 'Continue',
404408
text: '用於終止當前循環,執行下次循環',
405409
isContinue: 'Continue',
406410
},
407-
loopBreakNode: {label: 'Break', text: '終止當前循環,跳出循環體', isBreak: 'Break'},
411+
loopBreakNode: { label: 'Break', text: '終止當前循環,跳出循環體', isBreak: 'Break' },
408412
variableSplittingNode: {
409413
label: '變量拆分',
410414
text: '用於拆分變量',

ui/src/workflow/common/data.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ export const searchDocumentNode = {
130130
label: t('views.applicationWorkflow.nodes.searchDocumentNode.label'),
131131
height: 355,
132132
properties: {
133+
width: 600,
133134
stepName: t('views.applicationWorkflow.nodes.searchDocumentNode.label'),
134135
config: {
135136
fields: [
@@ -625,7 +626,7 @@ export const menuNodes = [
625626
list: [conditionNode, formNode, variableAssignNode, replyNode, loopNode],
626627
},
627628
{
628-
label: t('views.applicationWorkflow.nodes.classify.dataProcessing', '数据处理'),
629+
label: t('views.applicationWorkflow.nodes.classify.dataProcessing'),
629630
list: [variableSplittingNode, parameterExtractionNode],
630631
},
631632
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<el-avatar shape="square" class="avatar-blue">
3-
<img src="@/assets/knowledge/icon_document.svg" style="width: 58%" alt="" />
3+
<img src="@/assets/workflow/icon_doc-search.svg" style="width: 58%" alt="" />
44
</el-avatar>
55
</template>
66
<script setup lang="ts"></script>

ui/src/workflow/nodes/base-node/component/FileUploadSettingDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
>
137137
<div class="flex-between">
138138
<div class="flex align-center">
139-
<img class="mr-12" src="@/assets/workflow/icon_file-video.svg" alt="" />
139+
<img class="mr-12" width="32" src="@/assets/workflow/icon_file-video.svg" alt="" />
140140
<div>
141141
<p class="line-height-22 mt-4">
142142
{{ $t('common.fileUpload.video') }}

0 commit comments

Comments
 (0)