feat: multimodal support prep

This commit is contained in:
Timothy J. Baek 2023-11-25 00:21:07 -08:00
parent 78e93ab726
commit e70cff67c2
4 changed files with 117 additions and 38 deletions

View file

@ -21,6 +21,7 @@
let title = '';
let prompt = '';
let files = [];
let messages = [];
let history = {
@ -358,7 +359,8 @@
parentId: messages.length !== 0 ? messages.at(-1).id : null,
childrenIds: [],
role: 'user',
content: userPrompt
content: userPrompt,
files: files.length > 0 ? files : undefined
};
if (messages.length !== 0) {
@ -369,6 +371,7 @@
history.currentId = userMessageId;
prompt = '';
files = [];
if (messages.length == 0) {
await $db.createNewChat({
@ -477,5 +480,5 @@
</div>
</div>
<MessageInput bind:prompt bind:autoScroll {messages} {submitPrompt} {stopResponse} />
<MessageInput bind:prompt bind:files bind:autoScroll {messages} {submitPrompt} {stopResponse} />
</div>