|
@@ -1,6 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div class="pb_content" style="background: #f0f2f5" v-loading="loading" element-loading-text="小可正在努力生成中,请稍等...">
|
|
<div class="pb_content" style="background: #f0f2f5" v-loading="loading" element-loading-text="小可正在努力生成中,请稍等...">
|
|
<div class="c_pub_button_confirm stopBtn" v-if="loading && isOutlineCancelToken" @click="cancelAjax('outline')">停止</div>
|
|
<div class="c_pub_button_confirm stopBtn" v-if="loading && isOutlineCancelToken" @click="cancelAjax('outline')">停止</div>
|
|
|
|
+ <div class="c_pub_button_confirm stopBtn" v-if="loading && isTeacherTaskCancelToken" @click="cancelAjax('teacherTask')">停止</div>
|
|
<div class="pb_content_body" style="position: relative; margin: 0">
|
|
<div class="pb_content_body" style="position: relative; margin: 0">
|
|
<div class="right" :style="{width:istemplate == 1 ? 'calc(100% - 300px)' : '100%'}">
|
|
<div class="right" :style="{width:istemplate == 1 ? 'calc(100% - 300px)' : '100%'}">
|
|
<div class="courseTop">
|
|
<div class="courseTop">
|
|
@@ -527,7 +528,8 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-loading="teacherTextLoading" element-loading-text="小可正在努力生成中,请稍等..." v-if="(!yiKeTemplateArray.includes(templateid)) && isuseT">
|
|
|
|
|
|
+ <div class="whiteBg" :style="{ minHeight: teacherTextLoading ? '250px' : 'auto'}" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;position: relative" v-loading="teacherTextLoading" element-loading-text="小可正在努力生成中,请稍等..." v-if="(!yiKeTemplateArray.includes(templateid)) && isuseT">
|
|
|
|
+ <div class="c_pub_button_confirm stopBtn" v-if="teacherTextLoading && isTeacherTextCancelToken" @click="cancelAjax('teacherText')">停止</div>
|
|
<div class="whiteBg" style="border-radius: 0; margin-top: 15px">
|
|
<div class="whiteBg" style="border-radius: 0; margin-top: 15px">
|
|
<div class="c_info_title">
|
|
<div class="c_info_title">
|
|
已有教案摘要
|
|
已有教案摘要
|
|
@@ -558,7 +560,8 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-loading="targetTextLoading" element-loading-text="小可正在努力生成中,请稍等..." v-if="(!yiKeTemplateArray.includes(templateid)) && isuseT">
|
|
|
|
|
|
+ <div class="whiteBg" :style="{ minHeight: targetTextLoading ? '250px' : 'auto'}" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-loading="targetTextLoading" element-loading-text="小可正在努力生成中,请稍等..." v-if="(!yiKeTemplateArray.includes(templateid)) && isuseT">
|
|
|
|
+ <div class="c_pub_button_confirm stopBtn" v-if="targetTextLoading && isTargetCancelToken1" @click="cancelAjax('target1')">停止</div>
|
|
<div class="whiteBg" style="border-radius: 0; margin-top: 15px">
|
|
<div class="whiteBg" style="border-radius: 0; margin-top: 15px">
|
|
<div class="c_info_title">
|
|
<div class="c_info_title">
|
|
课程目标
|
|
课程目标
|
|
@@ -1398,7 +1401,8 @@
|
|
<button class="c_pub_button_confirm2" style="margin: 0px 0px 0px 5px;" @click="deleteTask2(index)" v-if="unitJson[0].chapterInfo[0].taskJson.length > 1">删除</button>
|
|
<button class="c_pub_button_confirm2" style="margin: 0px 0px 0px 5px;" @click="deleteTask2(index)" v-if="unitJson[0].chapterInfo[0].taskJson.length > 1">删除</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="outline_detail" v-loading="taskDetailLoading.indexOf('task-' + index) !== -1" element-loading-text="小可正在努力生成中,请稍等...">
|
|
|
|
|
|
+ <div class="outline_detail" :style="{ minHeight: taskDetailLoading.indexOf('task-' + index) !== -1 ? '250px' : 'auto'}" v-loading="taskDetailLoading.indexOf('task-' + index) !== -1" element-loading-text="小可正在努力生成中,请稍等...">
|
|
|
|
+ <div div class="c_pub_button_confirm stopBtn" v-if="taskDetailLoading.indexOf('task-' + index) !== -1 && isOutlineTaskCancelToken[index]" @click="cancelAjax('outlineTask', index)">停止</div>
|
|
<textarea v-autoHeight="100" rows="4" class="binfo_input binfo_textarea" cols
|
|
<textarea v-autoHeight="100" rows="4" class="binfo_input binfo_textarea" cols
|
|
placeholder="请输入任务描述" v-model="item.taskDetail2" v-if="item.isTask2"></textarea>
|
|
placeholder="请输入任务描述" v-model="item.taskDetail2" v-if="item.isTask2"></textarea>
|
|
<div class="markBox vditor-reset" style="white-space:pre-wrap;" v-text="item.taskDetail2" v-else-if="ttaskDetailLoading.indexOf('task-' + index) !== -1"></div>
|
|
<div class="markBox vditor-reset" style="white-space:pre-wrap;" v-text="item.taskDetail2" v-else-if="ttaskDetailLoading.indexOf('task-' + index) !== -1"></div>
|
|
@@ -1543,7 +1547,7 @@
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
<button class="c_pub_button_confirm" style="margin: 0 20px 0 auto;"
|
|
<button class="c_pub_button_confirm" style="margin: 0 20px 0 auto;"
|
|
@click="openAiDialog2(2, 'aiTeacher2')" v-if="panTeacher() > 0 && istemplate != 1">重新生成教案</button>
|
|
@click="openAiDialog2(2, 'aiTeacher2')" v-if="panTeacher() > 0 && istemplate != 1">重新生成教案</button>
|
|
- <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom" v-if="panTeacher() == 0 && istemplate == 1 && templateid == '4480d65a-1e48-11ef-bee5-005056b86db5' && templateid != 'cf5722a4-401b-11ef-b873-005056b86dc3'">
|
|
|
|
|
|
+ <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom" v-if="panTeacher() == 0 && istemplate == 1 && (templateid == '4480d65a-1e48-11ef-bee5-005056b86db5' || templateid == 'cf5722a4-401b-11ef-b873-005056b86dc3')">
|
|
<button class="c_pub_button_confirm" style="margin: 0 20px 0 auto;"
|
|
<button class="c_pub_button_confirm" style="margin: 0 20px 0 auto;"
|
|
@contextmenu.prevent="openAiDialog(1, 'aiTeacher3')"
|
|
@contextmenu.prevent="openAiDialog(1, 'aiTeacher3')"
|
|
@click="openAiDialog(2, 'aiTeacher3')">生成教案</button>
|
|
@click="openAiDialog(2, 'aiTeacher3')">生成教案</button>
|
|
@@ -7314,12 +7318,20 @@ export default {
|
|
pingjiainfoisFinishSize: [],
|
|
pingjiainfoisFinishSize: [],
|
|
pingjiainfoisAllSize: [],
|
|
pingjiainfoisAllSize: [],
|
|
pingjiainfoprogress: [],
|
|
pingjiainfoprogress: [],
|
|
- isOutlineCancelToken: null,
|
|
|
|
taskGLoading: [],
|
|
taskGLoading: [],
|
|
|
|
+ isOutlineCancelToken: null,
|
|
isFileCancelToken: null,
|
|
isFileCancelToken: null,
|
|
isTargetCancelToken1: null,
|
|
isTargetCancelToken1: null,
|
|
isTargetCancelToken2: null,
|
|
isTargetCancelToken2: null,
|
|
isTextCancelToken: null,
|
|
isTextCancelToken: null,
|
|
|
|
+ isTeacherTextCancelToken: null,
|
|
|
|
+ isTeacherTaskCancelToken: null,
|
|
|
|
+ isOutlineTaskCancelToken: [],
|
|
|
|
+ isTextCancelSource: null,
|
|
|
|
+ isOutlineTaskCancelSource: [],
|
|
|
|
+ isTeacherTextCancelSource: null,
|
|
|
|
+ isTargetCancelSource1: null,
|
|
|
|
+ isTargetCancelSource2: null,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
directives: {
|
|
directives: {
|
|
@@ -16869,21 +16881,23 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
},
|
|
},
|
|
aiGetgetAiContent(_uid) {
|
|
aiGetgetAiContent(_uid) {
|
|
// let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
- let _source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
|
|
|
+ this.isTextCancelSource = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
let _allText = "";
|
|
let _allText = "";
|
|
let _mdText = "";
|
|
let _mdText = "";
|
|
let _iindex = 0
|
|
let _iindex = 0
|
|
- _source.onmessage = _e => {
|
|
|
|
|
|
+ this.isTextCancelSource.onmessage = _e => {
|
|
let _eData = JSON.parse(_e.data).content;
|
|
let _eData = JSON.parse(_e.data).content;
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
//对话已经完成
|
|
//对话已经完成
|
|
_mdText = _mdText.replace("_", "");
|
|
_mdText = _mdText.replace("_", "");
|
|
- _source.close();
|
|
|
|
|
|
+ this.isTextCancelSource.close();
|
|
|
|
+ this.isTextCancelSource = null;
|
|
this.courseText = _mdText;
|
|
this.courseText = _mdText;
|
|
this.textLoading = false
|
|
this.textLoading = false
|
|
this.ttextLoading = false
|
|
this.ttextLoading = false
|
|
this.courseTextB = false
|
|
this.courseTextB = false
|
|
|
|
+ this.isTextCancelToken = null
|
|
return;
|
|
return;
|
|
} else {
|
|
} else {
|
|
_iindex++
|
|
_iindex++
|
|
@@ -17201,7 +17215,7 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- cancelAjax(type){
|
|
|
|
|
|
+ cancelAjax(type, index){
|
|
if (this.isOutlineCancelToken && type == 'outline') {
|
|
if (this.isOutlineCancelToken && type == 'outline') {
|
|
this.$message.success("已经成功停止生成课程大纲")
|
|
this.$message.success("已经成功停止生成课程大纲")
|
|
this.isOutlineCancelToken.cancel('Request canceled by the user.');
|
|
this.isOutlineCancelToken.cancel('Request canceled by the user.');
|
|
@@ -17220,6 +17234,10 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
this.isTextCancelToken = null;
|
|
this.isTextCancelToken = null;
|
|
this.textLoading = false
|
|
this.textLoading = false
|
|
this.ttextLoading = true
|
|
this.ttextLoading = true
|
|
|
|
+ if(this.isTextCancelSource){
|
|
|
|
+ this.isTextCancelSource.close()
|
|
|
|
+ this.isTextCancelSource = null
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if(this.isTargetCancelToken2 && type == 'target2'){
|
|
if(this.isTargetCancelToken2 && type == 'target2'){
|
|
this.$message.success("已经成功停止生成目标")
|
|
this.$message.success("已经成功停止生成目标")
|
|
@@ -17227,6 +17245,49 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
this.isTargetCancelToken2 = null;
|
|
this.isTargetCancelToken2 = null;
|
|
this.targetTextLoading2 = false
|
|
this.targetTextLoading2 = false
|
|
this.ttargetTextLoading2 = false
|
|
this.ttargetTextLoading2 = false
|
|
|
|
+ if(this.isTargetCancelSource2){
|
|
|
|
+ this.isTargetCancelSource2.close()
|
|
|
|
+ this.isTargetCancelSource2 = null
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(this.isTargetCancelToken1 && type == 'target1'){
|
|
|
|
+ this.$message.success("已经成功停止生成目标")
|
|
|
|
+ this.isTargetCancelToken1.cancel('Request canceled by the user.');
|
|
|
|
+ this.isTargetCancelToken1 = null;
|
|
|
|
+ this.targetTextLoading = false
|
|
|
|
+ this.ttargetTextLoading = false
|
|
|
|
+ if(this.isTargetCancelSource1){
|
|
|
|
+ this.isTargetCancelSource1.close()
|
|
|
|
+ this.isTargetCancelSource1 = null
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(this.isTeacherTextCancelToken && type == 'teacherText'){
|
|
|
|
+ this.$message.success("已经成功停止提取摘要")
|
|
|
|
+ this.isTeacherTextCancelToken.cancel('Request canceled by the user.');
|
|
|
|
+ this.isTeacherTextCancelToken = null;
|
|
|
|
+ this.teacherTextLoading = false
|
|
|
|
+ this.tteacherTextLoading = false
|
|
|
|
+ if(this.isTeacherTextCancelSource){
|
|
|
|
+ this.isTeacherTextCancelSource.close()
|
|
|
|
+ this.isTeacherTextCancelSource = null
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(this.isTeacherTaskCancelToken && type == 'teacherTask'){
|
|
|
|
+ this.$message.success("已经成功停止生成教案")
|
|
|
|
+ this.isTeacherTaskCancelToken.cancel('Request canceled by the user.');
|
|
|
|
+ this.isTeacherTaskCancelToken = null;
|
|
|
|
+ this.loading = false
|
|
|
|
+ }
|
|
|
|
+ if(this.isOutlineTaskCancelToken && type == 'outlineTask'){
|
|
|
|
+ this.$message.success("已经成功停止生成大纲")
|
|
|
|
+ this.isOutlineTaskCancelToken[index].cancel('Request canceled by the user.');
|
|
|
|
+ this.isOutlineTaskCancelToken[index] = null;
|
|
|
|
+ this.taskDetailLoading.splice(this.taskDetailLoading.indexOf('task-' + index), 1)
|
|
|
|
+ this.ttaskDetailLoading.splice(this.ttaskDetailLoading.indexOf('task-' + index), 1)
|
|
|
|
+ if(this.isOutlineTaskCancelSource[index]){
|
|
|
|
+ this.isOutlineTaskCancelSource[index].close()
|
|
|
|
+ this.isOutlineTaskCancelSource[index] = null
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
async aiGetTask2(messages, callback) {
|
|
async aiGetTask2(messages, callback) {
|
|
@@ -17623,7 +17684,7 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
// _this.loading = false
|
|
// _this.loading = false
|
|
// console.log(error);
|
|
// console.log(error);
|
|
// });
|
|
// });
|
|
-
|
|
|
|
|
|
+ _this.isTeacherTaskCancelToken = _this.ajax.setCancelSource();
|
|
let parm = {
|
|
let parm = {
|
|
assistant_id: '6063369f-289a-11ef-8bf4-12e77c4cb76b',
|
|
assistant_id: '6063369f-289a-11ef-8bf4-12e77c4cb76b',
|
|
message: [{"type":"text", "text":messages.replaceAll('\n', " ").replaceAll('*', "")}],
|
|
message: [{"type":"text", "text":messages.replaceAll('\n', " ").replaceAll('*', "")}],
|
|
@@ -17634,7 +17695,7 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
temperature: 0.1,
|
|
temperature: 0.1,
|
|
}
|
|
}
|
|
this.ajax
|
|
this.ajax
|
|
- .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
|
|
|
|
|
|
+ .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm, _this.isTeacherTaskCancelToken)
|
|
.then((response) => {
|
|
.then((response) => {
|
|
console.log(response);
|
|
console.log(response);
|
|
let data = response.data.FunctionResponse
|
|
let data = response.data.FunctionResponse
|
|
@@ -17757,9 +17818,11 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
}, 0)
|
|
}, 0)
|
|
}
|
|
}
|
|
callback ? callback() : ''
|
|
callback ? callback() : ''
|
|
|
|
+ _this.isTeacherTaskCancelToken = null
|
|
})
|
|
})
|
|
.catch((error) => {
|
|
.catch((error) => {
|
|
_this.loading = false
|
|
_this.loading = false
|
|
|
|
+ _this.isTeacherTaskCancelToken = null
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -19312,6 +19375,7 @@ ${msg}
|
|
// - 补充描述:${_this.courseText2}
|
|
// - 补充描述:${_this.courseText2}
|
|
_this.taskDetailLoading.push(_tindex)
|
|
_this.taskDetailLoading.push(_tindex)
|
|
_this.ttaskDetailLoading.push(_tindex)
|
|
_this.ttaskDetailLoading.push(_tindex)
|
|
|
|
+ _this.isOutlineTaskCancelToken[index] = _this.ajax.setCancelSource();
|
|
let _uuid = uuidv4();
|
|
let _uuid = uuidv4();
|
|
// let params = JSON.stringify({
|
|
// let params = JSON.stringify({
|
|
// // "model": "Chat",
|
|
// // "model": "Chat",
|
|
@@ -19367,31 +19431,33 @@ ${msg}
|
|
} else {
|
|
} else {
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ _this.isOutlineTaskCancelToken[index] = null
|
|
// _this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
// _this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
}).catch(function (error) {
|
|
}).catch(function (error) {
|
|
_this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
_this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
_this.ttaskDetailLoading.splice(_this.ttaskDetailLoading.indexOf(_tindex), 1)
|
|
_this.ttaskDetailLoading.splice(_this.ttaskDetailLoading.indexOf(_tindex), 1)
|
|
|
|
+ _this.isOutlineTaskCancelToken[index] = null
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
await _this.aiDetailgetAiContent(_uuid, _tindex, _tindex2)
|
|
await _this.aiDetailgetAiContent(_uuid, _tindex, _tindex2)
|
|
},
|
|
},
|
|
aiDetailgetAiContent(_uid, loading, _tindex2) {
|
|
aiDetailgetAiContent(_uid, loading, _tindex2) {
|
|
// let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
- let _source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
|
|
|
+ this.isOutlineTaskCancelSource[_tindex2] = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
let _allText = "";
|
|
let _allText = "";
|
|
let _mdText = "";
|
|
let _mdText = "";
|
|
let _iindex = 0
|
|
let _iindex = 0
|
|
- _source.onmessage = _e => {
|
|
|
|
- let _eData = JSON.parse(_e.data).content;
|
|
|
|
|
|
+ this.isOutlineTaskCancelSource[_tindex2].onmessage = _e => {
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
//对话已经完成
|
|
//对话已经完成
|
|
_mdText = _mdText.replace("_", "");
|
|
_mdText = _mdText.replace("_", "");
|
|
- _source.close();
|
|
|
|
|
|
+ this.isOutlineTaskCancelSource[_tindex2].close();
|
|
|
|
+ this.isOutlineTaskCancelSource[_tindex2] = null;
|
|
this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail2 = _mdText;
|
|
this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail2 = _mdText;
|
|
this.taskDetailLoading.splice(this.taskDetailLoading.indexOf(loading), 1)
|
|
this.taskDetailLoading.splice(this.taskDetailLoading.indexOf(loading), 1)
|
|
this.ttaskDetailLoading.splice(this.ttaskDetailLoading.indexOf(loading), 1)
|
|
this.ttaskDetailLoading.splice(this.ttaskDetailLoading.indexOf(loading), 1)
|
|
|
|
+ this.isOutlineTaskCancelToken[_tindex2] = null
|
|
return;
|
|
return;
|
|
} else {
|
|
} else {
|
|
_iindex++
|
|
_iindex++
|
|
@@ -19415,6 +19481,7 @@ ${msg}
|
|
this.taskDetailLoading.splice(this.taskDetailLoading.indexOf(loading), 1)
|
|
this.taskDetailLoading.splice(this.taskDetailLoading.indexOf(loading), 1)
|
|
// 处理流数据
|
|
// 处理流数据
|
|
}
|
|
}
|
|
|
|
+
|
|
// this.$forceUpdate();
|
|
// this.$forceUpdate();
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -19476,6 +19543,7 @@ ${target ? '课程目标:' + target.replaceAll('#','').replaceAll('*','').repl
|
|
// - 补充描述:${_this.courseText2}
|
|
// - 补充描述:${_this.courseText2}
|
|
_this.taskDetailLoading.push(_tindex)
|
|
_this.taskDetailLoading.push(_tindex)
|
|
_this.ttaskDetailLoading.push(_tindex)
|
|
_this.ttaskDetailLoading.push(_tindex)
|
|
|
|
+ _this.isOutlineTaskCancelToken[index] = _this.ajax.setCancelSource();
|
|
let _uuid = uuidv4();
|
|
let _uuid = uuidv4();
|
|
// let params = JSON.stringify({
|
|
// let params = JSON.stringify({
|
|
// // "model": "Chat",
|
|
// // "model": "Chat",
|
|
@@ -19532,11 +19600,12 @@ ${target ? '课程目标:' + target.replaceAll('#','').replaceAll('*','').repl
|
|
} else {
|
|
} else {
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ _this.isOutlineTaskCancelToken[index] = null
|
|
// _this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
// _this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
}).catch(function (error) {
|
|
}).catch(function (error) {
|
|
_this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
_this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
_this.ttaskDetailLoading.splice(_this.ttaskDetailLoading.indexOf(_tindex), 1)
|
|
_this.ttaskDetailLoading.splice(_this.ttaskDetailLoading.indexOf(_tindex), 1)
|
|
|
|
+ _this.isOutlineTaskCancelToken[index] = null
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
await _this.aiOutlineDetailgetAiContent(_uuid, _tindex, _tindex2)
|
|
await _this.aiOutlineDetailgetAiContent(_uuid, _tindex, _tindex2)
|
|
@@ -19607,6 +19676,7 @@ ${taskArray.length ? '其他任务大纲名字:' + taskArray.join(',') : ''}
|
|
// - 补充描述:${_this.courseText2}
|
|
// - 补充描述:${_this.courseText2}
|
|
_this.taskDetailLoading.push(_tindex)
|
|
_this.taskDetailLoading.push(_tindex)
|
|
_this.ttaskDetailLoading.push(_tindex)
|
|
_this.ttaskDetailLoading.push(_tindex)
|
|
|
|
+ _this.isOutlineTaskCancelToken[index] = _this.ajax.setCancelSource();
|
|
let _uuid = uuidv4();
|
|
let _uuid = uuidv4();
|
|
// let params = JSON.stringify({
|
|
// let params = JSON.stringify({
|
|
// // "model": "Chat",
|
|
// // "model": "Chat",
|
|
@@ -19648,7 +19718,7 @@ ${taskArray.length ? '其他任务大纲名字:' + taskArray.join(',') : ''}
|
|
// model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
|
|
// model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
|
|
// });
|
|
// });
|
|
// _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
|
|
// _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
|
|
- _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params).then(function (response) {
|
|
|
|
|
|
+ _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params, _this.isOutlineTaskCancelToken[index]).then(function (response) {
|
|
// _this.ajax.post('https://claude3.cocorobo.cn/chat', params).then(function (response) {
|
|
// _this.ajax.post('https://claude3.cocorobo.cn/chat', params).then(function (response) {
|
|
console.log(response);
|
|
console.log(response);
|
|
// let data = response.data.FunctionResponse
|
|
// let data = response.data.FunctionResponse
|
|
@@ -19663,34 +19733,37 @@ ${taskArray.length ? '其他任务大纲名字:' + taskArray.join(',') : ''}
|
|
} else {
|
|
} else {
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ _this.isOutlineTaskCancelToken[index] = null
|
|
// _this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
// _this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
}).catch(function (error) {
|
|
}).catch(function (error) {
|
|
_this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
_this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
_this.ttaskDetailLoading.splice(_this.ttaskDetailLoading.indexOf(_tindex), 1)
|
|
_this.ttaskDetailLoading.splice(_this.ttaskDetailLoading.indexOf(_tindex), 1)
|
|
|
|
+ _this.isOutlineTaskCancelToken[index] = null
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
await _this.aiOutlineDetailgetAiContent(_uuid, _tindex, _tindex2)
|
|
await _this.aiOutlineDetailgetAiContent(_uuid, _tindex, _tindex2)
|
|
},
|
|
},
|
|
aiOutlineDetailgetAiContent(_uid, loading, _tindex2) {
|
|
aiOutlineDetailgetAiContent(_uid, loading, _tindex2) {
|
|
// let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
- let _source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
|
|
|
+ this.isOutlineTaskCancelSource[_tindex2] = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
let _allText = "";
|
|
let _allText = "";
|
|
let _mdText = "";
|
|
let _mdText = "";
|
|
let _iindex = 0
|
|
let _iindex = 0
|
|
- _source.onmessage = _e => {
|
|
|
|
|
|
+ this.isOutlineTaskCancelSource[_tindex2].onmessage = _e => {
|
|
let _eData = JSON.parse(_e.data).content;
|
|
let _eData = JSON.parse(_e.data).content;
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
//对话已经完成
|
|
//对话已经完成
|
|
_mdText = _mdText.replace("_", "");
|
|
_mdText = _mdText.replace("_", "");
|
|
- _source.close();
|
|
|
|
|
|
+ this.isOutlineTaskCancelSource[_tindex2].close();
|
|
|
|
+ this.isOutlineTaskCancelSource[_tindex2] = null;
|
|
this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail2 = _mdText;
|
|
this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail2 = _mdText;
|
|
if(!this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail3 && this.isOutline2){
|
|
if(!this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail3 && this.isOutline2){
|
|
this.aiDetail52(this.aiJson['teacherDetail2'], _tindex2)
|
|
this.aiDetail52(this.aiJson['teacherDetail2'], _tindex2)
|
|
}
|
|
}
|
|
this.taskDetailLoading.splice(this.taskDetailLoading.indexOf(loading), 1)
|
|
this.taskDetailLoading.splice(this.taskDetailLoading.indexOf(loading), 1)
|
|
this.ttaskDetailLoading.splice(this.ttaskDetailLoading.indexOf(loading), 1)
|
|
this.ttaskDetailLoading.splice(this.ttaskDetailLoading.indexOf(loading), 1)
|
|
|
|
+ this.isOutlineTaskCancelToken[_tindex2] = null
|
|
return;
|
|
return;
|
|
} else {
|
|
} else {
|
|
_iindex++
|
|
_iindex++
|
|
@@ -19716,6 +19789,7 @@ ${taskArray.length ? '其他任务大纲名字:' + taskArray.join(',') : ''}
|
|
}
|
|
}
|
|
// 处理流数据
|
|
// 处理流数据
|
|
}
|
|
}
|
|
|
|
+
|
|
// this.$forceUpdate();
|
|
// this.$forceUpdate();
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -20785,6 +20859,9 @@ ${this.teacherCourseText && this.aiCallBack == 2 ? '参考内容:'+this.teache
|
|
${msg}
|
|
${msg}
|
|
|
|
|
|
${this.teacherCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内容>即可不用重新生成,让内容更具体化,更具体' : ''}`
|
|
${this.teacherCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内容>即可不用重新生成,让内容更具体化,更具体' : ''}`
|
|
|
|
+
|
|
|
|
+ _this.isTeacherTextCancelToken = _this.ajax.setCancelSource();
|
|
|
|
+
|
|
let _uuid = uuidv4();
|
|
let _uuid = uuidv4();
|
|
// let params = JSON.stringify({
|
|
// let params = JSON.stringify({
|
|
// // "model": "Chat",
|
|
// // "model": "Chat",
|
|
@@ -20826,7 +20903,7 @@ ${this.teacherCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
// model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
|
|
// model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
|
|
// });
|
|
// });
|
|
// _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
|
|
// _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
|
|
- _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params).then(function (response) {
|
|
|
|
|
|
+ _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params, _this.isTeacherTextCancelToken).then(function (response) {
|
|
// _this.ajax.post('https://claude3.cocorobo.cn/chat', params).then(function (response) {
|
|
// _this.ajax.post('https://claude3.cocorobo.cn/chat', params).then(function (response) {
|
|
console.log(response);
|
|
console.log(response);
|
|
// let data = response.data.FunctionResponse
|
|
// let data = response.data.FunctionResponse
|
|
@@ -20837,31 +20914,34 @@ ${this.teacherCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
} else {
|
|
} else {
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ _this.isTeacherTextCancelToken = null
|
|
}).catch(function (error) {
|
|
}).catch(function (error) {
|
|
_this.teacherTextLoading = false
|
|
_this.teacherTextLoading = false
|
|
_this.tteacherTextLoading = false
|
|
_this.tteacherTextLoading = false
|
|
|
|
+ _this.isTeacherTextCancelToken = null
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
await _this.aiteacherTextDetailgetAiContent(_uuid)
|
|
await _this.aiteacherTextDetailgetAiContent(_uuid)
|
|
},
|
|
},
|
|
aiteacherTextDetailgetAiContent(_uid) {
|
|
aiteacherTextDetailgetAiContent(_uid) {
|
|
// let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
- let _source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
|
|
|
+ this.isTeacherTextCancelSource = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
let _allText = "";
|
|
let _allText = "";
|
|
let _mdText = "";
|
|
let _mdText = "";
|
|
let _iindex = 0
|
|
let _iindex = 0
|
|
- _source.onmessage = _e => {
|
|
|
|
|
|
+ this.isTeacherTextCancelSource.onmessage = _e => {
|
|
let _eData = JSON.parse(_e.data).content;
|
|
let _eData = JSON.parse(_e.data).content;
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
//对话已经完成
|
|
//对话已经完成
|
|
_mdText = _mdText.replace("_", "");
|
|
_mdText = _mdText.replace("_", "");
|
|
- _source.close();
|
|
|
|
|
|
+ this.isTeacherTextCancelSource.close();
|
|
|
|
+ this.isTeacherTextCancelSource = null;
|
|
this.teacherCourseText = _mdText;
|
|
this.teacherCourseText = _mdText;
|
|
this.teacherTextLoading = false
|
|
this.teacherTextLoading = false
|
|
this.tteacherTextLoading = false
|
|
this.tteacherTextLoading = false
|
|
this.teacherCourseTextB = false
|
|
this.teacherCourseTextB = false
|
|
|
|
+ this.isTeacherTextCancelToken = null
|
|
return;
|
|
return;
|
|
} else {
|
|
} else {
|
|
_iindex++
|
|
_iindex++
|
|
@@ -20887,6 +20967,7 @@ ${this.teacherCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
}
|
|
}
|
|
// 处理流数据
|
|
// 处理流数据
|
|
}
|
|
}
|
|
|
|
+
|
|
// this.$forceUpdate();
|
|
// this.$forceUpdate();
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -20953,6 +21034,10 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '参考内容:'+this.targetC
|
|
${msg}
|
|
${msg}
|
|
|
|
|
|
${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内容>即可不用重新生成,让内容更具体化,更具体' : ''}`
|
|
${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内容>即可不用重新生成,让内容更具体化,更具体' : ''}`
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ _this.isTargetCancelToken1 = _this.ajax.setCancelSource();
|
|
|
|
+
|
|
let _uuid = uuidv4();
|
|
let _uuid = uuidv4();
|
|
// let params = JSON.stringify({
|
|
// let params = JSON.stringify({
|
|
// // "model": "Chat",
|
|
// // "model": "Chat",
|
|
@@ -20994,7 +21079,7 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
// model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
|
|
// model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
|
|
// });
|
|
// });
|
|
// _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
|
|
// _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
|
|
- _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params).then(function (response) {
|
|
|
|
|
|
+ _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params, _this.isTargetCancelToken1).then(function (response) {
|
|
// _this.ajax.post('https://claude3.cocorobo.cn/chat', params).then(function (response) {
|
|
// _this.ajax.post('https://claude3.cocorobo.cn/chat', params).then(function (response) {
|
|
console.log(response);
|
|
console.log(response);
|
|
// let data = response.data.FunctionResponse
|
|
// let data = response.data.FunctionResponse
|
|
@@ -21005,31 +21090,34 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
} else {
|
|
} else {
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ _this.isTargetCancelToken1 = null
|
|
}).catch(function (error) {
|
|
}).catch(function (error) {
|
|
_this.targetTextLoading = false
|
|
_this.targetTextLoading = false
|
|
_this.ttargetTextLoading = false
|
|
_this.ttargetTextLoading = false
|
|
|
|
+ _this.isTargetCancelToken1 = null
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
await _this.aitargetTextDetailgetAiContent(_uuid)
|
|
await _this.aitargetTextDetailgetAiContent(_uuid)
|
|
},
|
|
},
|
|
aitargetTextDetailgetAiContent(_uid) {
|
|
aitargetTextDetailgetAiContent(_uid) {
|
|
// let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
- let _source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
|
|
|
+ this.isTargetCancelSource1 = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
let _allText = "";
|
|
let _allText = "";
|
|
let _mdText = "";
|
|
let _mdText = "";
|
|
let _iindex = 0
|
|
let _iindex = 0
|
|
- _source.onmessage = _e => {
|
|
|
|
|
|
+ this.isTargetCancelSource1.onmessage = _e => {
|
|
let _eData = JSON.parse(_e.data).content;
|
|
let _eData = JSON.parse(_e.data).content;
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
//对话已经完成
|
|
//对话已经完成
|
|
_mdText = _mdText.replace("_", "");
|
|
_mdText = _mdText.replace("_", "");
|
|
- _source.close();
|
|
|
|
|
|
+ this.isTargetCancelSource1.close();
|
|
|
|
+ this.isTargetCancelSource1 = null;
|
|
this.targetCourseText = _mdText;
|
|
this.targetCourseText = _mdText;
|
|
this.targetTextLoading = false
|
|
this.targetTextLoading = false
|
|
this.ttargetTextLoading = false
|
|
this.ttargetTextLoading = false
|
|
this.targetCourseTextB = false
|
|
this.targetCourseTextB = false
|
|
|
|
+ this.isTargetCancelToken1 = null
|
|
return;
|
|
return;
|
|
} else {
|
|
} else {
|
|
_iindex++
|
|
_iindex++
|
|
@@ -21055,6 +21143,7 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
}
|
|
}
|
|
// 处理流数据
|
|
// 处理流数据
|
|
}
|
|
}
|
|
|
|
+
|
|
// this.$forceUpdate();
|
|
// this.$forceUpdate();
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -21352,21 +21441,23 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
},
|
|
},
|
|
aitargetTextDetail2getAiContent(_uid) {
|
|
aitargetTextDetail2getAiContent(_uid) {
|
|
// let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
- let _source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
|
|
|
+ this.isTargetCancelSource2 = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
let _allText = "";
|
|
let _allText = "";
|
|
let _mdText = "";
|
|
let _mdText = "";
|
|
let _iindex = 0
|
|
let _iindex = 0
|
|
- _source.onmessage = _e => {
|
|
|
|
|
|
+ this.isTargetCancelSource2.onmessage = _e => {
|
|
let _eData = JSON.parse(_e.data).content;
|
|
let _eData = JSON.parse(_e.data).content;
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
//对话已经完成
|
|
//对话已经完成
|
|
_mdText = _mdText.replace("_", "");
|
|
_mdText = _mdText.replace("_", "");
|
|
- _source.close();
|
|
|
|
|
|
+ this.isTargetCancelSource2.close();
|
|
|
|
+ this.isTargetCancelSource2 = null;
|
|
this.targetCourseText2 = _mdText;
|
|
this.targetCourseText2 = _mdText;
|
|
this.targetTextLoading2 = false
|
|
this.targetTextLoading2 = false
|
|
this.ttargetTextLoading2 = false
|
|
this.ttargetTextLoading2 = false
|
|
this.targetCourseText2B = false
|
|
this.targetCourseText2B = false
|
|
|
|
+ this.isTargetCancelToken2 = null
|
|
return;
|
|
return;
|
|
} else {
|
|
} else {
|
|
_iindex++
|
|
_iindex++
|