mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-23 17:26:47 +08:00
Squashed commit of the following:
commite6b72ac1ffAuthor: Yifei Zhang <yidadaa@qq.com> Date: Fri Nov 10 02:59:47 2023 +0800 Update README.md commit8032e6d68dAuthor: Yifei Zhang <yidadaa@qq.com> Date: Fri Nov 10 02:59:30 2023 +0800 Update README.md commitc7e0a6f37fAuthor: Yidadaa <yidadaa@qq.com> Date: Fri Nov 10 02:57:40 2023 +0800 doc: update azure env vars commit1141cd2e6eMerge:fd2f441c9dd953Author: Yifei Zhang <yidadaa@qq.com> Date: Fri Nov 10 02:55:12 2023 +0800 Merge pull request #3206 from Yidadaa/azure commitc9dd953817Author: Yidadaa <yidadaa@qq.com> Date: Fri Nov 10 02:50:50 2023 +0800 fixup commitb7ffca031eAuthor: Yidadaa <yidadaa@qq.com> Date: Fri Nov 10 02:43:30 2023 +0800 feat: close #935 add azure support commitfd2f441e02Author: Yifei Zhang <yidadaa@qq.com> Date: Thu Nov 9 20:45:25 2023 +0800 feat: wont send max_tokens
This commit is contained in:
@@ -4,11 +4,20 @@ import { DEFAULT_MODELS } from "../constant";
|
||||
declare global {
|
||||
namespace NodeJS {
|
||||
interface ProcessEnv {
|
||||
PROXY_URL?: string; // docker only
|
||||
|
||||
OPENAI_API_KEY?: string;
|
||||
CODE?: string;
|
||||
|
||||
BASE_URL?: string;
|
||||
OPENAI_ORG_ID?: string; // openai only
|
||||
|
||||
VERCEL?: string;
|
||||
BUILD_MODE?: "standalone" | "export";
|
||||
BUILD_APP?: string; // is building desktop app
|
||||
|
||||
PROXY_URL?: string;
|
||||
OPENAI_ORG_ID?: string;
|
||||
|
||||
HIDE_USER_API_KEY?: string; // disable user's api key input
|
||||
DISABLE_GPT4?: string; // allow user to use gpt-4 or not
|
||||
BUILD_MODE?: "standalone" | "export";
|
||||
@@ -16,6 +25,11 @@ declare global {
|
||||
ENABLE_BALANCE_QUERY?: string; // allow user to query balance or not
|
||||
DISABLE_FAST_LINK?: string; // disallow parse settings from url or not
|
||||
CUSTOM_MODELS?: string; // to control custom models
|
||||
|
||||
// azure only
|
||||
AZURE_URL?: string; // https://{azure-url}/openai/deployments/{deploy-name}
|
||||
AZURE_API_KEY?: string;
|
||||
AZURE_API_VERSION?: string;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,7 +54,7 @@ export const getServerSideConfig = () => {
|
||||
);
|
||||
}
|
||||
|
||||
let disableGPT4 = !!process.env.DISABLE_GPT4;
|
||||
const disableGPT4 = !!process.env.DISABLE_GPT4;
|
||||
let customModels = process.env.CUSTOM_MODELS ?? "";
|
||||
|
||||
if (disableGPT4) {
|
||||
@@ -50,15 +64,25 @@ export const getServerSideConfig = () => {
|
||||
.join(",");
|
||||
}
|
||||
|
||||
const isAzure = !!process.env.AZURE_URL;
|
||||
|
||||
return {
|
||||
baseUrl: process.env.BASE_URL,
|
||||
apiKey: process.env.OPENAI_API_KEY,
|
||||
openaiOrgId: process.env.OPENAI_ORG_ID,
|
||||
|
||||
isAzure,
|
||||
azureUrl: process.env.AZURE_URL,
|
||||
azureApiKey: process.env.AZURE_API_KEY,
|
||||
azureApiVersion: process.env.AZURE_API_VERSION,
|
||||
|
||||
needCode: ACCESS_CODES.size > 0,
|
||||
code: process.env.CODE,
|
||||
codes: ACCESS_CODES,
|
||||
needCode: ACCESS_CODES.size > 0,
|
||||
baseUrl: process.env.BASE_URL,
|
||||
|
||||
proxyUrl: process.env.PROXY_URL,
|
||||
openaiOrgId: process.env.OPENAI_ORG_ID,
|
||||
isVercel: !!process.env.VERCEL,
|
||||
|
||||
hideUserApiKey: !!process.env.HIDE_USER_API_KEY,
|
||||
disableGPT4,
|
||||
hideBalanceQuery: !process.env.ENABLE_BALANCE_QUERY,
|
||||
|
||||
Reference in New Issue
Block a user