diff --git a/src/lib/components/chat/ChatMessage.svelte b/src/lib/components/chat/ChatMessage.svelte index ff4f9f37915..05fe2ad43dd 100644 --- a/src/lib/components/chat/ChatMessage.svelte +++ b/src/lib/components/chat/ChatMessage.svelte @@ -23,10 +23,12 @@ import OpenWebSearchResults from "../OpenWebSearchResults.svelte"; import { + MessageUpdateType, MessageWebSearchUpdateType, type MessageToolUpdate, type MessageWebSearchSourcesUpdate, type MessageWebSearchUpdate, + type MessageFinalAnswerUpdate, } from "$lib/types/MessageUpdate"; import { base } from "$app/paths"; import { useConvTreeStore } from "$lib/stores/convTree"; @@ -149,6 +151,10 @@ $: searchUpdates = (message.updates?.filter(({ type }) => type === "webSearch") ?? []) as MessageWebSearchUpdate[]; + $: messageFinalAnswer = message.updates?.find( + ({ type }) => type === MessageUpdateType.FinalAnswer + ) as MessageFinalAnswerUpdate; + // filter all updates with type === "tool" then group them by uuid field $: toolUpdates = message.updates @@ -314,7 +320,29 @@ {/each} {/if} + + + {#if messageFinalAnswer?.webSources && messageFinalAnswer.webSources.length} +