| | |
| | | /> |
| | | </template> |
| | | <template #content> |
| | | <a-textarea |
| | | readonly |
| | | auto-size |
| | | v-model="displayedText" |
| | | :class="{ chatItemAnswer: theme === 'light' }" |
| | | :style="{ |
| | | backgroundColor: theme === 'light' ? '#ffffff' : '#000000', |
| | | }" |
| | | style="border: none" |
| | | > |
| | | </a-textarea> |
| | | <a-spin :loading="loading" dot style="width: 100%"> |
| | | <a-textarea |
| | | readonly |
| | | auto-size |
| | | v-model="displayedText" |
| | | :class="{ chatItemAnswer: theme === 'light' }" |
| | | :style="{ |
| | | backgroundColor: theme === 'light' ? '#ffffff' : '#000000', |
| | | }" |
| | | style="border: none" |
| | | > |
| | | </a-textarea> |
| | | </a-spin> |
| | | </template> |
| | | <template #actions> |
| | | <div |
| | |
| | | ></updataFile> --> |
| | | <span v-if="getAent"></span> |
| | | <uploadFile |
| | | v-if="agentObj.id == 'excel_talk' || dialog_id == 'excel_talk'" |
| | | v-if="!getAent" |
| | | ref="fileInput" |
| | | :sessionId="activeSessionId" |
| | | @selectFileCallback="selectFileCallback" |
| | |
| | | id: agentObj.id, |
| | | }), |
| | | }); |
| | | refreshScroll(); |
| | | |
| | | const reader = response?.body |
| | | ?.pipeThrough(new TextDecoderStream()) |
| | |
| | | const d = val?.data; |
| | | if (typeof d !== 'boolean') { |
| | | console.info('data:', d); |
| | | streamStr.value = d.content; |
| | | if (d?.content) { |
| | | streamStr.value = d.content; |
| | | } else { |
| | | streamStr.value = d.code + d.sql; |
| | | } |
| | | startDisplayStr(); |
| | | } |
| | | } catch (e) { |
| | |
| | | |
| | | const getAentId = (id) => { |
| | | if (id == 'excel_talk') { |
| | | console.log(1); |
| | | getAent.value = false; |
| | | } |
| | | if (id == 'questions_talk') { |
| | | console.log(2); |
| | | getAent.value = true; |
| | | } |
| | | }; |
| | |
| | | conversation_id.value = session.id; |
| | | activeSessionId.value = session.id; |
| | | dialog_id.value = session.dialog_id; |
| | | console.log(4554); |
| | | |
| | | uploaditemList.value = []; |
| | | getAentId(session.dialog_id); |
| | | from.name = session.name; |
| | | const { code, data } = await getSessionDetailsApi(session.id); |
| | |
| | | try { |
| | | loading.value = true; |
| | | chatDis.value = true; |
| | | let name = inputMsg.value; |
| | | |
| | | if (val) { |
| | | name = val[0].name.split('.')[0]; |
| | | } |
| | | |
| | | if (!activeSessionId.value) { |
| | | let message = [ |
| | |
| | | content: sessionDetailList.value[0].content, |
| | | role: 'assistant', |
| | | }, |
| | | { |
| | | content: inputMsg.value, |
| | | role: 'user', |
| | | }, |
| | | ]; |
| | | const res = await agentConversationSetApi({ |
| | | id: '', |
| | | app_id: agentObj.id, |
| | | name: inputMsg.value, |
| | | name: name, |
| | | message: message, |
| | | }); |
| | | // console.log(res, "res"); |
| | |
| | | if (!val) { |
| | | startChat(inputMsg.value); |
| | | inputMsg.value = ''; |
| | | uploaditemList.value = []; |
| | | } else { |
| | | loading.value = false; |
| | | chatDis.value = false; |
| | |
| | | const formData = new FormData(); |
| | | uploaditemList.value = resData; |
| | | if (!activeSessionId.value) { |
| | | await createSession(1); |
| | | await createSession(resData); |
| | | } |
| | | |
| | | onFileSelectedLoading.value = true; |
| | |
| | | |
| | | if (typeof d !== 'boolean') { |
| | | console.info('data:', d); |
| | | streamStr.value = d.content; |
| | | |
| | | if (d?.content) { |
| | | streamStr.value = d.content; |
| | | } else { |
| | | streamStr.value = d.code; |
| | | } |
| | | |
| | | startDisplayStr(); |
| | | } |
| | | } catch (e) { |
| | |
| | | if (timer) { |
| | | clearTimeout(timer!); |
| | | } |
| | | |
| | | const res = streamStr.value; |
| | | // 将数组中的字符串拼接起来 |
| | | |