refac
This commit is contained in:
1 parent
0016266c06
commit
4b08d65597
5 files changed
+25
-13
No files matched your search
@@ -22,6 +22,7 @@
|
||||
} from '$lib/apis/chats';
|
||||
import { chats, folders, settings, theme, user } from '$lib/stores';
|
||||
import { createMessagesList } from '$lib/utils';
|
||||
import { getOutputText } from '$lib/components/chat/Messages/structuredOutput';
|
||||
import { downloadChatAsPDF } from '$lib/apis/utils';
|
||||
import Download from '$lib/components/icons/Download.svelte';
|
||||
import Folder from '$lib/components/icons/Folder.svelte';
|
||||
@@ -61,7 +62,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