feat: 创建应用
This commit is contained in:
parent
e21bd3db25
commit
7b6ebc282e
@ -12,6 +12,7 @@
|
|||||||
<div class="scrollbar-height-left">
|
<div class="scrollbar-height-left">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<el-form
|
<el-form
|
||||||
|
hide-required-asterisk
|
||||||
ref="applicationFormRef"
|
ref="applicationFormRef"
|
||||||
:model="applicationForm"
|
:model="applicationForm"
|
||||||
:rules="rules"
|
:rules="rules"
|
||||||
@ -20,7 +21,12 @@
|
|||||||
class="p-24"
|
class="p-24"
|
||||||
style="padding-top: 0"
|
style="padding-top: 0"
|
||||||
>
|
>
|
||||||
<el-form-item label="应用名称" prop="name">
|
<el-form-item prop="name">
|
||||||
|
<template #label>
|
||||||
|
<div class="flex-between">
|
||||||
|
<span>应用名称 <span class="danger">*</span></span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="applicationForm.name"
|
v-model="applicationForm.name"
|
||||||
maxlength="64"
|
maxlength="64"
|
||||||
@ -38,10 +44,17 @@
|
|||||||
show-word-limit
|
show-word-limit
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="选择模型" prop="model_id">
|
<el-form-item prop="model_id">
|
||||||
|
<template #label>
|
||||||
|
<div class="flex-between">
|
||||||
|
<span>AI 模型 <span class="danger">*</span></span>
|
||||||
|
|
||||||
|
<el-button type="primary" link>提示词</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="applicationForm.model_id"
|
v-model="applicationForm.model_id"
|
||||||
placeholder="请选择模型"
|
placeholder="请选择 AI 模型"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
>
|
>
|
||||||
<el-option-group
|
<el-option-group
|
||||||
@ -86,16 +99,90 @@
|
|||||||
<template #label>
|
<template #label>
|
||||||
<div class="flex-between">
|
<div class="flex-between">
|
||||||
<span>关联知识库</span>
|
<span>关联知识库</span>
|
||||||
<el-button type="primary" link @click="openDatasetDialog">
|
|
||||||
<el-icon class="mr-4"><Plus /></el-icon> 添加
|
<el-popover :visible="popoverVisible" :width="300" trigger="click">
|
||||||
</el-button>
|
<template #reference>
|
||||||
|
<el-button type="primary" link @click="popoverVisible = !popoverVisible"
|
||||||
|
>参数设置</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
<div class="set-rules__form">
|
||||||
|
<div class="form-item mb-16">
|
||||||
|
<div class="title flex align-center mb-8">
|
||||||
|
<span style="margin-right: 4px">相似度</span>
|
||||||
|
<el-tooltip
|
||||||
|
effect="dark"
|
||||||
|
content="相似度越高相关性越强。"
|
||||||
|
placement="right"
|
||||||
|
>
|
||||||
|
<el-icon style="font-size: 16px">
|
||||||
|
<Warning />
|
||||||
|
</el-icon>
|
||||||
|
</el-tooltip>
|
||||||
|
</div>
|
||||||
|
<div @click.stop>
|
||||||
|
高于
|
||||||
|
<el-input-number
|
||||||
|
v-model="formInline.similarity"
|
||||||
|
:min="0"
|
||||||
|
:max="1"
|
||||||
|
:precision="3"
|
||||||
|
:step="0.1"
|
||||||
|
controls-position="right"
|
||||||
|
style="width: 100px"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-item mb-16">
|
||||||
|
<div class="title mb-8">引用分段数</div>
|
||||||
|
<div @click.stop>
|
||||||
|
TOP
|
||||||
|
<el-input-number
|
||||||
|
v-model="formInline.top_number"
|
||||||
|
:min="1"
|
||||||
|
:max="10"
|
||||||
|
controls-position="right"
|
||||||
|
style="width: 100px"
|
||||||
|
size="small"
|
||||||
|
/>
|
||||||
|
个分段
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-item mb-16">
|
||||||
|
<div class="title mb-8">最多引用字符数</div>
|
||||||
|
<div class="flex align-center">
|
||||||
|
<el-slider
|
||||||
|
v-model="formInline.top_number"
|
||||||
|
show-input
|
||||||
|
:show-input-controls="false"
|
||||||
|
:min="500"
|
||||||
|
:max="10000"
|
||||||
|
style="width: 220px"
|
||||||
|
size="small"
|
||||||
|
/>
|
||||||
|
<span class="ml-4">个字符</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="text-right">
|
||||||
|
<el-button @click="popoverVisible = false" size="small">取消</el-button>
|
||||||
|
<el-button type="primary" @click="popoverVisible = false" size="small"
|
||||||
|
>确认</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</el-popover>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div v-if="applicationForm.dataset_id_list.length == 0">
|
<div class="w-full">
|
||||||
<el-text type="info">关联的知识库展示在这里</el-text>
|
|
||||||
</div>
|
|
||||||
<div class="w-full" v-else>
|
|
||||||
<el-row :gutter="12">
|
<el-row :gutter="12">
|
||||||
|
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" class="mb-8">
|
||||||
|
<CardAdd
|
||||||
|
title="关联知识库"
|
||||||
|
@click="openDatasetDialog"
|
||||||
|
style="min-height: 50px; font-size: 14px"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
<el-col
|
<el-col
|
||||||
:xs="24"
|
:xs="24"
|
||||||
:sm="24"
|
:sm="24"
|
||||||
@ -230,6 +317,12 @@ const applicationForm = ref<ApplicationFormType>({
|
|||||||
dataset_id_list: []
|
dataset_id_list: []
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const formInline = reactive({
|
||||||
|
similarity: 0.6,
|
||||||
|
top_number: 5
|
||||||
|
})
|
||||||
|
const popoverVisible = ref(false)
|
||||||
|
|
||||||
const rules = reactive<FormRules<ApplicationFormType>>({
|
const rules = reactive<FormRules<ApplicationFormType>>({
|
||||||
name: [{ required: true, message: '请输入应用名称', trigger: 'blur' }],
|
name: [{ required: true, message: '请输入应用名称', trigger: 'blur' }],
|
||||||
model_id: [
|
model_id: [
|
||||||
|
|||||||
@ -44,7 +44,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<AppAvatar :name="index + 1 + ''" class="mr-12 avatar-light" :size="22" />
|
<AppAvatar :name="index + 1 + ''" class="mr-12 avatar-light" :size="22" />
|
||||||
</template>
|
</template>
|
||||||
<div class="active-button primary">{{ (item.similarity * 100).toFixed(2) }}%</div>
|
<div class="active-button primary">{{ item.similarity.toFixed(3) }}</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="footer-content flex-between">
|
<div class="footer-content flex-between">
|
||||||
<el-text>
|
<el-text>
|
||||||
@ -75,7 +75,7 @@
|
|||||||
<ParagraphDialog ref="ParagraphDialogRef" :title="title" @refresh="refresh" />
|
<ParagraphDialog ref="ParagraphDialogRef" :title="title" @refresh="refresh" />
|
||||||
</LayoutContainer>
|
</LayoutContainer>
|
||||||
<div class="hit-test__operate p-24 pt-0">
|
<div class="hit-test__operate p-24 pt-0">
|
||||||
<el-popover :visible="popoverVisible" placement="top-start" :width="560" trigger="click">
|
<el-popover :visible="popoverVisible" placement="top-start" :width="600" trigger="click">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button icon="Setting" class="mb-8" @click="popoverVisible = !popoverVisible"
|
<el-button icon="Setting" class="mb-8" @click="popoverVisible = !popoverVisible"
|
||||||
>参数设置</el-button
|
>参数设置</el-button
|
||||||
@ -83,15 +83,16 @@
|
|||||||
</template>
|
</template>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div>
|
<div>
|
||||||
相似度
|
相似度高于
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="formInline.similarity"
|
v-model="formInline.similarity"
|
||||||
:min="1"
|
:min="0"
|
||||||
:max="100"
|
:max="1"
|
||||||
|
:precision="3"
|
||||||
|
:step="0.1"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
style="width: 100px"
|
style="width: 100px"
|
||||||
/>
|
/>
|
||||||
%
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ml-16">
|
<div class="ml-16">
|
||||||
@ -156,7 +157,7 @@ const paragraphDetail = ref<any[]>([])
|
|||||||
const title = ref('')
|
const title = ref('')
|
||||||
const inputValue = ref('')
|
const inputValue = ref('')
|
||||||
const formInline = reactive({
|
const formInline = reactive({
|
||||||
similarity: 60,
|
similarity: 0.600,
|
||||||
top_number: 5
|
top_number: 5
|
||||||
})
|
})
|
||||||
const popoverVisible = ref(false)
|
const popoverVisible = ref(false)
|
||||||
@ -193,7 +194,7 @@ function sendChatHandle(event: any) {
|
|||||||
function getHitTestList() {
|
function getHitTestList() {
|
||||||
const obj = {
|
const obj = {
|
||||||
query_text: inputValue.value,
|
query_text: inputValue.value,
|
||||||
similarity: formInline.similarity / 100,
|
similarity: formInline.similarity,
|
||||||
top_number: formInline.top_number
|
top_number: formInline.top_number
|
||||||
}
|
}
|
||||||
if (isDataset.value) {
|
if (isDataset.value) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user