Simplify Ollama error messages

Signed-off-by: Fred Bricon <fbricon@gmail.com>
This commit is contained in:
Fred Bricon 2025-01-09 16:48:06 +01:00
parent 4b45666262
commit 66f53debf1
2 changed files with 4 additions and 4 deletions

View file

@ -416,8 +416,8 @@ export abstract class BaseLLM implements ILLM {
e.message.includes("http://127.0.0.1:11434")
) {
const message = (await isOllamaInstalled()) ?
"Failed to connect to local Ollama instance. Ollama appears to be stopped. It needs to be running." :
"Failed to connect to local Ollama instance, please ensure Ollama is both installed and running. You can download Ollama from https://ollama.ai."
"Unable to connect to local Ollama instance. Ollama may not be running." :
"Unable to connect to local Ollama instance. Ollama may not be installed or may not running."
;
throw new Error(message);
}

View file

@ -43,9 +43,9 @@ export class ContinueCompletionProvider
{
private onError(e: any) {
const options = ["Documentation"];
if (e.message.includes("https://ollama.ai")) {
if (e.message.includes("Ollama may not be installed")) {
options.push("Download Ollama");
} else if (e.message.includes("Ollama appears to be stopped")) {
} else if (e.message.includes("Ollama may not be running")) {
options.unshift("Start Ollama"); // We want "Start" to be the default choice
}