{#if dragged}
🏞️
Add Images
Drop any images here to add to the conversation
{/if}
{#if messages.length == 0 && suggestionPrompts.length !== 0}
{/if} {#if autoScroll === false && messages.length > 0}
{ autoScroll = true; window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' }); }} >
{/if}
{ let reader = new FileReader(); reader.onload = (event) => { files = [ ...files, { type: 'image', url: `${event.target.result}` } ]; inputFiles = null; filesInputElement.value = ''; }; if ( inputFiles && inputFiles.length > 0 && ['image/gif', 'image/jpeg', 'image/png'].includes(inputFiles[0]['type']) ) { reader.readAsDataURL(inputFiles[0]); } else { toast.error(`Unsupported File Type '${inputFiles[0]['type']}'.`); inputFiles = null; } }} />
{ submitPrompt(prompt); }} > {#if files.length > 0}
{#each files as file, fileIdx}
{ files.splice(fileIdx, 1); files = files; }} >
{/each}
{/if}
{#if fileUploadEnabled}
{ filesInputElement.click(); }} >
{/if}
{ if (e.keyCode == 13 && !e.shiftKey) { e.preventDefault(); } if (prompt !== '' && e.keyCode == 13 && !e.shiftKey) { submitPrompt(prompt); } }} on:keydown={(e) => { if (prompt === '' && e.key == 'ArrowUp') { e.preventDefault(); const userMessageElement = [ ...document.getElementsByClassName('user-message') ]?.at(-1); const editButton = [ ...document.getElementsByClassName('edit-user-message-button') ]?.at(-1); console.log(userMessageElement); userMessageElement.scrollIntoView({ block: 'center' }); editButton?.click(); } }} rows="1" on:input={(e) => { e.target.style.height = ''; e.target.style.height = Math.min(e.target.scrollHeight, 200) + 'px'; }} on:paste={(e) => { const clipboardData = e.clipboardData || window.clipboardData; if (clipboardData && clipboardData.items) { for (const item of clipboardData.items) { if (item.type.indexOf('image') !== -1) { const blob = item.getAsFile(); const reader = new FileReader(); reader.onload = function (e) { files = [ ...files, { type: 'image', url: `${e.target.result}` } ]; }; reader.readAsDataURL(blob); } } } }} />
{#if messages.length == 0 || messages.at(-1).done == true} {#if speechRecognitionEnabled}
{ speechRecognitionHandler(); }} > {#if speechRecognitionListening}
{:else}
{/if}
{/if}
{:else}
{/if}
LLMs can make mistakes. Verify important information.