| | |
| | | /> |
| | | </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 |
| | |
| | | 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) { |
| | |
| | | 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); |
| | |
| | | { |
| | | content: sessionDetailList.value[0].content, |
| | | role: 'assistant', |
| | | }, |
| | | { |
| | | content: inputMsg.value, |
| | | role: 'user', |
| | | }, |
| | | ]; |
| | | const res = await agentConversationSetApi({ |
| | |
| | | |
| | | 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; |
| | | // 将数组中的字符串拼接起来 |
| | | |