Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
72675ec1
Commit
72675ec1
authored
May 07, 2024
by
Timothy J. Baek
Browse files
refac: citation styling
parent
1ea91f90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
src/lib/components/chat/Messages/ResponseMessage.svelte
src/lib/components/chat/Messages/ResponseMessage.svelte
+8
-9
No files found.
src/lib/components/chat/Messages/ResponseMessage.svelte
View file @
72675ec1
...
@@ -444,12 +444,10 @@
...
@@ -444,12 +444,10 @@
})}
})}
{/if}
{/if}
{/each}
{/each}
<!-- {@html marked(message.content.replaceAll('\\', '\\\\'))} -->
{/if}
{/if}
{#if message.citations}
{#if message.citations}
<hr class=" dark:border-gray-800 my-1" />
<div class="mt-1 mb-2 w-full flex gap-1 items-center">
<div class="my-2.5 w-full flex flex-col gap-1">
{#each message.citations.reduce((acc, citation) => {
{#each message.citations.reduce((acc, citation) => {
citation.document.forEach((document, index) => {
citation.document.forEach((document, index) => {
const metadata = citation.metadata?.[index];
const metadata = citation.metadata?.[index];
...
@@ -467,18 +465,19 @@
...
@@ -467,18 +465,19 @@
return acc;
return acc;
}, []) as citation, idx}
}, []) as citation, idx}
<div class="flex gap-1 text-xs font-semibold">
<div class="flex gap-1 text-xs font-semibold">
<div>
[{idx + 1}]
</div>
<button
<button
class="dark:text-gray-
500 underline
"
class="
flex
dark:text-gray-
300 py-0.5 px-0.5 bg-gray-50 hover:bg-gray-100 dark:bg-gray-850 dark:hover:bg-gray-800 transition rounded-xl
"
on:click={() => {
on:click={() => {
showCitationModal = true;
showCitationModal = true;
selectedCitation = citation;
selectedCitation = citation;
}}
}}
>
>
{citation.source.name}
<div class="bg-white dark:bg-gray-700 rounded-full size-4 mr-1.5">
{idx + 1}
</div>
<div class=" mr-1.5">
{citation.source.name}
</div>
</button>
</button>
</div>
</div>
{/each}
{/each}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment