From 86359ef3748b5eb93a640b8be46e59a93c35018a Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 17 Jul 2024 16:56:11 +0200 Subject: [PATCH 1/3] refac --- src/lib/components/chat/Messages/UserMessage.svelte | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/lib/components/chat/Messages/UserMessage.svelte b/src/lib/components/chat/Messages/UserMessage.svelte index 5aa06ffe0..ac36dc7fd 100644 --- a/src/lib/components/chat/Messages/UserMessage.svelte +++ b/src/lib/components/chat/Messages/UserMessage.svelte @@ -99,12 +99,8 @@
{#if file.type === 'image'} input - {:else if file.type === 'file'} - - {:else if file.type === 'doc'} - - {:else if file.type === 'collection'} - + {:else} + {/if}
{/each} From 98f935b8f7669ea9978e5d1581e5f3024a4098dd Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 17 Jul 2024 17:00:43 +0200 Subject: [PATCH 2/3] fix --- src/lib/components/chat/Chat.svelte | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index c63fd0243..7f3c435a4 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -264,6 +264,8 @@ messages: {}, currentId: null }; + + chatFiles = []; params = {}; if ($page.url.searchParams.get('models')) { From 775a3dc359dbef0570933c76fb8600ed899b98ed Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 17 Jul 2024 17:11:50 +0200 Subject: [PATCH 3/3] refac --- src/lib/components/chat/Messages/ResponseMessage.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte index b8675a64e..a3500b77e 100644 --- a/src/lib/components/chat/Messages/ResponseMessage.svelte +++ b/src/lib/components/chat/Messages/ResponseMessage.svelte @@ -566,6 +566,11 @@ const metadata = citation.metadata?.[index]; const id = metadata?.source ?? 'N/A'; let source = citation?.source; + + if (metadata?.name) { + source = { ...source, name: metadata.name }; + } + // Check if ID looks like a URL if (id.startsWith('http://') || id.startsWith('https://')) { source = { name: id };