ai-assistant-pro 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/demo/src/chat.vue +12 -1
- package/components/demo/src/main.vue +2 -1
- package/dist/ai-assistant-pro.common.js +2698 -155
- package/dist/ai-assistant-pro.common.js.map +1 -1
- package/dist/ai-assistant-pro.css +1 -1
- package/dist/ai-assistant-pro.umd.js +2697 -154
- package/dist/ai-assistant-pro.umd.js.map +1 -1
- package/dist/ai-assistant-pro.umd.min.js +4 -4
- package/dist/ai-assistant-pro.umd.min.js.map +1 -1
- package/package.json +2 -1
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
import { errorList, cacheMessageList } from '../utils/config';
|
|
66
66
|
import ChatTools from './chat-tools.vue';
|
|
67
67
|
import { sendMessageEventSource, getAutoQuestioning } from "../api";
|
|
68
|
+
import { marked } from 'marked';
|
|
68
69
|
const controller = new AbortController();
|
|
69
70
|
const signal = controller.signal;
|
|
70
71
|
|
|
@@ -147,6 +148,7 @@ export default {
|
|
|
147
148
|
content: this.messageData[list.index - 1].message,
|
|
148
149
|
}
|
|
149
150
|
this.messageData[list.index].message = '';
|
|
151
|
+
this.messageData[list.index].cacheMessage = '';
|
|
150
152
|
this.makeAutoMessage();
|
|
151
153
|
}
|
|
152
154
|
const params = {
|
|
@@ -170,6 +172,7 @@ export default {
|
|
|
170
172
|
{
|
|
171
173
|
type: 'robot',
|
|
172
174
|
message: '',
|
|
175
|
+
cacheMessage: '',
|
|
173
176
|
zan: false,
|
|
174
177
|
cai: false,
|
|
175
178
|
stop: false,
|
|
@@ -228,7 +231,8 @@ export default {
|
|
|
228
231
|
this.$emit('on-message-finish', chatId);
|
|
229
232
|
return;
|
|
230
233
|
}
|
|
231
|
-
currentList.
|
|
234
|
+
currentList.cacheMessage += content;
|
|
235
|
+
currentList.message = marked.parse(currentList.cacheMessage);
|
|
232
236
|
currentList.msgId = msgId;
|
|
233
237
|
currentList.parentMsgId = parentMsgId;
|
|
234
238
|
currentList.chatId = chatId;
|
|
@@ -344,6 +348,13 @@ export default {
|
|
|
344
348
|
line-height: 24px;
|
|
345
349
|
flex: 1;
|
|
346
350
|
}
|
|
351
|
+
:deep {
|
|
352
|
+
.robot-message {
|
|
353
|
+
p {
|
|
354
|
+
margin: 0;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
347
358
|
|
|
348
359
|
.user-info {
|
|
349
360
|
width: auto;
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
import HotSearch from './hot-search.vue';
|
|
54
54
|
import Chat from './chat.vue';
|
|
55
55
|
import Cookies from "js-cookie";
|
|
56
|
+
import { marked } from 'marked';
|
|
56
57
|
import { getUserInfo } from '../utils/config';
|
|
57
58
|
import { newChat, chartClear, getDetailList, countAccess,checkCourseIdIsExist } from '../api/index';
|
|
58
59
|
export default {
|
|
@@ -142,7 +143,7 @@ export default {
|
|
|
142
143
|
}
|
|
143
144
|
const obj = {
|
|
144
145
|
type: list.role === 'assistant' ? 'robot' : 'user',
|
|
145
|
-
message: list.content.replace(/\n/g, '<br>'),
|
|
146
|
+
message: list.role === 'assistant' ? marked.parse(list.content) : list.content.replace(/\n/g, '<br>'),
|
|
146
147
|
zan: list.type === 1,
|
|
147
148
|
cai: list.type === 2,
|
|
148
149
|
stop: list.status === 1,
|