Commit 9cac7cc5 authored by mhw's avatar mhw

bug修复

parent 6b9ec22e
......@@ -19,7 +19,7 @@
<el-form-item label="提示词:" style="">
<div style="display: flex;flex-direction: row;align-items: center;">
<el-select v-model="promptTemplate" filterable placeholder="提示词" value-key="templateId" @change="templateControllerChange" clearable>
<el-option v-for="item in templateControllerList" :key="item.value" :label="item.label" :value="item">
<el-option v-for="item in templateControllerList" :key="item.templateId" :label="item.label" :value="item">
</el-option>
</el-select>
<el-switch @change="changePromptTemplate" style="margin-left: 10px;" v-model="isPromptTemplate" active-color="#13ce66" inactive-color="#ff4949">
......@@ -215,6 +215,7 @@ export default {
this.modelList = res.data.map((item) => {
return { id: item.modelId, name: item.modelName, children: item.modelVersionList === [] ? [] : item.modelVersionList.map((item2) => { return { id: item2.versionId, name: item2.versionName } }) }
})
this.getActiveModelList()
}).catch(e => {
console.log(e);
......
......@@ -126,7 +126,8 @@ export default {
})
this.inputContent = null;
console.log(this.myHistory.slice(0, -1).slice(-this.heistoryRotate));
this.param.history = []
this.myHistory.slice(0, -1).slice(-this.heistoryRotate).forEach((item) => {
this.param.history.push(...[{ role: item.role, content: item.content }, { role: 'assistant', content: item.excludeReferenceAnswer}])
})
......@@ -145,7 +146,8 @@ export default {
onmessage (data) {
let nowChat = this.myHistory[this.myHistory.length - 1]
if (this.chatForm.pattern === '通用智能问答') {
nowChat.answer += data
nowChat.excludeReferenceAnswer += data
nowChat.answer += data;
} else if (this.chatForm.pattern === '专业知识库问答') {
let temporary = JSON.parse(`[${data}]`.replace(/}{/g, '},{'))
temporary.forEach((item) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment