diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte
index 55683329..1468310d 100644
--- a/src/lib/components/chat/MessageInput.svelte
+++ b/src/lib/components/chat/MessageInput.svelte
@@ -298,7 +298,7 @@
id="chat-textarea"
class=" dark:bg-gray-800 dark:text-gray-100 outline-none w-full py-3 px-2 {fileUploadEnabled
? ''
- : ' pl-4'} rounded-xl resize-none"
+ : ' pl-4'} rounded-xl resize-none h-[48px]"
placeholder={speechRecognitionListening ? 'Listening...' : 'Send a message'}
bind:value={prompt}
on:keypress={(e) => {
diff --git a/src/lib/components/chat/ModelSelector.svelte b/src/lib/components/chat/ModelSelector.svelte
index b4a0f47c..9e7ff4dd 100644
--- a/src/lib/components/chat/ModelSelector.svelte
+++ b/src/lib/components/chat/ModelSelector.svelte
@@ -1,5 +1,6 @@
diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte
index b62a9caa..4e3347ff 100644
--- a/src/routes/(app)/+page.svelte
+++ b/src/routes/(app)/+page.svelte
@@ -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`);
}
})
);
diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte
index 48bc86ca..62c271bf 100644
--- a/src/routes/(app)/c/[id]/+page.svelte
+++ b/src/routes/(app)/c/[id]/+page.svelte
@@ -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();