From 908f504885fda8dc5a0f5ce18ff6de2ec7528362 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sun, 9 Nov 2025 20:39:05 -0500 Subject: [PATCH] refac --- src/lib/components/notes/NoteEditor/Chat.svelte | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/lib/components/notes/NoteEditor/Chat.svelte b/src/lib/components/notes/NoteEditor/Chat.svelte index 4635df31bf..2430f602e1 100644 --- a/src/lib/components/notes/NoteEditor/Chat.svelte +++ b/src/lib/components/notes/NoteEditor/Chat.svelte @@ -35,12 +35,7 @@ import { goto } from '$app/navigation'; import { onMount, tick, getContext } from 'svelte'; - import { - OLLAMA_API_BASE_URL, - OPENAI_API_BASE_URL, - WEBUI_API_BASE_URL, - WEBUI_BASE_URL - } from '$lib/constants'; + import { WEBUI_BASE_URL } from '$lib/constants'; import { WEBUI_NAME, config, user, models, settings } from '$lib/stores'; import { chatCompletion } from '$lib/apis/openai'; @@ -189,7 +184,10 @@ Based on the user's instruction, update and enhance the existing notes or select { model: model.id, stream: true, - messages: chatMessages + messages: chatMessages.map((m) => ({ + role: m.role, + content: m.content + })) // ...(files && files.length > 0 ? { files } : {}) // TODO: Decide whether to use native file handling or not }, `${WEBUI_BASE_URL}/api`