{#key message.id}
{#if message.model in modelfiles} {modelfiles[message.model]?.title} {:else} {message.model ? ` ${message.model}` : ''} {/if} {#if message.timestamp}
{dayjs(message.timestamp * 1000).format($i18n.t('DD/MM/YYYY HH:mm'))}
{/if}
{#if message.content === ''}
{:else} {#if message.files}
{#each message.files as file}
{#if file.type === 'image'}
{/if}
{/each}
{/if}
{#if edit === true}
{ e.target.style.height = ''; e.target.style.height = `${e.target.scrollHeight}px`; }} />
{ editMessageConfirmHandler(); }} > {$i18n.t('Save')}
{ cancelEditMessage(); }} > {$i18n.t('Cancel')}
{:else}
{#if message?.error === true}
{message.content}
{:else} {#each tokens as token} {#if token.type === 'code'}
{:else} {@html marked.parse(token.raw, { ...defaults, gfm: true, breaks: true, renderer })} {/if} {/each} {/if}
{/if}
{#if flattenedCitations}
{#each [...Object.keys(flattenedCitations)] as source, idx}
[{idx + 1}]
{ showCitations[source] = !showCitations[source]; }} > {source}
{/each}
{/if} {#if message.done}
{#if siblings.length > 1}
{ showPreviousMessage(message); }} >
{siblings.indexOf(message.id) + 1} / {siblings.length}
{ showNextMessage(message); }} >
{/if} {#if !readOnly}
{ editMessageHandler(); }} >
{/if}
{ copyToClipboard(message.content); }} >
{#if !readOnly}
{ rateMessage(message.id, 1); showRateComment = true; window.setTimeout(() => { document.getElementById(`message-feedback-${message.id}`)?.scrollIntoView(); }, 0); }} >
{ rateMessage(message.id, -1); showRateComment = true; window.setTimeout(() => { document.getElementById(`message-feedback-${message.id}`)?.scrollIntoView(); }, 0); }} >
{/if}
{ if (!loadingSpeech) { toggleSpeakMessage(message); } }} > {#if loadingSpeech}
{:else if speaking}
{:else}
{/if}
{#if $config.images && !readOnly}
{ if (!generatingImage) { generateImage(message); } }} > {#if generatingImage}
{:else}
{/if}
{/if} {#if message.info}
{ console.log(message); }} id="info-{message.id}" >
{/if} {#if isLastMessage && !readOnly}
{ continueGeneration(); }} >
{/if}
{/if} {#if showRateComment}
{ updateChatMessages(); }} /> {/if} {/if}
{/key}