From 7b5c9075334ef4ef3b6711ec747480599bfc05f5 Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 1 Nov 2024 15:16:47 -0700 Subject: [PATCH] don't display Ollama warnings to users that haven't explicitly configured it --- .../vscode/src/util/loadAutocompleteModel.ts | 45 ------------------- 1 file changed, 45 deletions(-) diff --git a/extensions/vscode/src/util/loadAutocompleteModel.ts b/extensions/vscode/src/util/loadAutocompleteModel.ts index 9b86c7751..4d3484040 100644 --- a/extensions/vscode/src/util/loadAutocompleteModel.ts +++ b/extensions/vscode/src/util/loadAutocompleteModel.ts @@ -2,17 +2,12 @@ import type { ILLM } from "core"; import { ConfigHandler } from "core/config/ConfigHandler"; import Ollama from "core/llm/llms/Ollama"; import { GlobalContext } from "core/util/GlobalContext"; -import * as vscode from "vscode"; export class TabAutocompleteModel { private _llm: ILLM | undefined; private defaultTag = "starcoder2:3b"; - private defaultTagName = "Starcoder2 3b"; private globalContext: GlobalContext = new GlobalContext(); - private shownOllamaWarning = false; - private shownDeepseekWarning = false; - constructor(private configHandler: ConfigHandler) {} clearLlm() { @@ -27,49 +22,9 @@ export class TabAutocompleteModel { try { const models = await llm.listModels(); if (!models.includes(this.defaultTag)) { - if (!this.shownDeepseekWarning) { - vscode.window - .showWarningMessage( - `Your local Ollama instance doesn't yet have ${this.defaultTagName}. To download this model, run \`ollama run ${this.defaultTag}\` (recommended). If you'd like to use a custom model for tab autocomplete, learn more in the docs`, - "Documentation", - "Copy Command", - ) - .then((value) => { - if (value === "Documentation") { - vscode.env.openExternal( - vscode.Uri.parse( - "https://docs.continue.dev/features/tab-autocomplete", - ), - ); - } else if (value === "Copy Command") { - vscode.env.clipboard.writeText(`ollama run ${this.defaultTag}`); - } - }); - this.shownDeepseekWarning = true; - } return undefined; } } catch (e) { - if (!this.shownOllamaWarning) { - vscode.window - .showWarningMessage( - "Continue failed to connect to Ollama, which is used by default for tab-autocomplete. If you haven't downloaded it yet, you can do so at https://ollama.ai (recommended). If you'd like to use a custom model for tab autocomplete, learn more in the docs", - "Download Ollama", - "Documentation", - ) - .then((value) => { - if (value === "Documentation") { - vscode.env.openExternal( - vscode.Uri.parse( - "https://docs.continue.dev/features/tab-autocomplete", - ), - ); - } else if (value === "Download Ollama") { - vscode.env.openExternal(vscode.Uri.parse("https://ollama.ai")); - } - }); - this.shownOllamaWarning = true; - } return undefined; }