fix: 修复翻译引用问题

This commit is contained in:
wangdan-fit2cloud 2024-05-21 14:06:54 +08:00
parent 89b7fe2f39
commit 0a05be91a6
3 changed files with 309 additions and 231 deletions

View File

@ -1,103 +1,113 @@
export default { export default {
applicationList: { applicationList: {
title: "Applications", title: 'Applications',
searchBar: { searchBar: {
placeholder: "Search by name", placeholder: 'Search by name'
}, },
card: { card: {
createApplication: "Create Application", createApplication: 'Create Application',
overview: "Overview", overview: 'Overview',
demo: "Demo", demo: 'Demo',
setting: "Settings", setting: 'Settings',
delete: { delete: {
tooltip: "Delete", tooltip: 'Delete',
confirmTitle: "Are you sure you want to delete this application?", confirmTitle: 'Are you sure you want to delete this application?',
confirmMessage: "Deleting this application will no longer provide its services. Please proceed with caution.", confirmMessage:
confirmButton: "Delete", 'Deleting this application will no longer provide its services. Please proceed with caution.',
cancelButton: "Cancel", confirmButton: 'Delete',
successMessage: "Successfully deleted" cancelButton: 'Cancel',
successMessage: 'Successfully deleted'
} }
}, },
tooltips: { tooltips: {
demo: "Demo", demo: 'Demo',
setting: "Settings", setting: 'Settings',
delete: "Delete" delete: 'Delete'
}, }
}, },
applicationForm: { applicationForm: {
title: { title: {
create: "Create Application", create: 'Create Application',
edit: "Edit Settings", edit: 'Edit Settings',
info:"Application Information" info: 'Application Information'
}, },
form: { form: {
appName: { appName: {
label: "Application Name", label: 'Application Name',
placeholder: "Please enter the application name", placeholder: 'Please enter the application name',
requiredMessage: "Application name is required" requiredMessage: 'Application name is required'
}, },
appDescription: { appDescription: {
label: "Application Description", label: 'Application Description',
placeholder: "Describe the application scenario and use, e.g.: MaxKB assistant answering user questions about MaxKB product usage" placeholder:
'Describe the application scenario and use, e.g.: MaxKB assistant answering user questions about MaxKB product usage'
}, },
aiModel: { aiModel: {
label: "AI Model", label: 'AI Model',
placeholder: "Please select an AI model", placeholder: 'Please select an AI model',
unavailable: "(Unavailable)" unavailable: '(Unavailable)'
}, },
prompt: { prompt: {
label: "Prompt", label: 'Prompt',
placeholder: "Please enter prompt", placeholder: 'Please enter prompt',
tooltip: "By adjusting the content of the prompt, you can guide the direction of the large model conversation. This prompt will be fixed at the beginning of the context. Variables used: {data} carries known information from the knowledge base; {question} is the question posed by the user." tooltip:
'By adjusting the content of the prompt, you can guide the direction of the large model conversation. This prompt will be fixed at the beginning of the context. Variables used: {data} carries known information from the knowledge base; {question} is the question posed by the user.'
}, },
multipleRoundsDialogue: "Multiple Rounds Dialogue", multipleRoundsDialogue: 'Multiple Rounds Dialogue',
relatedKnowledgeBase: "Related Knowledge Base", relatedKnowledgeBase: 'Related Knowledge Base',
relatedKnowledgeBaseWhere: "Associated knowledge bases are displayed here", relatedKnowledgeBaseWhere: 'Associated knowledge bases are displayed here',
prologue: "Prologue", prologue: 'Prologue',
problemOptimization: { problemOptimization: {
label: "Problem Optimization", label: 'Problem Optimization',
tooltip: "Optimize the current question based on historical chat to better match knowledge points." tooltip:
'Optimize the current question based on historical chat to better match knowledge points.'
}, },
addModel: "Add Model", addModel: 'Add Model',
paramSetting: "Parameter Settings", paramSetting: 'Parameter Settings',
add: "Add", add: 'Add',
apptest:"Debug Preview" apptest: 'Debug Preview'
}, },
buttons: { buttons: {
confirm:"Confirm", confirm: 'Confirm',
cancel: "Cancel", cancel: 'Cancel',
create: "Create", create: 'Create',
createSuccess: "Create Success", createSuccess: 'Create Success',
save: "Save", save: 'Save',
saveSuccess: "Save Success" saveSuccess: 'Save Success'
}, },
dialogues: { dialogues: {
addDataset: "Add Related Knowledge Base", addDataset: 'Add Related Knowledge Base',
removeDataset: "Remove Knowledge Base", removeDataset: 'Remove Knowledge Base',
paramSettings: "Parameter Settings", paramSettings: 'Parameter Settings',
refresh: "Refresh", refresh: 'Refresh',
selectSearchMode: "Search Mode", selectSearchMode: 'Search Mode',
vectorSearch: "Vector Search", vectorSearch: 'Vector Search',
vectorSearchTooltip: "Vector search is a retrieval method based on vector distance calculations, suitable for large data volumes in the knowledge base.", vectorSearchTooltip:
fullTextSearch: "Full-text Search", 'Vector search is a retrieval method based on vector distance calculations, suitable for large data volumes in the knowledge base.',
fullTextSearchTooltip: "Full-text search is a retrieval method based on text similarity, suitable for small data volumes in the knowledge base.", fullTextSearch: 'Full-text Search',
hybridSearch: "Hybrid Search", fullTextSearchTooltip:
hybridSearchTooltip: "Hybrid search is a retrieval method based on both vector and text similarity, suitable for medium data volumes in the knowledge base.", 'Full-text search is a retrieval method based on text similarity, suitable for small data volumes in the knowledge base.',
similarityThreshold: "Similarity Threshold", hybridSearch: 'Hybrid Search',
topReferences: "Top N References", hybridSearchTooltip:
maxCharacters: "Maximum Characters per Reference", 'Hybrid search is a retrieval method based on both vector and text similarity, suitable for medium data volumes in the knowledge base.',
noReferencesAction: "When there are no knowledge base references", similarityThreshold: 'Similarity Threshold',
continueQuestioning: "Continue Questioning AI Model", topReferences: 'Top N References',
provideAnswer: "Provide a Specific Answer", maxCharacters: 'Maximum Characters per Reference',
prompt: "Prompt", noReferencesAction: 'When there are no knowledge base references',
promptPlaceholder:"Please enter a prompt", continueQuestioning: 'Continue Questioning AI Model',
concent:"Content", provideAnswer: 'Provide a Specific Answer',
concentPlaceholder:"Please enter content", prompt: 'Prompt',
designated_answer:"Hello, I am MaxKB Assistant. My knowledge base only contains information related to MaxKB products. Please rephrase your question." promptPlaceholder: 'Please enter a prompt',
concent: 'Content',
concentPlaceholder: 'Please enter content',
designated_answer:
'Hello, I am MaxKB Assistant. My knowledge base only contains information related to MaxKB products. Please rephrase your question.'
} }
}, },
prompt:{ prompt: {
defaultPrompt:"Known information:\n{{data}}\nResponse requirements:\n- Please use concise and professional language to answer the user's question.\n- If you do not know the answer, reply, \"No relevant information was found in the knowledge base; it is recommended to consult technical support or refer to the official documentation for operations.\"\n- Avoid mentioning that your knowledge is obtained from known information.\n- Ensure the answer is consistent with the information described in the known data.\n- Please use Markdown syntax to optimize the format of the answer.\n- Directly return any images, link addresses, and script languages found in the known information.\n- Please respond in the same language as the question.\nQuestion:\n{question}", defaultPrompt:
defaultPrologue:"Hello, I am MaxKB Assistant. You can ask me questions about using MaxKB.\n- What are the main features of MaxKB?\n- Which large language models does MaxKB support?\n- What document types does MaxKB support?" 'Known information:\n{data}\nResponse requirements:\n- Please use concise and professional language to answer the user\'s question.\n- If you do not know the answer, reply, "No relevant information was found in the knowledge base; it is recommended to consult technical support or refer to the official documentation for operations."\n- Avoid mentioning that your knowledge is obtained from known information.\n- Ensure the answer is consistent with the information described in the known data.\n- Please use Markdown syntax to optimize the format of the answer.\n- Directly return any images, link addresses, and script languages found in the known information.\n- Please respond in the same language as the question.\nQuestion:\n{question}',
defaultPrologue:
'Hello, I am MaxKB Assistant. You can ask me questions about using MaxKB.\n- What are the main features of MaxKB?\n- Which large language models does MaxKB support?\n- What document types does MaxKB support?'
} }
}; }

View File

@ -1,103 +1,109 @@
export default { export default {
applicationList: { applicationList: {
title: "应用", title: '应用',
searchBar: { searchBar: {
placeholder: "按名称搜索", placeholder: '按名称搜索'
}, },
card: { card: {
createApplication: "创建应用", createApplication: '创建应用',
overview: "概览", overview: '概览',
demo: "演示", demo: '演示',
setting: "设置", setting: '设置',
delete: { delete: {
tooltip: "删除", tooltip: '删除',
confirmTitle: "是否删除应用:", confirmTitle: '是否删除应用:',
confirmMessage: "删除后该应用将不再提供服务,请谨慎操作。", confirmMessage: '删除后该应用将不再提供服务,请谨慎操作。',
confirmButton: "删除", confirmButton: '删除',
cancelButton: "取消", cancelButton: '取消',
successMessage: "删除成功" successMessage: '删除成功'
} }
}, },
tooltips: { tooltips: {
demo: "演示", demo: '演示',
setting: "设置", setting: '设置',
delete: "删除" delete: '删除'
}, }
}, },
applicationForm: { applicationForm: {
title: { title: {
create: "创建应用", create: '创建应用',
edit: "设置", edit: '设置',
info:"应用信息" info: '应用信息'
}, },
form: { form: {
appName: { appName: {
label: "应用名称", label: '应用名称',
placeholder: "请输入应用名称", placeholder: '请输入应用名称',
requiredMessage: "请输入应用名称" requiredMessage: '请输入应用名称'
}, },
appDescription: { appDescription: {
label: "应用描述", label: '应用描述',
placeholder: "描述该应用的应用场景及用途MaxKB 小助手回答用户提出的 MaxKB 产品使用问题" placeholder: '描述该应用的应用场景及用途MaxKB 小助手回答用户提出的 MaxKB 产品使用问题'
}, },
aiModel: { aiModel: {
label: "AI 模型", label: 'AI 模型',
placeholder: "请选择 AI 模型", placeholder: '请选择 AI 模型',
unavailable: "(不可用)" unavailable: '(不可用)'
}, },
prompt: { prompt: {
label: "提示词", label: '提示词',
placeholder: "请输入提示词", placeholder: '请输入提示词',
tooltip: "通过调整提示词内容,可以引导大模型聊天方向,该提示词会被固定在上下文的开头。可以使用变量:{data} 是携带知识库中已知信息;{question}是用户提出的问题。" tooltip:
'通过调整提示词内容,可以引导大模型聊天方向,该提示词会被固定在上下文的开头。可以使用变量:{data} 是携带知识库中已知信息;{question}是用户提出的问题。'
}, },
multipleRoundsDialogue: "多轮对话", multipleRoundsDialogue: '多轮对话',
relatedKnowledgeBase: "关联知识库", relatedKnowledgeBase: '关联知识库',
relatedKnowledgeBaseWhere: "关联知识库展示在这里", relatedKnowledgeBaseWhere: '关联知识库展示在这里',
prologue: "开场白", prologue: '开场白',
problemOptimization: { problemOptimization: {
label: "问题优化", label: '问题优化',
tooltip: "根据历史聊天优化完善当前问题,更利于匹配知识点。" tooltip: '根据历史聊天优化完善当前问题,更利于匹配知识点。'
}, },
addModel: "添加模型", addModel: '添加模型',
paramSetting: "参数设置", paramSetting: '参数设置',
add: "添加", add: '添加',
apptest:"调试预览" apptest: '调试预览'
}, },
buttons: { buttons: {
confirm:"确认", confirm: '确认',
cancel: "取消", cancel: '取消',
create: "创建", create: '创建',
createSuccess: "创建", createSuccess: '创建',
save: "保存", save: '保存',
saveSuccess: "保存" saveSuccess: '保存'
}, },
dialogues: { dialogues: {
addDataset: "添加关联知识库", addDataset: '添加关联知识库',
removeDataset: "移除知识库", removeDataset: '移除知识库',
paramSettings: "参数设置", paramSettings: '参数设置',
refresh: "刷新", refresh: '刷新',
selectSearchMode: "检索模式", selectSearchMode: '检索模式',
vectorSearch: "向量检索", vectorSearch: '向量检索',
vectorSearchTooltip: "向量检索是一种基于向量相似度的检索方式,适用于知识库中的大数据量场景。", vectorSearchTooltip: '向量检索是一种基于向量相似度的检索方式,适用于知识库中的大数据量场景。',
fullTextSearch: "全文检索", fullTextSearch: '全文检索',
fullTextSearchTooltip: "全文检索是一种基于文本相似度的检索方式,适用于知识库中的小数据量场景。", fullTextSearchTooltip:
hybridSearch: "混合检索", '全文检索是一种基于文本相似度的检索方式,适用于知识库中的小数据量场景。',
hybridSearchTooltip: "混合检索是一种基于向量和文本相似度的检索方式,适用于知识库中的中等数据量场景。", hybridSearch: '混合检索',
similarityThreshold: "相似度高于", hybridSearchTooltip:
topReferences: "引用分段数 TOP", '混合检索是一种基于向量和文本相似度的检索方式,适用于知识库中的中等数据量场景。',
maxCharacters: "最多引用字符数", similarityThreshold: '相似度高于',
noReferencesAction: "无引用知识库分段时", topReferences: '引用分段数 TOP',
continueQuestioning: "继续向 AI 模型提问", maxCharacters: '最多引用字符数',
provideAnswer: "指定回答内容", noReferencesAction: '无引用知识库分段时',
prompt: "提示词", continueQuestioning: '继续向 AI 模型提问',
promptPlaceholder:"请输入提示词", provideAnswer: '指定回答内容',
concent:"内容", prompt: '提示词',
concentPlaceholder:"请输入内容", promptPlaceholder: '请输入提示词',
designated_answer:"你好,我是 MaxKB 小助手,我的知识库只包含了 MaxKB 产品相关知识,请重新描述您的问题。" concent: '内容',
concentPlaceholder: '请输入内容',
designated_answer:
'你好,我是 MaxKB 小助手,我的知识库只包含了 MaxKB 产品相关知识,请重新描述您的问题。'
} }
}, },
prompt:{ prompt: {
defaultPrompt:"已知信息:\n {{data}} \n回答要求\n- 请使用简洁且专业的语言来回答用户的问题。\n- 如果你不知道答案,请回答“没有在知识库中查找到相关信息,建议咨询相关技术支持或参考官方文档进行操作”。\n- 避免提及你是从已知信息中获得的知识。\n- 请保证答案与已知信息中描述的一致。\n- 请使用 Markdown 语法优化答案的格式。\n- 已知信息中的图片、链接地址和脚本语言请直接返回。\n- 请使用与问题相同的语言来回答。\n问题\n{question}", defaultPrompt:
defaultPrologue:"您好,我是 MaxKB 小助手,您可以向我提出 MaxKB 使用问题。\n- MaxKB 主要功能有什么?\n- MaxKB 支持哪些大语言模型?\n- MaxKB 支持哪些文档类型?" '已知信息:\n {data} \n回答要求\n- 请使用简洁且专业的语言来回答用户的问题。\n- 如果你不知道答案,请回答“没有在知识库中查找到相关信息,建议咨询相关技术支持或参考官方文档进行操作”。\n- 避免提及你是从已知信息中获得的知识。\n- 请保证答案与已知信息中描述的一致。\n- 请使用 Markdown 语法优化答案的格式。\n- 已知信息中的图片、链接地址和脚本语言请直接返回。\n- 请使用与问题相同的语言来回答。\n问题\n{question}',
defaultPrologue:
'您好,我是 MaxKB 小助手,您可以向我提出 MaxKB 使用问题。\n- MaxKB 主要功能有什么?\n- MaxKB 支持哪些大语言模型?\n- MaxKB 支持哪些文档类型?'
} }
}; }

View File

@ -1,13 +1,19 @@
<template> <template>
<LayoutContainer <LayoutContainer
:header="id ? $t('views.application.applicationForm.title.edit'): $t('views.application.applicationForm.title.create')" :header="
id
? $t('views.application.applicationForm.title.edit')
: $t('views.application.applicationForm.title.create')
"
:back-to="id ? '' : '-1'" :back-to="id ? '' : '-1'"
class="create-application" class="create-application"
> >
<el-row v-loading="loading"> <el-row v-loading="loading">
<el-col :span="10"> <el-col :span="10">
<div class="p-24 mb-16" style="padding-bottom: 0"> <div class="p-24 mb-16" style="padding-bottom: 0">
<h4 class="title-decoration-1">{{$t('views.application.applicationForm.title.info')}}</h4> <h4 class="title-decoration-1">
{{ $t('views.application.applicationForm.title.info') }}
</h4>
</div> </div>
<div class="scrollbar-height-left"> <div class="scrollbar-height-left">
<el-scrollbar> <el-scrollbar>
@ -24,7 +30,10 @@
<el-form-item prop="name"> <el-form-item prop="name">
<template #label> <template #label>
<div class="flex-between"> <div class="flex-between">
<span>{{$t('views.application.applicationForm.form.appName.label')}} <span class="danger">*</span></span> <span
>{{ $t('views.application.applicationForm.form.appName.label') }}
<span class="danger">*</span></span
>
</div> </div>
</template> </template>
<el-input <el-input
@ -34,21 +43,28 @@
show-word-limit show-word-limit
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('views.application.applicationForm.form.appDescription.label')"> <el-form-item
:label="$t('views.application.applicationForm.form.appDescription.label')"
>
<el-input <el-input
v-model="applicationForm.desc" v-model="applicationForm.desc"
type="textarea" type="textarea"
:placeholder="$t('views.application.applicationForm.form.appDescription.placeholder')" :placeholder="
$t('views.application.applicationForm.form.appDescription.placeholder')
"
:rows="3" :rows="3"
maxlength="256" maxlength="256"
show-word-limit show-word-limit
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('views.application.applicationForm.form.aiModel.label')" prop="model_id"> <el-form-item
:label="$t('views.application.applicationForm.form.aiModel.label')"
prop="model_id"
>
<template #label> <template #label>
<div class="flex-between"> <div class="flex-between">
<span>{{$t('views.application.applicationForm.form.aiModel.label')}}</span> <span>{{ $t('views.application.applicationForm.form.aiModel.label') }}</span>
</div> </div>
</template> </template>
<el-select <el-select
@ -96,7 +112,9 @@
class="model-icon mr-8" class="model-icon mr-8"
></span> ></span>
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
<span class="danger">{{$t('views.application.applicationForm.form.aiModel.unavailable')}}</span> <span class="danger">{{
$t('views.application.applicationForm.form.aiModel.unavailable')
}}</span>
</div> </div>
<el-icon class="check-icon" v-if="item.id === applicationForm.model_id" <el-icon class="check-icon" v-if="item.id === applicationForm.model_id"
><Check ><Check
@ -106,22 +124,29 @@
<template #footer> <template #footer>
<div class="w-full text-left cursor" @click="openCreateModel()"> <div class="w-full text-left cursor" @click="openCreateModel()">
<el-button type="primary" link> <el-button type="primary" link>
<el-icon class="mr-4"><Plus /></el-icon> {{$t('views.application.applicationForm.form.addModel')}} <el-icon class="mr-4"><Plus /></el-icon>
{{ $t('views.application.applicationForm.form.addModel') }}
</el-button> </el-button>
</div> </div>
</template> </template>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('views.application.applicationForm.form.prompt.label')" prop="model_setting.prompt"> <el-form-item
:label="$t('views.application.applicationForm.form.prompt.label')"
prop="model_setting.prompt"
>
<template #label> <template #label>
<div class="flex align-center"> <div class="flex align-center">
<div class="flex-between mr-4"> <div class="flex-between mr-4">
<span>{{$t('views.application.applicationForm.form.prompt.label')}} <span class="danger">*</span></span> <span
>{{ $t('views.application.applicationForm.form.prompt.label') }}
<span class="danger">*</span></span
>
</div> </div>
<el-tooltip effect="dark" placement="right"> <el-tooltip effect="dark" placement="right">
<template #content <template #content>{{
>{{$t('views.application.applicationForm.form.prompt.tooltip')}}</template $t('views.application.applicationForm.form.prompt.tooltip')
> }}</template>
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon> <AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
</el-tooltip> </el-tooltip>
</div> </div>
@ -134,30 +159,39 @@
:placeholder="defaultPrompt" :placeholder="defaultPrompt"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('views.application.applicationForm.form.multipleRoundsDialogue')" @click.prevent> <el-form-item
:label="$t('views.application.applicationForm.form.multipleRoundsDialogue')"
@click.prevent
>
<el-switch <el-switch
size="small" size="small"
v-model="applicationForm.multiple_rounds_dialogue" v-model="applicationForm.multiple_rounds_dialogue"
></el-switch> ></el-switch>
</el-form-item> </el-form-item>
<el-form-item label="$t('views.application.applicationForm.form.relatedKnowledgeBase')"> <el-form-item
label="$t('views.application.applicationForm.form.relatedKnowledgeBase')"
>
<template #label> <template #label>
<div class="flex-between"> <div class="flex-between">
<span>{{$t('views.application.applicationForm.form.relatedKnowledgeBase')}}</span> <span>{{
$t('views.application.applicationForm.form.relatedKnowledgeBase')
}}</span>
<div> <div>
<el-button type="primary" link @click="openParamSettingDialog"> <el-button type="primary" link @click="openParamSettingDialog">
<AppIcon iconName="app-operation" class="mr-4"></AppIcon>{{$t('views.application.applicationForm.form.paramSetting')}} <AppIcon iconName="app-operation" class="mr-4"></AppIcon
>{{ $t('views.application.applicationForm.form.paramSetting') }}
</el-button> </el-button>
<el-button type="primary" link @click="openDatasetDialog"> <el-button type="primary" link @click="openDatasetDialog">
<el-icon class="mr-4"><Plus /></el-icon>{{$t('views.application.applicationForm.form.add')}} <el-icon class="mr-4"><Plus /></el-icon
>{{ $t('views.application.applicationForm.form.add') }}
</el-button> </el-button>
</div> </div>
</div> </div>
</template> </template>
<div class="w-full"> <div class="w-full">
<el-text type="info" v-if="applicationForm.dataset_id_list?.length === 0" <el-text type="info" v-if="applicationForm.dataset_id_list?.length === 0">{{
>{{$t('views.application.applicationForm.form.relatedKnowledgeBaseWhere')}}</el-text $t('views.application.applicationForm.form.relatedKnowledgeBaseWhere')
> }}</el-text>
<el-row :gutter="12" v-else> <el-row :gutter="12" v-else>
<el-col <el-col
:xs="24" :xs="24"
@ -209,10 +243,14 @@
<el-form-item @click.prevent> <el-form-item @click.prevent>
<template #label> <template #label>
<div class="flex align-center"> <div class="flex align-center">
<span class="mr-4">{{$t('views.application.applicationForm.form.problemOptimization.label')}}</span> <span class="mr-4">{{
$t('views.application.applicationForm.form.problemOptimization.label')
}}</span>
<el-tooltip <el-tooltip
effect="dark" effect="dark"
:content="$t('views.application.applicationForm.form.problemOptimization.tooltip')" :content="
$t('views.application.applicationForm.form.problemOptimization.tooltip')
"
placement="right" placement="right"
> >
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon> <AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
@ -225,16 +263,28 @@
</el-scrollbar> </el-scrollbar>
</div> </div>
<div class="text-right border-t p-16"> <div class="text-right border-t p-16">
<el-button v-if="!id" @click="router.push({ path: `/application` })">{{$t('views.application.applicationForm.buttons.cancel')}} </el-button> <el-button v-if="!id" @click="router.push({ path: `/application` })"
>{{ $t('views.application.applicationForm.buttons.cancel') }}
</el-button>
<el-button type="primary" @click="submit(applicationFormRef)" :disabled="loading"> <el-button type="primary" @click="submit(applicationFormRef)" :disabled="loading">
{{ id ? $t('views.application.applicationForm.buttons.save') : $t('views.application.applicationForm.buttons.create') }} {{
id
? $t('views.application.applicationForm.buttons.save')
: $t('views.application.applicationForm.buttons.create')
}}
</el-button> </el-button>
</div> </div>
</el-col> </el-col>
<el-col :span="14" class="p-24 border-l"> <el-col :span="14" class="p-24 border-l">
<h4 class="title-decoration-1 mb-16">{{$t('views.application.applicationForm.form.apptest')}}</h4> <h4 class="title-decoration-1 mb-16">
{{ $t('views.application.applicationForm.form.apptest') }}
</h4>
<div class="dialog-bg"> <div class="dialog-bg">
<h4 class="p-24">{{ applicationForm?.name || $t('views.application.applicationForm.form.appName.label') }}</h4> <h4 class="p-24">
{{
applicationForm?.name || $t('views.application.applicationForm.form.appName.label')
}}
</h4>
<div class="scrollbar-height"> <div class="scrollbar-height">
<AiChat :data="applicationForm"></AiChat> <AiChat :data="applicationForm"></AiChat>
</div> </div>
@ -284,8 +334,8 @@ const route = useRoute()
const { const {
params: { id } params: { id }
} = route as any } = route as any
// @ts-ignore // @ts-ignore
const defaultPrompt =t('views.application.prompt.defaultPrompt') const defaultPrompt = t('views.application.prompt.defaultPrompt')
const ParamSettingDialogRef = ref<InstanceType<typeof ParamSettingDialog>>() const ParamSettingDialogRef = ref<InstanceType<typeof ParamSettingDialog>>()
const createModelRef = ref<InstanceType<typeof CreateModelDialog>>() const createModelRef = ref<InstanceType<typeof CreateModelDialog>>()
@ -320,15 +370,27 @@ const applicationForm = ref<ApplicationFormType>({
}) })
const rules = reactive<FormRules<ApplicationFormType>>({ const rules = reactive<FormRules<ApplicationFormType>>({
name: [{ required: true, message: t('views.application.applicationForm.appName.placeholder'), trigger: 'blur' }], name: [
{
required: true,
message: t('views.application.applicationForm.form.appName.placeholder'),
trigger: 'blur'
}
],
model_id: [ model_id: [
{ {
required: false, required: false,
message: t('views.application.applicationForm.aiModel.placeholder'), message: t('views.application.applicationForm.form.aiModel.placeholder'),
trigger: 'change' trigger: 'change'
} }
], ],
'model_setting.prompt': [{ required: true, message:t('views.application.applicationForm.prompt.placeholder'), trigger: 'blur' }] 'model_setting.prompt': [
{
required: true,
message: t('views.application.applicationForm.form.prompt.placeholder'),
trigger: 'blur'
}
]
}) })
const modelOptions = ref<any>(null) const modelOptions = ref<any>(null)
const providerOptions = ref<Array<Provider>>([]) const providerOptions = ref<Array<Provider>>([])