|
@@ -2,6 +2,7 @@ import { create } from "zustand";
|
|
|
import { persist } from "zustand/middleware";
|
|
|
import { StoreKey } from "../constant";
|
|
|
import { BOT_HELLO } from "./chat";
|
|
|
+import { ALL_MODELS } from "./config";
|
|
|
|
|
|
export interface AccessControlStore {
|
|
|
accessCode: string;
|
|
@@ -60,6 +61,14 @@ export const useAccessStore = create<AccessControlStore>()(
|
|
|
console.log("[Config] got config from server", res);
|
|
|
set(() => ({ ...res }));
|
|
|
|
|
|
+ if (!res.enableGPT4) {
|
|
|
+ ALL_MODELS.forEach((model) => {
|
|
|
+ if (model.name.startsWith("gpt-4")) {
|
|
|
+ (model as any).available = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
if ((res as any).botHello) {
|
|
|
BOT_HELLO.content = (res as any).botHello;
|
|
|
}
|