feat: close #2192 use /list/models to get model ids

This commit is contained in:
Yidadaa
2023-07-04 23:16:24 +08:00
parent f2d748cfe4
commit 4131fccbe0
12 changed files with 214 additions and 121 deletions

View File

@@ -3,7 +3,6 @@ import { persist } from "zustand/middleware";
import { DEFAULT_API_HOST, StoreKey } from "../constant";
import { getHeaders } from "../client/api";
import { BOT_HELLO } from "./chat";
import { ALL_MODELS } from "./config";
import { getClientConfig } from "../config/client";
export interface AccessControlStore {
@@ -76,14 +75,6 @@ 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;
}