Commit b62a22ec authored by mhw's avatar mhw

版本跟新

parent b7558ad7
...@@ -6,11 +6,12 @@ export default class DatasetData { ...@@ -6,11 +6,12 @@ export default class DatasetData {
static view (sender, params, axiosOption, httpOption) { static view (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/datasetData/view', 'get', params, axiosOption, httpOption); return sender.doUrl('/admin/app/datasetData/view', 'get', params, axiosOption, httpOption);
} }
static update (sender, params, axiosOption, httpOption) { static update (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/datasetData/update', 'post', params, axiosOption, httpOption); return sender.doUrl('/admin/app/datasetData/update', 'post', params, axiosOption, httpOption);
} }
static add (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/datasetData/add', 'post', params, axiosOption, httpOption);
}
static delete (sender, params, axiosOption, httpOption) { static delete (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/datasetData/delete', 'post', params, axiosOption, httpOption); return sender.doUrl('/admin/app/datasetData/delete', 'post', params, axiosOption, httpOption);
} }
...@@ -20,5 +21,4 @@ export default class DatasetData { ...@@ -20,5 +21,4 @@ export default class DatasetData {
static summaryCount (sender, params, axiosOption, httpOption) { static summaryCount (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/datasetData/summaryCount', 'get', params, axiosOption, httpOption); return sender.doUrl('/admin/app/datasetData/summaryCount', 'get', params, axiosOption, httpOption);
} }
DatasetData
} }
module.exports = { module.exports = {
// baseUrl: 'http://218.76.0.69:8082/', // baseUrl: 'http://218.76.0.69:8082/',
baseUrl: 'http://192.168.0.34:8082/', // baseUrl: 'http://192.168.0.34:8082/',
// baseUrl: 'http://192.168.0.36:8082/', // baseUrl: 'http://192.168.0.36:8082/',
// baseUrl: 'http://192.168.0.168:8082/', baseUrl: 'http://192.168.0.36:8082/',
wsUrl: 'ws://218.76.0.69:7860/', wsUrl: 'ws://218.76.0.69:7860/',
projectName: '灵境大模型平台' projectName: '灵境大模型平台'
} }
...@@ -101,9 +101,8 @@ class GetStreaming { ...@@ -101,9 +101,8 @@ class GetStreaming {
} catch { } catch {
console.error('onmessage error'); console.error('onmessage error');
} }
that.onmessage(data) that.onmessage(JSON.stringify(data))
console.info(data); if (data?.status === 0) {
if (data.status === 0) {
that.success() that.success()
} }
}, },
......
...@@ -15,6 +15,7 @@ class SocketService { ...@@ -15,6 +15,7 @@ class SocketService {
} }
// 初始化weosocket // 初始化weosocket
async initWebSocket () { async initWebSocket () {
console.log(1111123123123123);
this.ws = await new WebSocket(this.url); this.ws = await new WebSocket(this.url);
this.ws.onopen = await this.websocketonopen.bind(this); this.ws.onopen = await this.websocketonopen.bind(this);
this.ws.onerror = await this.websocketonerror.bind(this); this.ws.onerror = await this.websocketonerror.bind(this);
...@@ -63,6 +64,9 @@ class SocketService { ...@@ -63,6 +64,9 @@ class SocketService {
websocketclose (e) { // 关闭 websocketclose (e) { // 关闭
// Message('connection closed (' + e.code + ')') // Message('connection closed (' + e.code + ')')
} }
close () {
this.ws.close();
}
} }
export { SocketService } export { SocketService }
...@@ -31,10 +31,10 @@ import { DatasetData } from '@/api/gptController.js' ...@@ -31,10 +31,10 @@ import { DatasetData } from '@/api/gptController.js'
export default { export default {
data() { data() {
return { return {
form: JSON.parse(JSON.stringify(this.row)) form: this.deepCopy(this.row)
} }
}, },
props: ['row', 'columnList', 'refresh', 'isEdit'], props: ['row', 'columnList', 'refresh', 'isEdit', 'versionId'],
components: {}, components: {},
computed: {}, computed: {},
...@@ -42,6 +42,13 @@ export default { ...@@ -42,6 +42,13 @@ export default {
mounted() {}, mounted() {},
methods: { methods: {
deepCopy(data) {
try {
return JSON.parse(JSON.stringify(data))
} catch (error) {
return { data: { instruction: '', output: '' } }
}
},
onCancel(isSuccess) { onCancel(isSuccess) {
if (this.observer != null) { if (this.observer != null) {
this.observer.cancel(isSuccess) this.observer.cancel(isSuccess)
...@@ -50,9 +57,10 @@ export default { ...@@ -50,9 +57,10 @@ export default {
onSubmit() { onSubmit() {
let params = {} let params = {}
params.datasetMongoDto = this.form params.datasetMongoDto = this.form
DatasetData.update(this, params) params.datasetMongoDto.versionId = this.versionId
DatasetData[this.versionId ? 'add' : 'update'](this, params)
.then((res) => { .then((res) => {
this.$message.success('编辑成功') this.$message.success(this.versionId ? '添加成功' : '编辑成功')
this.onCancel(true) this.onCancel(true)
}) })
.catch((e) => {}) .catch((e) => {})
......
...@@ -2,17 +2,20 @@ ...@@ -2,17 +2,20 @@
<template> <template>
<div class="tableBox"> <div class="tableBox">
<div class="topBox">
<el-breadcrumb separator="|"> <el-breadcrumb separator="|">
<el-breadcrumb-item :class="nowPage==0?'isactive':''" @click.native="breadcrumbClick(0)">全部({{ allNum}}</el-breadcrumb-item> <el-breadcrumb-item :class="nowPage==0?'isactive':''" @click.native="breadcrumbClick(0)">全部({{ allNum}}</el-breadcrumb-item>
<el-breadcrumb-item :class="nowPage==1?'isactive':''" @click.native="breadcrumbClick(1)">无标注信息({{ unmarkedNum}}</el-breadcrumb-item> <el-breadcrumb-item :class="nowPage==1?'isactive':''" @click.native="breadcrumbClick(1)">无标注信息({{ unmarkedNum}}</el-breadcrumb-item>
<el-breadcrumb-item :class="nowPage==2?'isactive':''" @click.native="breadcrumbClick(2)">有标注信息({{ markedNum}}</el-breadcrumb-item> <el-breadcrumb-item :class="nowPage==2?'isactive':''" @click.native="breadcrumbClick(2)">有标注信息({{ markedNum}}</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
<el-button :size="defaultFormItemSize" @click="add()">新增</el-button>
</div>
<vxe-table border show-header-overflow show-overflow :row-config="{ isHover: true }" :data="myDataSetPage.tableData.impl.dataList" min-height="96"> <vxe-table border show-header-overflow show-overflow :row-config="{ isHover: true }" :data="myDataSetPage.tableData.impl.dataList" min-height="96">
<!-- <vxe-column field="index" title="序号"></vxe-column> --> <!-- <vxe-column field="index" title="序号"></vxe-column> -->
<!-- <vxe-column :field="'data.'+item" :title="item" v-for="item in columnList" :key="item"></vxe-column> --> <!-- <vxe-column :field="'data.'+item" :title="item" v-for="item in columnList" :key="item"></vxe-column> -->
<vxe-column field="data.instruction" title="问题"></vxe-column> <vxe-column field="data.instruction" title="问题"></vxe-column>
<vxe-column field="data.output" title="回答"></vxe-column> <vxe-column field="data.output" title="回答"></vxe-column>
<vxe-column field="operation" title="操作" width="150px"> <vxe-column field="operation" title="操作" width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" :size="defaultFormItemSize" @click="check(scope.row)">查看</el-button> <el-button type="text" :size="defaultFormItemSize" @click="check(scope.row)">查看</el-button>
...@@ -150,9 +153,28 @@ export default { ...@@ -150,9 +153,28 @@ export default {
) )
.then((res) => { .then((res) => {
this.refresh() this.refresh()
this.summaryCount()
}) })
.catch((e) => {}) .catch((e) => {})
}, },
add() {
// 添加
this.$dialog
.show(
'添加',
label,
{
area: ['70%', '50%']
},
{ versionId: this.versionItem.versionId, refresh: this.refresh, isEdit: true }
)
.then((res) => {
this.refresh()
this.summaryCount()
})
.catch((e) => {})
},
del(item) { del(item) {
this.$confirm('是否确认删除', '提示', { this.$confirm('是否确认删除', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -164,6 +186,7 @@ export default { ...@@ -164,6 +186,7 @@ export default {
.then((res) => { .then((res) => {
this.$message.success('删除成功') this.$message.success('删除成功')
this.refresh() this.refresh()
this.summaryCount()
}) })
.catch((e) => { .catch((e) => {
console.log(e) console.log(e)
...@@ -282,4 +305,10 @@ export default { ...@@ -282,4 +305,10 @@ export default {
/deep/ .isactive .el-breadcrumb__inner { /deep/ .isactive .el-breadcrumb__inner {
color: #0092ff !important; color: #0092ff !important;
} }
.topBox {
display: flex;
height: auto;
align-items: center;
justify-content: space-between;
}
</style> </style>
<!--详情 --> <!--详情 -->
<template> <template>
<div class="tableBox"> <div class="tableBox">
<el-breadcrumb separator="|"> <el-breadcrumb separator="|">
<el-breadcrumb-item :class="nowPage==0?'isactive':''" @click.native="breadcrumbClick(0)">全部({{ allNum}}</el-breadcrumb-item> <el-breadcrumb-item :class="nowPage==0?'isactive':''" @click.native="breadcrumbClick(0)">全部({{ allNum}}</el-breadcrumb-item>
...@@ -150,6 +149,7 @@ export default { ...@@ -150,6 +149,7 @@ export default {
) )
.then((res) => { .then((res) => {
this.refresh() this.refresh()
this.summaryCount()
}) })
.catch((e) => {}) .catch((e) => {})
}, },
...@@ -164,6 +164,7 @@ export default { ...@@ -164,6 +164,7 @@ export default {
.then((res) => { .then((res) => {
this.$message.success('删除成功') this.$message.success('删除成功')
this.refresh() this.refresh()
this.summaryCount()
}) })
.catch((e) => { .catch((e) => {
console.log(e) console.log(e)
......
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
</template> </template>
<script> <script>
import Clipboard from 'clipboard'; import Clipboard from 'clipboard'
import { TuningRun } from '@/api/gptController.js'; import { TuningRun } from '@/api/gptController.js'
// import { getSessionHash } from '@/utils/index'; // import { getSessionHash } from '@/utils/index';
export default { export default {
data () { data() {
return { return {
clipboard: null, clipboard: null,
result: '', result: '',
...@@ -26,59 +26,62 @@ export default { ...@@ -26,59 +26,62 @@ export default {
fn_index: 18, fn_index: 18,
session_hash: this.item.runId session_hash: this.item.runId
} }
}; }
}, },
components: {}, components: {},
computed: { computed: {
resultAdjust () { resultAdjust() {
return this.result.replace(/\n/g, '<br/>').replace('```bash', '') return this.result.replace(/\n/g, '<br/>').replace('```bash', '')
} }
}, },
props: ['item'], props: ['item'],
mounted () { mounted() {
this.SocketService.initWebSocket() this.SocketService.initWebSocket()
this.clipboard = new Clipboard(this.$refs.copy.$el); this.clipboard = new Clipboard(this.$refs.copy.$el)
}, },
methods: { methods: {
successful() {
successful () { // 连接成功 // 连接成功
this.send(`{"fn_index":${this.wsData.fn_index},"session_hash":"${this.wsData.session_hash}"}`) this.send(`{"fn_index":${this.wsData.fn_index},"session_hash":"${this.wsData.session_hash}"}`)
this.getPreviewCommand() this.getPreviewCommand()
}, },
getPreviewCommand () { // 获取参数 getPreviewCommand() {
TuningRun.getPreviewCommand(this, {runId: this.item.runId}).then((res) => { // 获取参数
TuningRun.getPreviewCommand(this, { runId: this.item.runId }).then((res) => {
this.wsData.data = res.data this.wsData.data = res.data
this.send(JSON.stringify(this.wsData)) this.send(JSON.stringify(this.wsData))
}) })
}, },
send (data) { // 发送参数 send(data) {
// 发送参数
this.SocketService.websocketsend(data) this.SocketService.websocketsend(data)
}, },
websocketonmessage (e) { // 返回接收参数 websocketonmessage(e) {
// 返回接收参数
console.log(e)
if (JSON.parse(e.data).msg === 'process_generating') { if (JSON.parse(e.data).msg === 'process_generating') {
this.result = JSON.parse(e.data).output.data[0] this.result = JSON.parse(e.data).output.data[0]
} }
}, },
copy () { copy() {
try { try {
this.clipboard.on('success', e => { this.clipboard.on('success', (e) => {
this.$message.success('接入信息复制成功!'); this.$message.success('接入信息复制成功!')
this.clipboard = null this.clipboard = null
}); })
this.clipboard.on('error', e => { this.clipboard.on('error', (e) => {
this.$message.error('浏览器不支持复制'); this.$message.error('浏览器不支持复制')
this.clipboard = null this.clipboard = null
}); })
} catch (e) { } catch (e) {
console.log(e); console.log(e)
} }
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
</style> </style>
<!-- 任务列表操作 --> <!-- 任务列表操作 -->
<template> <template>
<div class="tableBox"> <div class="tableBox">
<el-button :size="defaultFormItemSize" type="primary" @click="preview">预览命令</el-button> <el-button :size="defaultFormItemSize" type="primary" @click="preview">预览命令</el-button>
<el-button :size="defaultFormItemSize" type="primary" @click="start" :disabled="istraining" >开始训练</el-button> <el-button :size="defaultFormItemSize" type="primary" @click="start" :disabled="istraining">开始训练</el-button>
<el-button :size="defaultFormItemSize" type="primary" @click="pause" :disabled="!istraining">中断训练</el-button> <el-button :size="defaultFormItemSize" type="primary" @click="pause" :disabled="!istraining">中断训练</el-button>
<el-tabs v-model="activeName" :size="defaultFormItemSize"> <el-tabs v-model="activeName" :size="defaultFormItemSize">
<el-tab-pane label="运行详情" name="particulars"><particulars :item="item" /></el-tab-pane> <el-tab-pane label="运行详情" name="particulars">
<el-tab-pane label="评估报告" name="assessmentReport"><assessmentReport ref="assessmentReport" :item="item" :result="result" :img="img" /></el-tab-pane> <particulars :item="item" />
<el-tab-pane label="训练日志" name="trainingLog"><trainingLog :item="item" :result="result" /></el-tab-pane> </el-tab-pane>
<el-tab-pane label="评估报告" name="assessmentReport">
<assessmentReport ref="assessmentReport" :item="item" :result="result" :img="img" />
</el-tab-pane>
<el-tab-pane label="训练日志" name="trainingLog">
<trainingLog :item="item" :result="result" />
</el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</template> </template>
<script> <script>
import particulars from './operate/particulars'; import particulars from './operate/particulars'
import assessmentReport from './operate/assessmentReport'; import assessmentReport from './operate/assessmentReport'
import trainingLog from './operate/trainingLog'; import trainingLog from './operate/trainingLog'
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
import previewCommand from './previewCommand'; import previewCommand from './previewCommand'
// import { getSessionHash } from '@/utils/index'; // import { getSessionHash } from '@/utils/index';
import { TuningRun, PyApi } from '@/api/gptController.js'; import { TuningRun, PyApi } from '@/api/gptController.js'
export default { export default {
data () { data() {
return { return {
istraining: false, // 是否在训练中 istraining: false, // 是否在训练中
img: '', img: '',
...@@ -36,34 +41,32 @@ export default { ...@@ -36,34 +41,32 @@ export default {
}, },
activeName: this.page, activeName: this.page,
timeImg: null timeImg: null
}; }
}, },
props: ['page', 'item'], props: ['page', 'item'],
components: {particulars, assessmentReport, trainingLog}, components: { particulars, assessmentReport, trainingLog },
computed: {}, computed: {},
mounted () { mounted() {},
},
methods: { methods: {
PyApi(index, data = []) {
PyApi (index, data = []) {
let param = { let param = {
data: data, data: data,
event_data: null, event_data: null,
fn_index: index, fn_index: index,
session_hash: this.item.runId session_hash: this.item.runId
} }
return PyApi.predict(this, param).then((res) => { return PyApi.predict(this, param).then((res) => {
if (index === 22) { // 图片 if (index === 22) {
// 图片
// console.log(res); // console.log(res);
this.img = JSON.parse(res.data).data[0]?.plot; this.img = JSON.parse(res.data).data[0]?.plot
console.log(this.img); console.log(this.img)
} else if (index === 20) { // 暂停 } else if (index === 20) {
// 暂停
this.$message({ this.$message({
message: '已暂停', message: '已暂停',
type: 'success' type: 'success'
...@@ -72,62 +75,76 @@ export default { ...@@ -72,62 +75,76 @@ export default {
// this.result = {output: {data: []}} // this.result = {output: {data: []}}
}) })
}, },
preview () { preview() {
this.$dialog.show('预览命令', previewCommand, { this.$dialog
.show(
'预览命令',
previewCommand,
{
area: ['50%', '70%'] area: ['50%', '70%']
}, {item: this.item}).then(res => {
this.refresh();
}).catch(e => { });
}, },
start () { { item: this.item }
)
.then((res) => {
this.refresh()
})
.catch((e) => {})
},
start() {
this.SocketService.initWebSocket() this.SocketService.initWebSocket()
}, },
async pause () { async pause() {
await this.PyApi(20) await this.PyApi(20)
TuningRun.updateById(this, {tuningRunDto: {runId: this.item.runId, runStatus: -2}}).then(res => { TuningRun.updateById(this, { tuningRunDto: { runId: this.item.runId, runStatus: -2 } })
console.log(res); .then((res) => {
}).catch(e => { console.log(res)
})
}); .catch((e) => {})
}, },
getPreviewCommand () { // 获取参数 getPreviewCommand() {
TuningRun.getPreviewCommand(this, {runId: this.item.runId}).then((res) => { // 获取参数
TuningRun.getPreviewCommand(this, { runId: this.item.runId }).then((res) => {
this.wsData.data = res.data this.wsData.data = res.data
this.send(JSON.stringify(this.wsData)) this.send(JSON.stringify(this.wsData))
}) })
}, },
successful () { // 连接成功 successful() {
// 连接成功
this.send(`{"fn_index":${this.wsData.fn_index},"session_hash":"${this.wsData.session_hash}"}`) this.send(`{"fn_index":${this.wsData.fn_index},"session_hash":"${this.wsData.session_hash}"}`)
// this.getPreviewCommand() // this.getPreviewCommand()
}, },
send (data) { // 发送参数 send(data) {
// 发送参数
this.SocketService.websocketsend(data) this.SocketService.websocketsend(data)
}, },
websocketonmessage (e) { // 返回接收参数 websocketonmessage(e) {
if (JSON.parse(e.data).msg === 'process_generating') { // 开始训练 // 返回接收参数
if (JSON.parse(e.data).msg === 'process_generating') {
// 开始训练
this.istraining = true this.istraining = true
this.result = JSON.parse(e.data) this.result = JSON.parse(e.data)
if (!this.timeImg) { if (!this.timeImg) {
// this.startGetImg() // this.startGetImg()
} }
} else if (JSON.parse(e.data).msg === 'process_completed') { // 训练结束 } else if (JSON.parse(e.data).msg === 'process_completed') {
// 训练结束
this.$refs.assessmentReport.completed() this.$refs.assessmentReport.completed()
clearInterval(this.timeImg) clearInterval(this.timeImg)
this.timeImg = null this.timeImg = null
this.istraining = false this.istraining = false
this.$refs.assessmentReport.init(true) this.$refs.assessmentReport.init(true)
} else if (JSON.parse(e.data).msg === 'send_data') { // 可以发送训练数据 } else if (JSON.parse(e.data).msg === 'send_data') {
// 可以发送训练数据
this.getPreviewCommand() this.getPreviewCommand()
} }
}, },
startGetImg () { startGetImg() {
this.timeImg = setInterval(() => { this.timeImg = setInterval(() => {
this.PyApi(22, [this.wsData.data[1], this.wsData.data[3], this.wsData.data[37]]) this.PyApi(22, [this.wsData.data[1], this.wsData.data[3], this.wsData.data[37]])
}, 10000); }, 10000)
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
</style> </style>
...@@ -64,6 +64,7 @@ export default { ...@@ -64,6 +64,7 @@ export default {
this.getDataList() this.getDataList()
if (this.isCopy) { if (this.isCopy) {
this.form.modelEstimateDto = { ...this.item } this.form.modelEstimateDto = { ...this.item }
this.form.modelEstimateDto.datasetVersionIds = this.item.datasetVersionIds
} else if (this.modelVersionId) { } else if (this.modelVersionId) {
this.form.modelEstimateDto.modelVersionId = this.modelVersionId this.form.modelEstimateDto.modelVersionId = this.modelVersionId
} }
......
...@@ -146,48 +146,51 @@ export default { ...@@ -146,48 +146,51 @@ export default {
}, },
onmessage(data) { onmessage(data) {
console.log(data) let nowChat = this.myHistory[this.myHistory.length - 1]
// let nowChat = this.myHistory[this.myHistory.length - 1] if (this.chatForm.pattern === 0) {
// if (this.chatForm.pattern === 0) { let temporary = JSON.parse(`[${data}]`.replace(/}{/g, '},{'))
// // 通用智能问答 // 通用智能问答
// // data = data.replace(/^data:\s+|\s+$/g, '') // data = data.replace(/^data:\s+|\s+$/g, '')
// nowChat.excludeReferenceAnswer += data // nowChat.excludeReferenceAnswer += data.answer
// nowChat.answer += data // nowChat.answer += data.answer
// } else if (this.chatForm.pattern === 1) { temporary.forEach((item) => {
// // 专业知识库问答 this.modifyContent(item) // 修改返回内容
// // console.log(data) nowChat.excludeReferenceAnswer += item.answer || '' // 排除回答中的引用内容
// let temporary = JSON.parse(`[${data}]`.replace(/}{/g, '},{')) nowChat.answer += item.answer || '\n' + (item.docs || '')
// temporary.forEach((item) => { })
// this.modifyContent(item) // 修改返回内容 } else if (this.chatForm.pattern === 1) {
// nowChat.excludeReferenceAnswer += item.answer || '' // 排除回答中的引用内容 // 专业知识库问答
// nowChat.answer += item.answer || '\n' + item.docs // console.log(data)
// }) let temporary = JSON.parse(`[${data}]`.replace(/}{/g, '},{'))
// } else if (this.chatForm.pattern === 2) { temporary.forEach((item) => {
// // 搜索引擎问答 this.modifyContent(item) // 修改返回内容
// } else if (this.chatForm.pattern === 3) { nowChat.excludeReferenceAnswer += item.answer || '' // 排除回答中的引用内容
// // 基于文件问答 nowChat.answer += item.answer || '\n' + (item.docs || '')
// let temporary = JSON.parse(`[${data}]`.replace(/}{/g, '},{')) })
} else if (this.chatForm.pattern === 2) {
// temporary.forEach((item) => { // 搜索引擎问答
// this.modifyContent(item) // 修改返回内容 } else if (this.chatForm.pattern === 3) {
// nowChat.excludeReferenceAnswer += item.answer || '' // 排除回答中的引用内容 // 基于文件问答
// nowChat.answer += item.answer || '\n' + item.docs let temporary = JSON.parse(`[${data}]`.replace(/}{/g, '},{'))
// })
// } else if (this.chatForm.pattern === 4) {
// let temporary = JSON.parse(`[${data}]`.replace(/}{/g, '},{'))
// temporary.forEach((item) => { temporary.forEach((item) => {
// console.log(item) this.modifyContent(item) // 修改返回内容
// this.modifyContent(item) // 修改返回内容 nowChat.excludeReferenceAnswer += item.answer || '' // 排除回答中的引用内容
// nowChat.excludeReferenceAnswer += item.answer || '' // 排除回答中的引用内容 nowChat.answer += item.answer || '\n' + (item.docs || '')
// nowChat.answer += item.answer || '\n' + item.docs.join() })
// // nowChat.answer += item.answer += '\n' + item.docs.join() } else if (this.chatForm.pattern === 4) {
// }) let temporary = JSON.parse(`[${data}]`.replace(/}{/g, '},{'))
// } temporary.forEach((item) => {
this.modifyContent(item) // 修改返回内容
nowChat.excludeReferenceAnswer += item.answer || '' // 排除回答中的引用内容
nowChat.answer += item.answer || '\n' + (item.docs.join() || '')
// nowChat.answer += item.answer += '\n' + item.docs.join()
})
}
// this.$nextTick(() => { this.$nextTick(() => {
// this.$refs.contentBox.scrollTo(0, this.$refs.contentBox.scrollHeight) this.$refs.contentBox.scrollTo(0, this.$refs.contentBox.scrollHeight)
// }) })
}, },
modifyContent(item) { modifyContent(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