From b8e3d0b97b02475947491c3756ea04d64f2f76b6 Mon Sep 17 00:00:00 2001 From: Nathan Hedge <23344786+10Nates@users.noreply.github.com> Date: Wed, 20 Dec 2023 03:37:23 -0600 Subject: [PATCH] removed unnecessary function --- src/extension.ts | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 8f69485..ac2bbd5 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -110,38 +110,6 @@ function activate(context: vscode.ExtensionContext) { context.subscriptions.push(disposable); } -// get a a completion from Ollama -async function autocomplete(document: vscode.TextDocument, position: vscode.Position, prompt: string) { - try { - // Make a request to the ollama.ai REST API - const response = await axios.post(apiEndpoint, { - model: apiModel, // Change this to the model you want to use - prompt: prompt, - stream: false, - system: apiSystemMessage, - options: { - num_predict: 10 - } - }); - // Get the completion from the response - const completion = response.data.response; - // Check if the completion is not empty - if (completion) { - return completion; - } else { - // Show a warning message - vscode.window.showWarningMessage("Ollama could not generate a completion for this prompt"); - console.log("Ollama could not generate a completion for this prompt"); - } - } catch (err: any) { - // Show an error message - vscode.window.showErrorMessage( - "Ollama encountered an error: " + err.message - ); - console.log("Ollama encountered an error: " + err.message); - } -} - // This method is called when your extension is deactivated function deactivate() { }