Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Hk-Gosuto
2024-04-12 12:18:38 +08:00
31 changed files with 1146 additions and 61 deletions

View File

@@ -69,6 +69,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 apiKeyEnvVar = process.env.OPENAI_API_KEY ?? "";
const apiKeys = apiKeyEnvVar.split(",").map((v) => v.trim());
@@ -78,6 +79,10 @@ export const getServerSideConfig = () => {
`[Server Config] using ${randomIndex + 1} of ${apiKeys.length} api key`,
);
const whiteWebDevEndpoints = (process.env.WHITE_WEBDEV_ENDPOINTS ?? "").split(
",",
);
return {
baseUrl: process.env.BASE_URL,
apiKey,
@@ -92,6 +97,11 @@ export const getServerSideConfig = () => {
googleApiKey: process.env.GOOGLE_API_KEY,
googleUrl: process.env.GEMINI_BASE_URL ?? process.env.GOOGLE_URL,
isAnthropic,
anthropicApiKey: process.env.ANTHROPIC_API_KEY,
anthropicApiVersion: process.env.ANTHROPIC_API_VERSION,
anthropicUrl: process.env.ANTHROPIC_URL,
gtmId: process.env.GTM_ID,
needCode: ACCESS_CODES.size > 0,
@@ -107,6 +117,8 @@ export const getServerSideConfig = () => {
disableFastLink: !!process.env.DISABLE_FAST_LINK,
customModels,
whiteWebDevEndpoints,
isStoreFileToLocal:
!!process.env.NEXT_PUBLIC_ENABLE_NODEJS_PLUGIN &&
!process.env.R2_ACCOUNT_ID &&