🚑 fix constant warnings when onboarding with Ollama

This commit is contained in:
Nate Sesti 2024-06-21 11:04:44 -07:00
parent 8d7b7604cc
commit 24d02e8404

View file

@ -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;
}