Update openai_comp.js
Allow path other than v1
This commit is contained in:
parent
c4279ddd94
commit
6ffcba5c0e
1 changed files with 3 additions and 3 deletions
|
|
@ -40,7 +40,7 @@ export class OpenAIComp {
|
||||||
};
|
};
|
||||||
if(this.apiKey !== '') curr_headers["Authorization"] = "Bearer "+ this.apiKey;
|
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",
|
method: "GET",
|
||||||
headers: curr_headers,
|
headers: curr_headers,
|
||||||
});
|
});
|
||||||
|
|
@ -70,7 +70,7 @@ export class OpenAIComp {
|
||||||
if(this.apiKey !== '') curr_headers["Authorization"] = "Bearer "+ this.apiKey;
|
if(this.apiKey !== '') curr_headers["Authorization"] = "Bearer "+ this.apiKey;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(this.host + "/v1/chat/completions", {
|
const response = await fetch(this.host + "/chat/completions", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: curr_headers,
|
headers: curr_headers,
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue