mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
feat: chat responses using the citations-disabled model to exclude source citations
This commit is contained in:
parent
3f3a5bb0ab
commit
9d06e3b2cd
@ -120,6 +120,11 @@
|
|||||||
sourceIds={(sources ?? []).reduce((acc, s) => {
|
sourceIds={(sources ?? []).reduce((acc, s) => {
|
||||||
let ids = [];
|
let ids = [];
|
||||||
s.document.forEach((document, index) => {
|
s.document.forEach((document, index) => {
|
||||||
|
if (model?.info?.meta?.capabilities?.citations == false) {
|
||||||
|
ids.push('N/A');
|
||||||
|
return ids;
|
||||||
|
}
|
||||||
|
|
||||||
const metadata = s.metadata?.[index];
|
const metadata = s.metadata?.[index];
|
||||||
const id = metadata?.source ?? 'N/A';
|
const id = metadata?.source ?? 'N/A';
|
||||||
|
|
||||||
|
@ -35,13 +35,15 @@
|
|||||||
$: attributes = extractAttributes(token.text);
|
$: attributes = extractAttributes(token.text);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button
|
{#if attributes.title !== 'N/A'}
|
||||||
class="text-xs font-medium w-fit translate-y-[2px] px-2 py-0.5 dark:bg-white/5 dark:text-white/60 dark:hover:text-white bg-gray-50 text-black/60 hover:text-black transition rounded-lg"
|
<button
|
||||||
on:click={() => {
|
class="text-xs font-medium w-fit translate-y-[2px] px-2 py-0.5 dark:bg-white/5 dark:text-white/60 dark:hover:text-white bg-gray-50 text-black/60 hover:text-black transition rounded-lg"
|
||||||
onClick(attributes.data);
|
on:click={() => {
|
||||||
}}
|
onClick(attributes.data);
|
||||||
>
|
}}
|
||||||
<span class="line-clamp-1">
|
>
|
||||||
{formattedTitle(attributes.title)}
|
<span class="line-clamp-1">
|
||||||
</span>
|
{formattedTitle(attributes.title)}
|
||||||
</button>
|
</span>
|
||||||
|
</button>
|
||||||
|
{/if}
|
||||||
|
Loading…
Reference in New Issue
Block a user