feat: chat with notes

This commit is contained in:
Timothy Jaeryang Baek 2025-07-07 20:19:17 +04:00
parent b3001f95f6
commit a3c2018a4a
2 changed files with 18 additions and 3 deletions

View file

@ -86,6 +86,7 @@
versions: [],
files: null
},
// pages: [], // TODO: Implement pages for notes to allow users to create multiple pages in a note
meta: null,
access_control: null
};
@ -1034,7 +1035,7 @@ Provide the enhanced notes in markdown format. Use markdown syntax for headings,
</Pane>
<NotePanel bind:show={showPanel}>
{#if selectedPanel === 'chat'}
<Chat bind:show={showPanel} bind:selectedModelId bind:messages />
<Chat bind:show={showPanel} bind:selectedModelId bind:messages {files} {note} />
{:else if selectedPanel === 'settings'}
<Settings bind:show={showPanel} bind:selectedModelId />
{/if}

View file

@ -26,6 +26,8 @@
const i18n = getContext('i18n');
export let note = null;
export let files = [];
export let messages = [];
let loaded = false;
@ -33,7 +35,6 @@
let loading = false;
let stopResponseFlag = false;
let systemTextareaElement: HTMLTextAreaElement;
let messagesContainerElement: HTMLDivElement;
let system = '';
@ -93,7 +94,20 @@
}
: undefined,
...messages
].filter((message) => message)
].filter((message) => message),
files: [
{
id: `note:${note?.id ?? 'note'}`,
name: note?.name ?? 'Note',
file: {
data: {
content: note?.data?.content?.md ?? ''
}
},
context: 'full'
}, // Include the note content as a file
...files
]
},
`${WEBUI_BASE_URL}/api`
);