Merge branch 'ChatGPTNextWeb:feat-multi-models' into feat-multi-models

This commit is contained in:
brett 2024-04-08 14:16:27 +08:00 committed by GitHub
commit da0ca997c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View File

@ -80,7 +80,7 @@ export const preferredRegion = [
const serverConfig = getServerSideConfig(); const serverConfig = getServerSideConfig();
export async function request(req: NextRequest) { async function request(req: NextRequest) {
const controller = new AbortController(); const controller = new AbortController();
let authHeaderName = "x-api-key"; let authHeaderName = "x-api-key";

View File

@ -356,7 +356,7 @@ export class ClaudeApi implements LLMApi {
const isApp = !!getClientConfig()?.isApp; const isApp = !!getClientConfig()?.isApp;
baseUrl = isApp baseUrl = isApp
? DEFAULT_API_HOST + "/api/proxy" + ApiPath.Anthropic ? DEFAULT_API_HOST + "/api/proxy/anthropic"
: ApiPath.Anthropic; : ApiPath.Anthropic;
} }

View File

@ -77,6 +77,10 @@ if (mode !== "export") {
source: "/api/proxy/openai/:path*", source: "/api/proxy/openai/:path*",
destination: "https://api.openai.com/:path*", destination: "https://api.openai.com/:path*",
}, },
{
source: "/api/proxy/anthropic/:path*",
destination: "https://api.anthropic.com/:path*",
},
{ {
source: "/google-fonts/:path*", source: "/google-fonts/:path*",
destination: "https://fonts.googleapis.com/:path*", destination: "https://fonts.googleapis.com/:path*",