diff --git a/src/lib/components/chat/Messages/CodeBlock.svelte b/src/lib/components/chat/Messages/CodeBlock.svelte index a9efc7fa9..5d7ae3f8e 100644 --- a/src/lib/components/chat/Messages/CodeBlock.svelte +++ b/src/lib/components/chat/Messages/CodeBlock.svelte @@ -148,7 +148,7 @@ executing = true; - document.pyodideMplTarget = document.getElementById('plt-canvas'); + document.pyodideMplTarget = document.getElementById(`plt-canvas-${id}`); let pyodide = await loadPyodide({ indexURL: '/pyodide/', @@ -314,6 +314,6 @@ __builtins__.input = input`); {/if} -
+
{/if} diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte index 13b2ab6c7..66268f51e 100644 --- a/src/lib/components/chat/Messages/ResponseMessage.svelte +++ b/src/lib/components/chat/Messages/ResponseMessage.svelte @@ -434,10 +434,10 @@ {:else if message.content === ''} {:else} - {#each tokens as token} + {#each tokens as token, tokenIdx} {#if token.type === 'code'}