(isTapped = !isTapped)}
on:keydown={() => (isTapped = !isTapped)}
>
{#if $page.data?.assistant?.avatar}
{#if message.files?.length}
{#each message.files as file}
{/each}
{/if}
{#if searchUpdates && searchUpdates.length > 0}
{/if}
{#if toolUpdates}
{#each Object.values(toolUpdates) as tool}
{#if tool.length}
{@const toolName = tool.find(isMessageToolCallUpdate)?.call.name}
{@const toolError = tool.some(isMessageToolErrorUpdate)}
{@const toolDone = tool.some(isMessageToolResultUpdate)}
{#if toolName && toolName !== "websearch"}
{toolError ? "Error calling" : toolDone ? "Called" : "Calling"} tool
{availableTools.find((el) => toolHasName(toolName, el))?.displayName}
{#each tool as toolUpdate}
{#if toolUpdate.subtype === MessageToolUpdateType.Call}
{#each Object.entries(toolUpdate.call.parameters ?? {}) as [k, v]}
-
{k}:
{v}
{/each}
{:else if toolUpdate.subtype === MessageToolUpdateType.Error}
{toolUpdate.message}
{/if}
{/each}
{/if}
{/if}
{/each}
{/if}
{#if isLast && loading && reducedMotionMode}
{/if}
{#each tokens as token}
{#if token.type === "code"}
{:else}
{@html marked.parse(token.raw, options)}
{/if}
{/each}
{#if webSearchSources?.length}
Sources:
{#each webSearchSources as { link, title }}
{new URL(link).hostname.replace(/^www\./, "")}
{/each}
{/if}