Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Hk-Gosuto
2024-02-09 08:23:26 +08:00
17 changed files with 665 additions and 144 deletions

View File

@@ -1,3 +1,4 @@
"use client";
import {
ApiPath,
DEFAULT_API_HOST,
@@ -53,7 +54,9 @@ export class ChatGPTApi implements LLMApi {
if (baseUrl.length === 0) {
const isApp = !!getClientConfig()?.isApp;
baseUrl = isApp ? DEFAULT_API_HOST : ApiPath.OpenAI;
baseUrl = isApp
? DEFAULT_API_HOST + "/proxy" + ApiPath.OpenAI
: ApiPath.OpenAI;
}
if (baseUrl.endsWith("/")) {
@@ -68,6 +71,8 @@ export class ChatGPTApi implements LLMApi {
return [baseUrl, model, path].join("/");
}
console.log("[Proxy Endpoint] ", baseUrl, path);
return [baseUrl, path].join("/");
}