mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 11:57:51 +01:00
refac
This commit is contained in:
@@ -35,12 +35,7 @@
|
|||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { onMount, tick, getContext } from 'svelte';
|
import { onMount, tick, getContext } from 'svelte';
|
||||||
|
|
||||||
import {
|
import { WEBUI_BASE_URL } from '$lib/constants';
|
||||||
OLLAMA_API_BASE_URL,
|
|
||||||
OPENAI_API_BASE_URL,
|
|
||||||
WEBUI_API_BASE_URL,
|
|
||||||
WEBUI_BASE_URL
|
|
||||||
} from '$lib/constants';
|
|
||||||
import { WEBUI_NAME, config, user, models, settings } from '$lib/stores';
|
import { WEBUI_NAME, config, user, models, settings } from '$lib/stores';
|
||||||
|
|
||||||
import { chatCompletion } from '$lib/apis/openai';
|
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,
|
model: model.id,
|
||||||
stream: true,
|
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
|
// ...(files && files.length > 0 ? { files } : {}) // TODO: Decide whether to use native file handling or not
|
||||||
},
|
},
|
||||||
`${WEBUI_BASE_URL}/api`
|
`${WEBUI_BASE_URL}/api`
|
||||||
|
|||||||
Reference in New Issue
Block a user