diff --git a/src/lib/components/chat/Messages.svelte b/src/lib/components/chat/Messages.svelte index 534f48968..26291e115 100644 --- a/src/lib/components/chat/Messages.svelte +++ b/src/lib/components/chat/Messages.svelte @@ -295,7 +295,7 @@ }} /> {:else} -
+
{#key chatId} {#each messages as message, messageIdx}
diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte index 0a557b362..5cce7b774 100644 --- a/src/lib/components/chat/Messages/ResponseMessage.svelte +++ b/src/lib/components/chat/Messages/ResponseMessage.svelte @@ -137,20 +137,22 @@ .getElementById(`message-${message.id}`) ?.getElementsByClassName('chat-assistant'); - for (const element of chatMessageElements) { - auto_render(element, { - // customised options - // • auto-render specific keys, e.g.: - delimiters: [ - { left: '$$', right: '$$', display: false }, - { left: '$ ', right: ' $', display: false }, - { left: '\\(', right: '\\)', display: false }, - { left: '\\[', right: '\\]', display: false }, - { left: '[ ', right: ' ]', display: false } - ], - // • rendering keys, e.g.: - throwOnError: false - }); + if (chatMessageElements) { + for (const element of chatMessageElements) { + auto_render(element, { + // customised options + // • auto-render specific keys, e.g.: + delimiters: [ + { left: '$$', right: '$$', display: false }, + { left: '$ ', right: ' $', display: false }, + { left: '\\(', right: '\\)', display: false }, + { left: '\\[', right: '\\]', display: false }, + { left: '[ ', right: ' ]', display: false } + ], + // • rendering keys, e.g.: + throwOnError: false + }); + } } };