From 52a142da641f51eff9d535a6bea0fcec4250a792 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Sun, 10 Mar 2024 14:24:00 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20parse=20URL=20for=20Ollama=20end?= =?UTF-8?q?point?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/llm/llms/Ollama.ts | 8 ++++---- extensions/vscode/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/llm/llms/Ollama.ts b/core/llm/llms/Ollama.ts index caacf0a6c..8d88c1535 100644 --- a/core/llm/llms/Ollama.ts +++ b/core/llm/llms/Ollama.ts @@ -21,7 +21,7 @@ class Ollama extends BaseLLM { if (options.model === "AUTODETECT") { return; } - this.fetch(`${this.apiBase}/api/show`, { + this.fetch(new URL("api/show", this.apiBase), { method: "POST", headers: {}, body: JSON.stringify({ name: this._getModel() }), @@ -141,7 +141,7 @@ class Ollama extends BaseLLM { prompt: string, options: CompletionOptions, ): AsyncGenerator { - const response = await this.fetch(`${this.apiBase}/api/generate`, { + const response = await this.fetch(new URL("api/generate", this.apiBase), { method: "POST", headers: { "Content-Type": "application/json", @@ -180,7 +180,7 @@ class Ollama extends BaseLLM { messages: ChatMessage[], options: CompletionOptions, ): AsyncGenerator { - const response = await this.fetch(`${this.apiBase}/api/chat`, { + const response = await this.fetch(new URL("api/chat", this.apiBase), { method: "POST", headers: { "Content-Type": "application/json", @@ -218,7 +218,7 @@ class Ollama extends BaseLLM { } async listModels(): Promise { - const response = await this.fetch(`${this.apiBase}/api/tags`, { + const response = await this.fetch(new URL("api/tags", this.apiBase), { method: "GET", }); const data = await response.json(); diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 9a72705eb..8fd6c499b 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -1,7 +1,7 @@ { "name": "continue", "icon": "media/icon.png", - "version": "0.9.82", + "version": "0.9.83", "repository": { "type": "git", "url": "https://github.com/continuedev/continue"