Skip to content

Commit

Permalink
perf: 优化文案
Browse files Browse the repository at this point in the history
  • Loading branch information
wangdan-fit2cloud committed Sep 18, 2024
1 parent a1a5a16 commit 110a0f6
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 14 deletions.
4 changes: 2 additions & 2 deletions ui/src/locales/lang/zh_CN/views/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default {
},
appDescription: {
label: '应用描述',
placeholder: '描述该应用的应用场景及用途,如:MaxKB 小助手回答用户提出的 MaxKB 产品使用问题'
placeholder: '描述该应用的应用场景及用途,如:XXX 小助手回答用户提出的 XXX 产品使用问题'
},
aiModel: {
label: 'AI 模型',
Expand Down Expand Up @@ -109,6 +109,6 @@ export default {
回答要求:
- 请使用中文回答用户问题`,
defaultPrologue:
'您好,我是 MaxKB 小助手,您可以向我提出 MaxKB 使用问题。\n- MaxKB 主要功能有什么?\n- MaxKB 支持哪些大语言模型?\n- MaxKB 支持哪些文档类型?'
'您好,我是 XXX 小助手,您可以向我提出 XXX 使用问题。\n- XXX 主要功能有什么?\n- XXX 如何收费?\n- 需要转人工服务'
}
}
4 changes: 2 additions & 2 deletions ui/src/views/application/ApplicationSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@
v-model="applicationForm.prologue"
style="height: 150px"
@submitDialog="submitPrologueDialog"
:placeholder="defaultPrompt"
/>
</el-form-item>

Expand All @@ -322,6 +321,7 @@
v-model="applicationForm.stt_model_id"
class="w-full"
popper-class="select-model"
placeholder="请选择语音识别模型"
>
<el-option-group
v-for="(value, label) in sttModelOptions"
Expand Down Expand Up @@ -704,7 +704,7 @@ function getDetail() {
applicationForm.value.tts_model_id = res.data.tts_model
applicationForm.value.tts_type = res.data.tts_type
applicationForm.value.model_setting.no_references_prompt =
res.data.model_setting.no_references_prompt || ''
res.data.model_setting.no_references_prompt || '{question}'
})
}
Expand Down
4 changes: 2 additions & 2 deletions ui/src/workflow/common/data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { WorkflowType } from '@/enums/workflow'
import { t } from '@/locales'

export const startNode = {
id: WorkflowType.Start,
Expand Down Expand Up @@ -37,8 +38,7 @@ export const baseNode = {
node_data: {
name: '',
desc: '',
prologue:
'您好,我是 MaxKB 小助手,您可以向我提出 MaxKB 使用问题。\n- MaxKB 主要功能有什么?\n- MaxKB 支持哪些大语言模型?\n- MaxKB 支持哪些文档类型?'
prologue: t('views.application.prompt.defaultPrologue')
},
config: {}
}
Expand Down
12 changes: 8 additions & 4 deletions ui/src/workflow/nodes/base-node/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@
<el-icon class="mr-4"><Plus /></el-icon> 添加
</el-button>
</div>
<el-table :data="props.nodeModel.properties.input_field_list" class="mb-16">
<el-table
v-if="props.nodeModel.properties.input_field_list > 0"
:data="props.nodeModel.properties.input_field_list"
class="mb-16"
>
<el-table-column prop="name" label="变量名" />
<el-table-column prop="variable" label="变量" />
<el-table-column label="输入类型">
Expand Down Expand Up @@ -114,7 +118,7 @@
v-model="form_data.stt_model_id"
class="w-full"
popper-class="select-model"
placeholder="请输入"
placeholder="请选择语音识别模型"
>
<el-option-group
v-for="(value, label) in sttModelOptions"
Expand Down Expand Up @@ -255,6 +259,7 @@ import applicationApi from '@/api/application'
import type { Provider } from '@/api/type/model'
import FieldFormDialog from './component/FieldFormDialog.vue'
import { MsgError } from '@/utils/message'
import { t } from '@/locales'
const { model } = useStore()
const {
Expand All @@ -270,8 +275,7 @@ const providerOptions = ref<Array<Provider>>([])
const form = {
name: '',
desc: '',
prologue:
'您好,我是 MaxKB 小助手,您可以向我提出 MaxKB 使用问题。\n- MaxKB 主要功能有什么?\n- MaxKB 支持哪些大语言模型?\n- MaxKB 支持哪些文档类型?'
prologue: t('views.application.prompt.defaultPrologue')
}
const wheel = (e: any) => {
Expand Down
28 changes: 24 additions & 4 deletions ui/src/workflow/nodes/reranker-node/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@
require-asterisk-position="right"
label-width="auto"
ref="rerankerNodeFormRef"
hide-required-asterisk
>
<el-form-item label="知识库检索结果">
<el-form-item
label="重排内容"
prop="reranker_reference_list"
:rules="{
type: 'array',
message: '请选择重排内容',
trigger: 'change',
required: true
}"
>
<template #label>
<div class="flex-between">
<span>知识库检索结果</span>
<span>重排内容<span class="danger">*</span></span>
<el-button @click="add_reranker_reference" link type="primary">
<el-icon class="mr-4"><Plus /></el-icon>
</el-button>
Expand All @@ -39,7 +49,7 @@
ref="nodeCascaderRef"
:nodeModel="nodeModel"
class="w-full"
placeholder="请选择检索问题输入"
placeholder="请选择重排内容"
v-model="form_data.reranker_reference_list[index]"
/>
</el-form-item>
Expand Down Expand Up @@ -84,6 +94,11 @@
required: true
}"
>
<template #label>
<div class="flex-between">
<span>检索问题<span class="danger">*</span></span>
</div>
</template>
<NodeCascader
ref="nodeCascaderRef"
:nodeModel="nodeModel"
Expand All @@ -101,6 +116,11 @@
trigger: 'change'
}"
>
<template #label>
<div class="flex-between">
<span>AI 模型<span class="danger">*</span></span>
</div>
</template>
<el-select
@wheel="wheel"
:teleported="false"
Expand Down Expand Up @@ -202,7 +222,7 @@ const {
params: { id }
} = app.config.globalProperties.$route as any
const form = {
reranker_reference_list: [],
reranker_reference_list: [[]],
reranker_model_id: '',
reranker_setting: {
top_n: 3,
Expand Down

0 comments on commit 110a0f6

Please sign in to comment.