From 24d02e8404bcd9158dee3737cfedc585d3152a19 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Fri, 21 Jun 2024 11:04:44 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=20fix=20constant=20warnings=20when?= =?UTF-8?q?=20onboarding=20with=20Ollama?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/core.ts b/core/core.ts index d78a6fb21..87af833f5 100644 --- a/core/core.ts +++ b/core/core.ts @@ -368,7 +368,13 @@ export class Core { return model.listModels(); } else { if (msg.data.title === "Ollama") { - return new Ollama({ model: "" }).listModels(); + try { + const models = await new Ollama({ model: "" }).listModels(); + return models; + } catch (e) { + console.warn(`Error listing Ollama models: ${e}`); + return undefined; + } } else { return undefined; }