From 66f53debf113d0996795f0fe61375cc29c70021f Mon Sep 17 00:00:00 2001 From: Fred Bricon Date: Thu, 9 Jan 2025 16:48:06 +0100 Subject: [PATCH] Simplify Ollama error messages Signed-off-by: Fred Bricon --- core/llm/index.ts | 4 ++-- extensions/vscode/src/autocomplete/completionProvider.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/llm/index.ts b/core/llm/index.ts index 4608c9bda..0b48d867c 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -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); } diff --git a/extensions/vscode/src/autocomplete/completionProvider.ts b/extensions/vscode/src/autocomplete/completionProvider.ts index 3d86f64aa..3fe832d3a 100644 --- a/extensions/vscode/src/autocomplete/completionProvider.ts +++ b/extensions/vscode/src/autocomplete/completionProvider.ts @@ -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 }