| | |
| | | const files = ref([]); |
| | | const file = ref(''); |
| | | const fileInput = ref(null); |
| | | |
| | | const chatDataMeg = reactive({}) |
| | | const visible = ref(false); |
| | | |
| | | |
| | |
| | | |
| | | const handleSubmit = async({values, errors}) => { |
| | | if(errors) return; |
| | | chatObj.name = agentTitle.value; |
| | | const { code, data } = await addSessionApi(chatObj); |
| | | // chatObj.name = agentTitle.value; |
| | | // chatObj.conversation_id = chatObj.id; |
| | | let chatData = { |
| | | id:chatObj.id, |
| | | conversation_id:chatObj.id, |
| | | name: agentTitle.value |
| | | } |
| | | const { code, data } = await addSessionApi(chatData); |
| | | if (data) { |
| | | Message.success("修改成功"); |
| | | handleCancel() |
| | |
| | | if (done) { |
| | | console.info("done"); |
| | | displayedText.value = ""; |
| | | // if(!isStopChat.value){ |
| | | // queryNewSessionDetail(activeSessionId.value); |
| | | // } |
| | | queryNewSessionDetail(activeSessionId.value); |
| | | EventBus.emit("queryAppUsageList"); |
| | | if(isStopChat.value){ |
| | | setChatDataMeg(chatDataMeg); |
| | | }else{ |
| | | queryNewSessionDetail(activeSessionId.value); |
| | | EventBus.emit("queryAppUsageList"); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | |
| | | chatDis.value = false; |
| | | loading.value = false; |
| | | }; |
| | | |
| | | |
| | | |
| | | const stopChat = async () => { |
| | | // const { code, data } = await stopChatApi(activeSessionId.value); |
| | |
| | | role: "assistant" |
| | | }]; |
| | | sessionDetailList.value = sessionDetailList.value.splice(0, sessionDetailList.value.length - 2).concat(lastArr); |
| | | |
| | | console.log(sessionDetailList.value, "sessionDetailList2"); |
| | | console.log(chatObj, "chatObj对象"); |
| | | chatObj.message = chatObj.message.concat(lastArr); |
| | | // clearTimeout(timer!); |
| | | // timer = null; |
| | | // const { code, data } = await addSessionApi(chatObj); |
| | | // if (data) { |
| | | // //停止定时器 |
| | | // clearTimeout(timer!); |
| | | // timer = null; |
| | | // displayedText.value = ""; |
| | | // queryNewSessionDetail(activeSessionId.value); |
| | | // } |
| | | Object.assign(chatDataMeg,{ |
| | | id:chatObj.id, |
| | | conversation_id:chatObj.id, |
| | | message: sessionDetailList.value |
| | | }); |
| | | |
| | | }; |
| | | |
| | | |
| | | const setChatDataMeg = async(chatData) => { |
| | | const { code, data } = await addSessionApi(chatData); |
| | | if (data) { |
| | | //停止定时器 |
| | | clearTimeout(timer!); |
| | | timer = null; |
| | | // displayedText.value = ""; |
| | | queryNewSessionDetail(activeSessionId.value); |
| | | } |
| | | }; |
| | | |
| | | |
| | | |