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

# Conflicts:
#	app/components/settings.tsx
#	app/config/server.ts
#	app/constant.ts
#	package.json
#	yarn.lock
This commit is contained in:
sijinhui
2024-08-02 17:14:45 +08:00
12 changed files with 668 additions and 13 deletions

View File

@@ -59,6 +59,11 @@ declare global {
ALIBABA_URL?: string;
ALIBABA_API_KEY?: string;
// tencent only
TENCENT_URL?: string;
TENCENT_SECRET_KEY?: string;
TENCENT_SECRET_ID?: string;
// moonshot only
MOONSHOT_URL?: string;
MOONSHOT_API_KEY?: string;
@@ -122,6 +127,7 @@ export const getServerSideConfig = () => {
const isAzure = !!process.env.AZURE_URL;
const isGoogle = !!process.env.GOOGLE_API_KEY;
const isAnthropic = !!process.env.ANTHROPIC_API_KEY;
const isTencent = !!process.env.TENCENT_API_KEY;
// 需要一个函数来判断请求中模型是否为微软的。
// 当前逻辑gpt-4-32k模型为微软别的不是
// const isAzure = !!process.env.AZURE_URL;
@@ -181,6 +187,11 @@ export const getServerSideConfig = () => {
alibabaUrl: process.env.ALIBABA_URL,
alibabaApiKey: getApiKey(process.env.ALIBABA_API_KEY),
isTencent,
tencentUrl: process.env.TENCENT_URL,
tencentSecretKey: getApiKey(process.env.TENCENT_SECRET_KEY),
tencentSecretId: process.env.TENCENT_SECRET_ID,
isMoonshot,
moonshotUrl: process.env.MOONSHOT_URL,
moonshotApiKey: getApiKey(process.env.MOONSHOT_API_KEY),