From 41bd16acbe9fc4b129be8adcadbcb4340fb32be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6bius?= Date: Tue, 22 Oct 2024 06:32:08 +0200 Subject: [PATCH 1/2] don't overwrite name, keep url separate --- src/lib/components/chat/Messages/Citations.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/chat/Messages/Citations.svelte b/src/lib/components/chat/Messages/Citations.svelte index 0a09b3b55..714d7f20c 100644 --- a/src/lib/components/chat/Messages/Citations.svelte +++ b/src/lib/components/chat/Messages/Citations.svelte @@ -54,7 +54,7 @@ } if (id.startsWith('http://') || id.startsWith('https://')) { - source = { name: id }; + source = { ..source, url: id }; } const existingSource = acc.find((item) => item.id === id); From 9153525c8410956e5342c9101d98fcc4ac367358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6bius?= Date: Tue, 22 Oct 2024 06:35:01 +0200 Subject: [PATCH 2/2] use url if available as document link --- src/lib/components/chat/Messages/CitationsModal.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/Messages/CitationsModal.svelte b/src/lib/components/chat/Messages/CitationsModal.svelte index 8ff23e75d..bb48a3f53 100644 --- a/src/lib/components/chat/Messages/CitationsModal.svelte +++ b/src/lib/components/chat/Messages/CitationsModal.svelte @@ -90,8 +90,8 @@ class="hover:text-gray-500 hover:dark:text-gray-100 underline flex-grow" href={document?.metadata?.file_id ? `/api/v1/files/${document?.metadata?.file_id}/content${document?.metadata?.page !== undefined ? `#page=${document.metadata.page + 1}` : ''}` - : document.source.name.includes('http') - ? document.source.name + : document.source?.url?.includes('http') + ? document.source.url : `#`} target="_blank" >