Merge remote-tracking branch 'upstream/main' into dev

# Conflicts:
#	.github/workflows/deploy_preview.yml
#	app/client/api.ts
#	app/client/platforms/google.ts
#	app/store/chat.ts
This commit is contained in:
sijinhui
2024-02-08 21:29:22 +08:00
18 changed files with 751 additions and 156 deletions

View File

@@ -1,3 +1,4 @@
"use client";
import {
ApiPath,
AZURE_MODELS,
@@ -46,7 +47,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("/")) {
@@ -60,6 +63,8 @@ export class ChatGPTApi implements LLMApi {
path = makeAzurePath(path, accessStore.azureApiVersion, azureModel);
}
console.log("[Proxy Endpoint] ", baseUrl, path);
return [baseUrl, path].join("/");
}