|
@@ -421,13 +421,12 @@
|
|
|
</svg>
|
|
|
<span>清屏</span>
|
|
|
</span>
|
|
|
- <span
|
|
|
- class="clear"
|
|
|
- @click.stop="showjList = !showjList"
|
|
|
- v-if="jArray.length"
|
|
|
- >
|
|
|
- <span>查看</span>
|
|
|
- </span>
|
|
|
+ <span class="switchBtn">
|
|
|
+ <span>连续对话</span>
|
|
|
+ <el-switch
|
|
|
+ v-model="continuousDialogue">
|
|
|
+ </el-switch>
|
|
|
+ </span>
|
|
|
<!-- <div style="margin-left: auto;">
|
|
|
<el-switch v-model="continuous"></el-switch>
|
|
|
<span @click.stop="continuous = !continuous">连续对话</span>
|
|
@@ -823,6 +822,7 @@ export default {
|
|
|
hasGeneratedGuess: false,
|
|
|
showPopoverUid: null,
|
|
|
curRequestController:null,
|
|
|
+ continuousDialogue:true,
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -1401,62 +1401,22 @@ ${fileText}
|
|
|
loading: true
|
|
|
});
|
|
|
|
|
|
- // let history = [];
|
|
|
- // if (this.continuous) {
|
|
|
- // this.array.forEach((i, index) => {
|
|
|
- // if (i.content) history.push({ role: "user", content: index == this.array.length - 1 ? message : i.content });
|
|
|
- // if (i.aiContent)
|
|
|
- // history.push({ role: "assistant", content: i.aiContent });
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // history.push({ role: "user", content: message });
|
|
|
- // }
|
|
|
- // history = history.filter(
|
|
|
- // i =>
|
|
|
- // i.content !=
|
|
|
- // "您好,我是您的助手小可"
|
|
|
- // );
|
|
|
-
|
|
|
- // history = history.map(i => ({
|
|
|
- // role: i.role,
|
|
|
- // content: `${i.content}`
|
|
|
- // }));
|
|
|
- // this.$nextTick(() => {
|
|
|
- // this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
|
|
|
- // });
|
|
|
- // let params = JSON.stringify({
|
|
|
- // // model: "gpt-3.5-turbo",
|
|
|
- // // model: "gpt-4o-mini",
|
|
|
- // model: "qwen-plus",
|
|
|
- // temperature: 0,
|
|
|
- // max_tokens: 4096,
|
|
|
- // top_p: 1,
|
|
|
- // frequency_penalty: 0,
|
|
|
- // presence_penalty: 0,
|
|
|
- // messages: history,
|
|
|
- // uid: _uuid,
|
|
|
- // mind_map_question: ""
|
|
|
- // });
|
|
|
- // this.courseText = "";
|
|
|
-
|
|
|
- // this.ajax
|
|
|
- // .post("https://gpt4.cocorobo.cn/chat", params)
|
|
|
- // .then(res => {
|
|
|
- // if (
|
|
|
- // converter(res.data.FunctionResponse.result) ==
|
|
|
- // converter("发送成功")
|
|
|
- // ) {
|
|
|
- // } else {
|
|
|
- // this.$message.warning(res.data.FunctionResponse.result);
|
|
|
- // }
|
|
|
- // })
|
|
|
- // .catch(e => {
|
|
|
- // console.log(e);
|
|
|
- // });
|
|
|
- // this.getAiContent(_uuid);\
|
|
|
+ let _history = [];
|
|
|
+
|
|
|
+ if(this.continuousDialogue){
|
|
|
+ this.array.forEach(i=>{
|
|
|
+ _history.push({
|
|
|
+ role: "user", content: i.content
|
|
|
+ },{
|
|
|
+ role: "assistant", content: i.aiContent
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
let params = {
|
|
|
prompt: message,
|
|
|
- messages: [],
|
|
|
+ messages: _history,
|
|
|
file: this.fileList ? this.fileList : []
|
|
|
};
|
|
|
this.stopTalkToken = this.ajax.setCancelSource();
|
|
@@ -1552,9 +1512,26 @@ ${fileText}
|
|
|
loading: true
|
|
|
});
|
|
|
|
|
|
+ let _history = [];
|
|
|
+
|
|
|
+ if(this.continuousDialogue){
|
|
|
+ this.array.forEach(i=>{
|
|
|
+ _history.push({
|
|
|
+ role: "user", content: i.content
|
|
|
+ },{
|
|
|
+ role: "assistant", content: i.aiContent
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ _history.pop();
|
|
|
+ _history.pop();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
let params = {
|
|
|
prompt: message,
|
|
|
- messages: [],
|
|
|
+ messages: _history,
|
|
|
file: this.fileList ? this.fileList : []
|
|
|
};
|
|
|
this.stopTalkToken = this.ajax.setCancelSource();
|
|
@@ -2888,7 +2865,8 @@ ${_echartsType[type].text}
|
|
|
bottom: calc(100% + 5px);
|
|
|
height: 30px;
|
|
|
display: flex;
|
|
|
- /* justify-content: space-between; */
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
}
|
|
|
|
|
|
.ai_b_i_btnArea > div {
|