mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-13 20:53:45 +08:00
fix: allow isVisionModel function read runtime env var VISION_MODELS
This commit is contained in:
@@ -21,6 +21,7 @@ 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
|
||||
VISION_MODELS?: string; // to control vision models
|
||||
DEFAULT_MODEL?: string; // to control default model in every new chat window
|
||||
|
||||
// stability only
|
||||
@@ -123,13 +124,16 @@ export const getServerSideConfig = () => {
|
||||
|
||||
const disableGPT4 = !!process.env.DISABLE_GPT4;
|
||||
let customModels = process.env.CUSTOM_MODELS ?? "";
|
||||
let visionModels = process.env.VISION_MODELS ?? "";
|
||||
let defaultModel = process.env.DEFAULT_MODEL ?? "";
|
||||
|
||||
if (disableGPT4) {
|
||||
if (customModels) customModels += ",";
|
||||
customModels += DEFAULT_MODELS.filter(
|
||||
(m) =>
|
||||
(m.name.startsWith("gpt-4") || m.name.startsWith("chatgpt-4o") || m.name.startsWith("o1")) &&
|
||||
(m.name.startsWith("gpt-4") ||
|
||||
m.name.startsWith("chatgpt-4o") ||
|
||||
m.name.startsWith("o1")) &&
|
||||
!m.name.startsWith("gpt-4o-mini"),
|
||||
)
|
||||
.map((m) => "-" + m.name)
|
||||
@@ -247,6 +251,7 @@ export const getServerSideConfig = () => {
|
||||
hideBalanceQuery: !process.env.ENABLE_BALANCE_QUERY,
|
||||
disableFastLink: !!process.env.DISABLE_FAST_LINK,
|
||||
customModels,
|
||||
visionModels,
|
||||
defaultModel,
|
||||
allowedWebDavEndpoints,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user