forked from open-webui/open-webui
fix: chat general
This commit is contained in:
parent
cb93038abf
commit
092884fec5
4 changed files with 20 additions and 6 deletions
|
@ -109,10 +109,14 @@
|
|||
await Promise.all(
|
||||
selectedModels.map(async (model) => {
|
||||
console.log(model);
|
||||
if ($models.filter((m) => m.name === model)[0].external) {
|
||||
const modelTag = $models.filter((m) => m.name === model).at(0);
|
||||
|
||||
if (modelTag?.external) {
|
||||
await sendPromptOpenAI(model, prompt, parentId, _chatId);
|
||||
} else {
|
||||
} else if (modelTag) {
|
||||
await sendPromptOllama(model, prompt, parentId, _chatId);
|
||||
} else {
|
||||
toast.error(`Model ${model} not found`);
|
||||
}
|
||||
})
|
||||
);
|
||||
|
|
|
@ -136,17 +136,20 @@
|
|||
await Promise.all(
|
||||
selectedModels.map(async (model) => {
|
||||
console.log(model);
|
||||
if ($models.filter((m) => m.name === model)[0].external) {
|
||||
const modelTag = $models.filter((m) => m.name === model).at(0);
|
||||
|
||||
if (modelTag?.external) {
|
||||
await sendPromptOpenAI(model, prompt, parentId, _chatId);
|
||||
} else {
|
||||
} else if (modelTag) {
|
||||
await sendPromptOllama(model, prompt, parentId, _chatId);
|
||||
} else {
|
||||
toast.error(`Model ${model} not found`);
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
await chats.set(await getChatList(localStorage.token));
|
||||
};
|
||||
|
||||
const sendPromptOllama = async (model, userPrompt, parentId, _chatId) => {
|
||||
// Create response message
|
||||
let responseMessageId = uuidv4();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue