From 6ffcba5c0e1129ed4e351fcc7bbfbb0774c94a7a Mon Sep 17 00:00:00 2001 From: kcrkor Date: Mon, 14 Oct 2024 21:50:35 +0100 Subject: [PATCH] Update openai_comp.js Allow path other than v1 --- js/api/openai_comp.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/api/openai_comp.js b/js/api/openai_comp.js index 0b5fefe2..903bb790 100644 --- a/js/api/openai_comp.js +++ b/js/api/openai_comp.js @@ -40,7 +40,7 @@ export class OpenAIComp { }; if(this.apiKey !== '') curr_headers["Authorization"] = "Bearer "+ this.apiKey; - const response = await fetch(this.host + "/v1/models", { + const response = await fetch(this.host + "/models", { method: "GET", headers: curr_headers, }); @@ -70,7 +70,7 @@ export class OpenAIComp { if(this.apiKey !== '') curr_headers["Authorization"] = "Bearer "+ this.apiKey; try { - const response = await fetch(this.host + "/v1/chat/completions", { + const response = await fetch(this.host + "/chat/completions", { method: "POST", headers: curr_headers, body: JSON.stringify({ @@ -91,4 +91,4 @@ export class OpenAIComp { } } -} \ No newline at end of file +}