refac
This commit is contained in:
1 parent
0016266c06
commit
4b08d65597
5 files changed
+25
-13
No files matched your search
@@ -7,6 +7,7 @@
|
||||
|
||||
import { downloadChatAsPDF } from '$lib/apis/utils';
|
||||
import { copyToClipboard, createMessagesList } from '$lib/utils';
|
||||
import { getOutputText } from '$lib/components/chat/Messages/structuredOutput';
|
||||
|
||||
import {
|
||||
showControls,
|
||||
@@ -59,7 +60,8 @@
|
||||
const history = chat.chat.history;
|
||||
const messages = createMessagesList(history, history.currentId);
|
||||
const chatText = messages.reduce((a, message, i, arr) => {
|
||||
return `${a}### ${message.role.toUpperCase()}\n${message.content}\n\n`;
|
||||
const content = getOutputText(message.output) || message.content || '';
|
||||
return `${a}### ${message.role.toUpperCase()}\n${content}\n\n`;
|
||||
}, '');
|
||||
|
||||
return chatText.trim();
|
||||
|
||||
Reference in new issue
Block a user