removed unnecessary function

This commit is contained in:
Nathan Hedge 2023-12-20 03:37:23 -06:00
parent 6d3677c72b
commit b8e3d0b97b
No known key found for this signature in database
GPG Key ID: 1ADBA36D6E304C5C
1 changed files with 0 additions and 32 deletions

View File

@ -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() { }