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`