diff --git a/src/lib/components/chat/MessageInput/Commands/Knowledge.svelte b/src/lib/components/chat/MessageInput/Commands/Knowledge.svelte index 81a3f43680..5f85e3c7ab 100644 --- a/src/lib/components/chat/MessageInput/Commands/Knowledge.svelte +++ b/src/lib/components/chat/MessageInput/Commands/Knowledge.svelte @@ -153,6 +153,7 @@ ...file, name: file?.meta?.name, description: `${file?.collection?.name} - ${file?.collection?.description}`, + knowledge: true, // DO NOT REMOVE, USED TO INDICATE KNOWLEDGE BASE FILE type: 'file' })) ] diff --git a/src/lib/components/common/FileItemModal.svelte b/src/lib/components/common/FileItemModal.svelte index abec68923c..0858fc87a0 100644 --- a/src/lib/components/common/FileItemModal.svelte +++ b/src/lib/components/common/FileItemModal.svelte @@ -112,6 +112,12 @@ Formatting may be inconsistent from source. {/if} + + {#if item?.knowledge} +
+ {$i18n.t('Knowledge Base')} +
+ {/if} {#if edit} @@ -172,9 +178,11 @@ /> {/if} -
- {item?.file?.data?.content ?? 'No content'} -
+ {#if item?.file?.data} +
+ {item?.file?.data?.content ?? 'No content'} +
+ {/if} {/if}