Просмотр исходного кода

对话问答增加conversation_id参数

htc 12 часов назад
Родитель
Сommit
5191a0850b
2 измененных файлов с 6 добавлено и 0 удалено
  1. 3 0
      pages/dialog.vue
  2. 3 0
      pages/reportAsk.vue

+ 3 - 0
pages/dialog.vue

@@ -90,6 +90,7 @@
 				currentRetry: 0, // 当前重试次数
 				isRequesting: false, // 请求状态锁
 				question:'',
+				conversation_id:'',
 				streamingResponse:'',
 				receivedData:'',
 				dialogList:[],
@@ -160,6 +161,7 @@
 						data:{ 
 							query: this.question,
 							identity:'被教练者',
+							conversation_id: this.conversation_id
 						},
 						header: {
 						  'Content-Type': 'application/json',
@@ -195,6 +197,7 @@
 									if(!n.trim()) return
 									let nj = JSON.parse(n);
 									if(nj.event=='message'){
+										this.conversation_id = nj.conversation_id;
 										let answer = this.dialogList[this.dialogList.length-1].answer+nj.answer?.replace(/(\r\n|\n|\r)+/g, '<br>');
 										this.$set(this.dialogList[this.dialogList.length-1],'answer',answer);
 										this.$set(this.dialogList[this.dialogList.length-1],'id',nj.id);

+ 3 - 0
pages/reportAsk.vue

@@ -79,6 +79,7 @@
 				currentRetry: 0, // 当前重试次数
 				isRequesting: false, // 请求状态锁
 				question:'',
+				conversation_id:'',
 				dialogList:[],
 				streamingResponse:'',
 				receivedData:'',
@@ -126,6 +127,7 @@
 						data:{ 
 							query: this.question,
 							identity:'被教练者',
+							conversation_id: this.conversation_id,
 							report:this.pdfUrl
 						},
 						header: {
@@ -162,6 +164,7 @@
 									if(!n.trim()) return
 									let nj = JSON.parse(n);
 									if(nj.event=='message'){
+										this.conversation_id = nj.conversation_id;
 										let answer = this.dialogList[this.dialogList.length-1].answer+nj.answer?.replace(/(\r\n|\n|\r)+/g, '<br>');
 										this.$set(this.dialogList[this.dialogList.length-1],'answer',answer);
 										this.$set(this.dialogList[this.dialogList.length-1],'id',nj.id);