|
@@ -7821,6 +7821,7 @@ export default {
|
|
|
pingjiainfoisAllSize: [],
|
|
|
pingjiainfoprogress: [],
|
|
|
taskGLoading: [],
|
|
|
+ ttaskGLoading: [],
|
|
|
isOutlineCancelToken: null,
|
|
|
isFileCancelToken: null,
|
|
|
isTargetCancelToken1: null,
|
|
@@ -7870,6 +7871,7 @@ export default {
|
|
|
taskAnCancelToken: [],
|
|
|
dialogTemplateArray: [ 'cf5722a4-401b-11ef-b873-005056b86cd2', '68629cfb-e719-48e9-a03d-56f189fb9cb0' ],
|
|
|
taskCancelToken1: [],
|
|
|
+ isTaskCancelSource1: [],
|
|
|
taskCancelToken2: [],
|
|
|
isDisplay: false,
|
|
|
isDialog: 0,
|
|
@@ -8572,6 +8574,7 @@ export default {
|
|
|
cancelButtonText: "不保存",
|
|
|
distinguishCancelAndClose: true,
|
|
|
type: "warning",
|
|
|
+ customClass: 'custom-confirm-box'
|
|
|
})
|
|
|
.then(() => {
|
|
|
if (this.taskLoading.length) {
|
|
@@ -8659,6 +8662,9 @@ export default {
|
|
|
);
|
|
|
}
|
|
|
});
|
|
|
+ setTimeout(() => {
|
|
|
+ this.setTipsIndex()
|
|
|
+ }, 500)
|
|
|
},
|
|
|
lastSteps() {
|
|
|
if (this.steps == 4) {
|
|
@@ -18512,8 +18518,10 @@ ${(this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || this.templateid
|
|
|
for(var _task = 0; _task < this.unitJson[0].chapterInfo[0].taskJson.length; _task++){
|
|
|
if(!this.taskGLoading[_task]){
|
|
|
this.taskGLoading[_task] = []
|
|
|
+ this.ttaskGLoading[_task] = []
|
|
|
}
|
|
|
this.taskGLoading[_task][0] = true
|
|
|
+ this.ttaskGLoading[_task][0] = true
|
|
|
// this.taskGLoading[_task][1] = true
|
|
|
// this.taskGLoading[_task][2] = true
|
|
|
|
|
@@ -18532,8 +18540,6 @@ ${(this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || this.templateid
|
|
|
let message1 = `NOTICE
|
|
|
Role: 你是一名教师,你正在使用一个在线学习平台来教授学生,你已经完成了教案,你现在需要将教案变为学生上课用的任务单(work sheet)。该在线学习平台为每个任务提供了资源区(视频,ppt,阅读资料将放在这里),多种互动工具(学生点击工具即可上传他们的作业或者回答,这些互动工具类似kahoot一样允许教师轻松收集,统计,追踪学生作业),以及和任务绑定的目标和评价系统。
|
|
|
Language: ${_this.getLang()}
|
|
|
-ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
|
|
|
-Instruction: Based on the context, follow "Format example", write content.
|
|
|
|
|
|
# Context
|
|
|
## 要求
|
|
@@ -18548,64 +18554,9 @@ ${msg}
|
|
|
任务描述:从教案中提取并且**改写**,改写为教师给与学生的指示(用于指导学生如何进行该教学活动),对应到学生活动,你应该用友好,但是又清晰明确的口吻来撰写。内容至少200个token,你需要详细的描述该任务该如何做)。
|
|
|
|
|
|
# 范例
|
|
|
-亲爱的同学们,今天我们将一起探索热是如何在不同的环境中传递的。\n我们将通过一系列有趣的实验来观察热在水中的传递过程。请大家准备好实验材料,并确保遵循安全指南。我们将使用感温粉末或红墨水来帮助我们直观地看到热是如何在水中移动的。\n在实验过程中,请大家仔细观察并记录你的发现,我们将一起讨论热对流是如何形成的。\n不要忘记,实验后我们要分享我们的观察结果,并探讨热对流在我们生活中的应用。让我们一起揭开热传递的神秘面纱吧!
|
|
|
-
|
|
|
-# Format example
|
|
|
-{ "detail":"任务描述" }`
|
|
|
-
|
|
|
-let message2 = `NOTICE
|
|
|
-Role: 你是一名教师,你正在使用一个在线学习平台来教授学生,你已经完成了教案,你现在需要将教案变为学生上课用的任务单(work sheet)。该在线学习平台为每个任务提供了资源区(视频,ppt,阅读资料将放在这里),多种互动工具(学生点击工具即可上传他们的作业或者回答,这些互动工具类似kahoot一样允许教师轻松收集,统计,追踪学生作业),以及和任务绑定的目标和评价系统。
|
|
|
-Language: ${_this.getLang()}
|
|
|
-ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
|
|
|
-Instruction: Based on the context, follow "Format example", write content.
|
|
|
-
|
|
|
-# Context
|
|
|
-## 要求
|
|
|
-${msg2}
|
|
|
-
|
|
|
-
|
|
|
-## 参考资料
|
|
|
-教学任务教案:${_this.unitJson[0].chapterInfo[0].taskJson[ij].taskDetail3.replaceAll('#','').replaceAll('*','').replaceAll('-','').replaceAll('\n','')}
|
|
|
-
|
|
|
-# 输出格式与要求
|
|
|
-互动工具列表
|
|
|
-工具名:${_this.languageSetting == 2 ? 'Diagram Tool' : '表格'}
|
|
|
-工具指引:同学们,在完成本次STEM小车实验时,我们需要使用表格工具来记录和整理实验数据。表格工具就像一个电子版的记录本,它不仅可以帮助我们准确记录数据,还能自动计算和生成图表,方便我们分析实验结果。在第一行,每个单元格中输入我们要记录的变量名称,比如“时间(秒)”、“距离(米)”、“速度(米/秒)”等。接下来,在实验中,我们会把每次测试的结果依次填入相应的单元格中。记得每一行代表一次完整的实验测试哦。
|
|
|
-
|
|
|
-工具名:${_this.languageSetting == 2 ? 'Document tool' : '文档'}
|
|
|
-工具指引:在实验数据整理好之后,我们接下来要用文档工具撰写实验报告。这份报告不仅是对我们实验的总结,也是展示我们分析和思考能力的好机会。文档工具就像一本电子笔记本,可以帮助我们把想法和数据清晰地展示出来。该份实验报告需要包括以下内容:1.实验背景: 简单介绍实验的目的,比如“我们这次实验的目的是通过小车演示,理解速度和加速度的关系”。用简洁的语言说明你为什么要做这个实验。\n2.实验方法: 详细描述你是如何进行实验的,包括实验步骤和使用的工具。例如,你可以写“我们将小车放在一个倾斜的平面上,记录它在不同时间间隔下的距离”。\n 3.数据分析: 这部分是核心内容。你可以将表格工具生成的图表插入到文档中,并解释图表显示的结果。例如,你可以写“从图表中可以看出,随着时间的增加,小车的速度逐渐加快,这说明……”。\n 4.结论与建议: 最后,总结你在实验中得出的结论,比如“小车在光滑表面上的加速度较大”,并提出一些改进实验或进一步研究的建议。
|
|
|
-
|
|
|
-工具名称:${_this.languageSetting == 2 ? 'Choice tool' : '选择题'}
|
|
|
-工具指引:同学们,老师想要考察一下你对“热传递”这一概念的理解和掌握程度。请仔细阅读每个问题,并给出准确的答案哦~
|
|
|
-
|
|
|
-${_this.languageSetting == 2 ? '还有以下工具:Mind Map Tool、Spreadsheet tool、Q&A Tool' : ''}
|
|
|
-
|
|
|
-# Format example
|
|
|
-{"toolChoose":[{"tool":"工具名","detail":"工具描述"},{"tool":"工具名","detail":"工具描述"}]}`
|
|
|
-
|
|
|
-let message3 = `NOTICE
|
|
|
-Role: 你是一名教师,你正在使用一个在线学习平台来教授学生,你已经完成了教案,你现在需要将教案变为学生上课用的任务单(work sheet)。该在线学习平台为每个任务提供了资源区(视频,ppt,阅读资料将放在这里),多种互动工具(学生点击工具即可上传他们的作业或者回答,这些互动工具类似kahoot一样允许教师轻松收集,统计,追踪学生作业),以及和任务绑定的目标和评价系统。
|
|
|
-Language: ${_this.getLang()}
|
|
|
-ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
|
|
|
-Instruction: Based on the context, follow "Format example", write content.
|
|
|
-
|
|
|
-# Context
|
|
|
-## 要求
|
|
|
-${msg3}
|
|
|
-
|
|
|
+亲爱的同学们,今天我们将一起探索热是如何在不同的环境中传递的。\n我们将通过一系列有趣的实验来观察热在水中的传递过程。请大家准备好实验材料,并确保遵循安全指南。我们将使用感温粉末或红墨水来帮助我们直观地看到热是如何在水中移动的。\n在实验过程中,请大家仔细观察并记录你的发现,我们将一起讨论热对流是如何形成的。\n不要忘记,实验后我们要分享我们的观察结果,并探讨热对流在我们生活中的应用。让我们一起揭开热传递的神秘面纱吧!`
|
|
|
|
|
|
-## 参考资料
|
|
|
-教学任务教案:${_this.unitJson[0].chapterInfo[0].taskJson[ij].taskDetail3.replaceAll('#','').replaceAll('*','').replaceAll('-','').replaceAll('\n','')}
|
|
|
-
|
|
|
-# 输出格式与要求
|
|
|
-核心素养:从教案中提取
|
|
|
-目标:从教案中提取
|
|
|
-评价标准:从教案中提取评价标准
|
|
|
-
|
|
|
-# Format example
|
|
|
-{"elist":[{"value":"目标","detail":"评价标准",target:"核心素养","score":5},{"value":"目标","detail":"评价标准",target:"核心素养","score":5},{"value":"目标","detail":"评价标准",target:"核心素养","score":5}]}`
|
|
|
-
|
|
|
- _this.aiGetG321(message1, ij, (callback2) => {
|
|
|
+ _this.aiGetG321L(message1, ij, (callback2) => {
|
|
|
// _this.aiGetG322(message2, ij, callback2);
|
|
|
callback2 ? callback2() : ''
|
|
|
}, () => {
|
|
@@ -18625,8 +18576,6 @@ ${msg3}
|
|
|
let message1 = `NOTICE
|
|
|
Role: 你是一名教师,你正在使用一个在线学习平台来教授学生,你已经完成了教案,你现在需要将教案变为学生上课用的任务单(work sheet)。该在线学习平台为每个任务提供了资源区(视频,ppt,阅读资料将放在这里),多种互动工具(学生点击工具即可上传他们的作业或者回答,这些互动工具类似kahoot一样允许教师轻松收集,统计,追踪学生作业),以及和任务绑定的目标和评价系统。
|
|
|
Language: ${this.getLang()}
|
|
|
-ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
|
|
|
-Instruction: Based on the context, follow "Format example", write content.
|
|
|
|
|
|
# Context
|
|
|
## 要求
|
|
@@ -18641,70 +18590,17 @@ ${msg}
|
|
|
任务描述:从教案中提取并且**改写**,改写为教师给与学生的指示(用于指导学生如何进行该教学活动),对应到学生活动,你应该用友好,但是又清晰明确的口吻来撰写。内容至少200个token,你需要详细的描述该任务该如何做)。
|
|
|
|
|
|
# 范例
|
|
|
-亲爱的同学们,今天我们将一起探索热是如何在不同的环境中传递的。\n我们将通过一系列有趣的实验来观察热在水中的传递过程。请大家准备好实验材料,并确保遵循安全指南。我们将使用感温粉末或红墨水来帮助我们直观地看到热是如何在水中移动的。\n在实验过程中,请大家仔细观察并记录你的发现,我们将一起讨论热对流是如何形成的。\n不要忘记,实验后我们要分享我们的观察结果,并探讨热对流在我们生活中的应用。让我们一起揭开热传递的神秘面纱吧!
|
|
|
-
|
|
|
-# Format example
|
|
|
-{ "detail":"任务描述" }`
|
|
|
+亲爱的同学们,今天我们将一起探索热是如何在不同的环境中传递的。\n我们将通过一系列有趣的实验来观察热在水中的传递过程。请大家准备好实验材料,并确保遵循安全指南。我们将使用感温粉末或红墨水来帮助我们直观地看到热是如何在水中移动的。\n在实验过程中,请大家仔细观察并记录你的发现,我们将一起讨论热对流是如何形成的。\n不要忘记,实验后我们要分享我们的观察结果,并探讨热对流在我们生活中的应用。让我们一起揭开热传递的神秘面纱吧!`
|
|
|
|
|
|
-let message2 = `NOTICE
|
|
|
-Role: 你是一名教师,你正在使用一个在线学习平台来教授学生,你已经完成了教案,你现在需要将教案变为学生上课用的任务单(work sheet)。该在线学习平台为每个任务提供了资源区(视频,ppt,阅读资料将放在这里),多种互动工具(学生点击工具即可上传他们的作业或者回答,这些互动工具类似kahoot一样允许教师轻松收集,统计,追踪学生作业),以及和任务绑定的目标和评价系统。
|
|
|
-Language: ${this.getLang()}
|
|
|
-ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
|
|
|
-Instruction: Based on the context, follow "Format example", write content.
|
|
|
-
|
|
|
-# Context
|
|
|
-## 要求
|
|
|
-${msg2}
|
|
|
-
|
|
|
-
|
|
|
-## 参考资料
|
|
|
-教学任务教案:${this.unitJson[0].chapterInfo[0].taskJson[this.aiCallBack[0]].taskDetail3.replaceAll('#','').replaceAll('*','').replaceAll('-','').replaceAll('\n','')}
|
|
|
-
|
|
|
-# 输出格式与要求
|
|
|
-互动工具列表
|
|
|
-工具名:${this.languageSetting == 2 ? 'Diagram Tool' : '表格'}
|
|
|
-工具指引:同学们,在完成本次STEM小车实验时,我们需要使用表格工具来记录和整理实验数据。表格工具就像一个电子版的记录本,它不仅可以帮助我们准确记录数据,还能自动计算和生成图表,方便我们分析实验结果。在第一行,每个单元格中输入我们要记录的变量名称,比如“时间(秒)”、“距离(米)”、“速度(米/秒)”等。接下来,在实验中,我们会把每次测试的结果依次填入相应的单元格中。记得每一行代表一次完整的实验测试哦。
|
|
|
-
|
|
|
-工具名:${this.languageSetting == 2 ? 'Document tool' : '文档'}
|
|
|
-工具指引:在实验数据整理好之后,我们接下来要用文档工具撰写实验报告。这份报告不仅是对我们实验的总结,也是展示我们分析和思考能力的好机会。文档工具就像一本电子笔记本,可以帮助我们把想法和数据清晰地展示出来。该份实验报告需要包括以下内容:1.实验背景: 简单介绍实验的目的,比如“我们这次实验的目的是通过小车演示,理解速度和加速度的关系”。用简洁的语言说明你为什么要做这个实验。\n2.实验方法: 详细描述你是如何进行实验的,包括实验步骤和使用的工具。例如,你可以写“我们将小车放在一个倾斜的平面上,记录它在不同时间间隔下的距离”。\n 3.数据分析: 这部分是核心内容。你可以将表格工具生成的图表插入到文档中,并解释图表显示的结果。例如,你可以写“从图表中可以看出,随着时间的增加,小车的速度逐渐加快,这说明……”。\n 4.结论与建议: 最后,总结你在实验中得出的结论,比如“小车在光滑表面上的加速度较大”,并提出一些改进实验或进一步研究的建议。
|
|
|
-
|
|
|
-工具名称:${this.languageSetting == 2 ? 'Choice tool' : '选择题'}
|
|
|
-工具指引:同学们,老师想要考察一下你对“热传递”这一概念的理解和掌握程度。请仔细阅读每个问题,并给出准确的答案哦~
|
|
|
-
|
|
|
-${this.languageSetting == 2 ? '还有以下工具:Mind Map Tool、Spreadsheet tool、Q&A Tool' : ''}
|
|
|
-
|
|
|
-# Format example
|
|
|
-{"toolChoose":[{"tool":"工具名","detail":"工具描述"},{"tool":"工具名","detail":"工具描述"}]}`
|
|
|
-
|
|
|
-let message3 = `NOTICE
|
|
|
-Role: 你是一名教师,你正在使用一个在线学习平台来教授学生,你已经完成了教案,你现在需要将教案变为学生上课用的任务单(work sheet)。该在线学习平台为每个任务提供了资源区(视频,ppt,阅读资料将放在这里),多种互动工具(学生点击工具即可上传他们的作业或者回答,这些互动工具类似kahoot一样允许教师轻松收集,统计,追踪学生作业),以及和任务绑定的目标和评价系统。
|
|
|
-Language: ${this.getLang()}
|
|
|
-ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
|
|
|
-Instruction: Based on the context, follow "Format example", write content.
|
|
|
-
|
|
|
-# Context
|
|
|
-## 要求
|
|
|
-${msg3}
|
|
|
-
|
|
|
-
|
|
|
-## 参考资料
|
|
|
-教学任务教案:${this.unitJson[0].chapterInfo[0].taskJson[this.aiCallBack[0]].taskDetail3.replaceAll('#','').replaceAll('*','').replaceAll('-','').replaceAll('\n','')}
|
|
|
-
|
|
|
-# 输出格式与要求
|
|
|
-核心素养:从教案中提取
|
|
|
-目标:从教案中提取
|
|
|
-评价标准:从教案中提取评价标准
|
|
|
-
|
|
|
-# Format example
|
|
|
-{"elist":[{"value":"目标","detail":"评价标准",target:"核心素养","score":5},{"value":"目标","detail":"评价标准",target:"核心素养","score":5},{"value":"目标","detail":"评价标准",target:"核心素养","score":5}]}`
|
|
|
-
|
|
|
if(!this.taskGLoading[this.aiCallBack[0]]){
|
|
|
this.taskGLoading[this.aiCallBack[0]] = []
|
|
|
+ this.ttaskGLoading[this.aiCallBack[0]] = []
|
|
|
}
|
|
|
this.taskGLoading[this.aiCallBack[0]][0] = true
|
|
|
+ this.ttaskGLoading[this.aiCallBack[0]][0] = true
|
|
|
// this.taskGLoading[this.aiCallBack[0]][1] = true
|
|
|
// this.taskGLoading[this.aiCallBack[0]][2] = true
|
|
|
- this.aiGetG321(message1, this.aiCallBack[0], () => {
|
|
|
+ this.aiGetG321L(message1, this.aiCallBack[0], () => {
|
|
|
// this.aiGetG322(message2, this.aiCallBack[0])
|
|
|
// this.aiCallBack[0] ? this.aiCallBack[0]() : ''
|
|
|
})
|
|
@@ -19684,6 +19580,11 @@ ${this.courseText && this.aiCallBack[0] == 2 ? '注意,优化原有的<参考
|
|
|
if(this.taskGLoading[index] && this.taskGLoading[index][0]){
|
|
|
this.taskGLoading[index][0] = false
|
|
|
}
|
|
|
+ if(this.isTaskCancelSource1[index]){
|
|
|
+ this.isTaskCancelSource1[index].close()
|
|
|
+ this.isTaskCancelSource1[index] = null
|
|
|
+ }
|
|
|
+
|
|
|
setTimeout(() => {
|
|
|
if(!(this.taskCancelToken2 && this.taskCancelToken2[index])){
|
|
|
this.cancelAjax('aiTaskGL2', index)
|
|
@@ -20934,6 +20835,142 @@ ${this.courseText && this.aiCallBack[0] == 2 ? '注意,优化原有的<参考
|
|
|
console.log(error);
|
|
|
});
|
|
|
},
|
|
|
+ async aiGetG321L(messages, index, callback, callback2) {
|
|
|
+ let _this = this
|
|
|
+
|
|
|
+ let fileid = _this.isFileSearch ? [..._this.fileIds] : []
|
|
|
+ fileid = [...fileid, ..._this.knowFileids, ..._this.knowFileids2]
|
|
|
+ if (_this.infoData.length) {
|
|
|
+ for (var i = 0; i < _this.infoData.length; i++) {
|
|
|
+ if(_this.infoData[i].fileid){
|
|
|
+ fileid.push(_this.infoData[i].fileid)
|
|
|
+ }else {
|
|
|
+ let _fileid = await _this.createFileid(_this.infoData[i].url)
|
|
|
+ if(_fileid){
|
|
|
+ _this.infoData[i].fileid = _fileid == 1 ? '' : _fileid
|
|
|
+ _this.$forceUpdate();
|
|
|
+ if(_fileid != 1){
|
|
|
+ fileid.push(_fileid)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ _this.taskCancelToken1[index] = _this.ajax.setCancelSource();
|
|
|
+ let _uuid = uuidv4();
|
|
|
+
|
|
|
+ let parm = {
|
|
|
+ assistant_id: 'f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b',
|
|
|
+ message: [{"type":"text", "text":this.languageSetting == 1 ? converter2(messages.replaceAll('\n', " ").replaceAll('*', "")) : messages.replaceAll('\n', " ").replaceAll('*', "")}],
|
|
|
+ session_name: uuidv4(),
|
|
|
+ userId: this.userid,
|
|
|
+ file_ids: fileid.length ? [...fileid] : '',
|
|
|
+ uid: _uuid,
|
|
|
+ // model: 'gpt-4o-2024-08-06',
|
|
|
+ model: 'gpt-4o-mini',
|
|
|
+ temperature: this.mode == 3 ? 0.5 : 0.1,
|
|
|
+ }
|
|
|
+ this.ajax
|
|
|
+ .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", parm, _this.taskCancelToken1[index])
|
|
|
+ .then(async (response) => {
|
|
|
+ console.log(response);
|
|
|
+ // }
|
|
|
+
|
|
|
+ if (converter(response.data.FunctionResponse.result) == converter("发送成功")) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ _this.$message.warning(response.data.FunctionResponse.result);
|
|
|
+ callback ? callback(callback2) : ''
|
|
|
+ _this.taskGLoading[index][0] = false
|
|
|
+ _this.ttaskGLoading[index][0] = false
|
|
|
+ _this.taskCancelToken1[index] = null
|
|
|
+ }
|
|
|
+
|
|
|
+ _this.taskCancelToken1[index] = null
|
|
|
+ _this.$forceUpdate();
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ // _this.loading = false
|
|
|
+ callback ? callback(callback2) : ''
|
|
|
+ _this.taskGLoading[index][0] = false
|
|
|
+ _this.ttaskGLoading[index][0] = false
|
|
|
+ _this.taskCancelToken1[index] = null
|
|
|
+ _this.$forceUpdate();
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+ await _this.aiGetG321LgetAiContent(_uuid, index, callback, callback2)
|
|
|
+ },
|
|
|
+ aiGetG321LgetAiContent(_uid, index, callback, callback2) {
|
|
|
+ try {
|
|
|
+ // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
+ this.isTaskCancelSource1[index] = 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/
|
|
|
+ } catch(error){
|
|
|
+ console.log('EventSource error:', error);
|
|
|
+ this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ callback ? callback(callback2) : ''
|
|
|
+ this.taskGLoading[index][0] = false
|
|
|
+ this.ttaskGLoading[index][0] = false
|
|
|
+ this.taskCancelToken1[index][0] = null
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ let _allText = "";
|
|
|
+ let _mdText = "";
|
|
|
+ let _iindex = 0
|
|
|
+ this.isTaskCancelSource1[index].onmessage = _e => {
|
|
|
+ let _eData = JSON.parse(_e.data).content;
|
|
|
+ if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
|
+ //对话已经完成
|
|
|
+ _mdText = _mdText.replace("_", "").replace(/【[^】]*source[^】]*】/g, '').replaceAll("<br>", "");
|
|
|
+ callback ? callback(callback2) : ''
|
|
|
+ this.isTaskCancelSource1[index].close();
|
|
|
+ this.isTaskCancelSource1[index] = null;
|
|
|
+ this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail = _mdText;
|
|
|
+ this.unitJson[0].chapterInfo[0].taskJson[index].chapterData = []
|
|
|
+ this.taskGLoading[index][0] = false
|
|
|
+ this.ttaskGLoading[index][0] = false
|
|
|
+ this.taskCancelToken1[index][0] = null
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ _iindex++
|
|
|
+ //对话还在继续
|
|
|
+ let _text = "";
|
|
|
+ _text = _eData.replaceAll("'", "");
|
|
|
+ if (_allText == "") {
|
|
|
+ _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
|
|
|
+ } else {
|
|
|
+ _allText += _text;
|
|
|
+ }
|
|
|
+ _mdText = _allText + "_";
|
|
|
+ _mdText = _mdText.replace(/\\n/g, "\n");
|
|
|
+ _mdText = _mdText.replace(/\\/g, "");
|
|
|
+ if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
|
|
|
+ //转化返回的回复流数据.
|
|
|
+ if(_iindex == 10){
|
|
|
+ this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail = _mdText;
|
|
|
+ _iindex = 0
|
|
|
+ }
|
|
|
+ this.taskGLoading[index][0] = false
|
|
|
+ // 处理流数据
|
|
|
+ }
|
|
|
+ // this.$forceUpdate();
|
|
|
+ };
|
|
|
+
|
|
|
+ let _this = this
|
|
|
+ this.isTaskCancelSource1[index].onerror = function(event) {
|
|
|
+ // 处理错误,可以尝试重新连接
|
|
|
+ console.log('EventSource error:', event);
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ callback ? callback(callback2) : ''
|
|
|
+ _this.taskGLoading[index][0] = false
|
|
|
+ _this.ttaskGLoading[index][0] = false
|
|
|
+ _this.taskCancelToken1[index][0] = null
|
|
|
+ _this.isTaskCancelSource1[index].close();
|
|
|
+ _this.isTaskCancelSource1[index] = null;
|
|
|
+ };
|
|
|
+ },
|
|
|
async aiGetG322(messages, index, callback) {
|
|
|
let _this = this
|
|
|
|
|
@@ -22045,7 +22082,7 @@ ${msg}
|
|
|
// this.$forceUpdate();
|
|
|
};
|
|
|
|
|
|
- let _this = _this
|
|
|
+ let _this = this
|
|
|
this.isOutlineTaskCancelSource[_tindex2].onerror = function(event) {
|
|
|
// 处理错误,可以尝试重新连接
|
|
|
console.log('EventSource error:', event);
|