{#if dragged}
{/if}
{#if autoScroll === false && messages.length > 0}
{/if}
{#if prompt.charAt(0) === '/'} {:else if prompt.charAt(0) === '#'} { console.log(e); uploadYoutubeTranscription(e.detail); }} on:url={(e) => { console.log(e); uploadWeb(e.detail); }} on:select={(e) => { console.log(e); files = [ ...files, { type: e?.detail?.type ?? 'doc', ...e.detail, upload_status: true } ]; }} /> {/if} { atSelectedModel = e.detail; chatTextAreaElement?.focus(); }} /> {#if atSelectedModel !== undefined}
model profile model.id === atSelectedModel.id)?.info?.meta ?.profile_image_url ?? ($i18n.language === 'dg-DG' ? `/doge.png` : `${WEBUI_BASE_URL}/static/favicon.png`)} />
Talking to {atSelectedModel.name}
{/if}
{ if (inputFiles && inputFiles.length > 0) { const _inputFiles = Array.from(inputFiles); _inputFiles.forEach((file) => { if (['image/gif', 'image/webp', 'image/jpeg', 'image/png'].includes(file['type'])) { if (visionCapableModels.length === 0) { toast.error($i18n.t('Selected model(s) do not support image inputs')); return; } let reader = new FileReader(); reader.onload = (event) => { files = [ ...files, { type: 'image', url: `${event.target.result}` } ]; }; reader.readAsDataURL(file); } else { uploadFileHandler(file); } }); } else { toast.error($i18n.t(`File not found.`)); } filesInputElement.value = ''; }} /> {#if recording} { recording = false; await tick(); document.getElementById('chat-textarea')?.focus(); }} on:confirm={async (e) => { const response = e.detail; prompt = `${prompt}${response} `; recording = false; await tick(); document.getElementById('chat-textarea')?.focus(); if ($settings?.speechAutoSend ?? false) { submitPrompt(prompt); } }} /> {:else}
{ // check if selectedModels support image input submitPrompt(prompt); }} >
{#if files.length > 0}
{#each files as file, fileIdx}
{#if file.type === 'image'}
input {#if atSelectedModel ? visionCapableModels.length === 0 : selectedModels.length !== visionCapableModels.length} !visionCapableModels.includes(id)) .join(', ') })} > {/if}
{:else if file.type === 'doc'}
{#if file.upload_status} {:else} {/if}
{file.name}
{$i18n.t('Document')}
{:else if file.type === 'collection'}
{file?.title ?? `#${file.name}`}
{$i18n.t('Collection')}
{/if}
{/each}
{/if}
{ if (availableToolIds.includes(e.id) || ($_user?.role ?? 'user') === 'admin') { a[e.id] = { name: e.name, description: e.meta.description, enabled: false }; } return a; }, {})} uploadFilesHandler={() => { filesInputElement.click(); }} onClose={async () => { await tick(); chatTextAreaElement?.focus(); }} >