mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 06:57:33 +08:00
add function to check model is available
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { DEFAULT_MODELS } from "../constant";
|
||||
import { LLMModel } from "../client/api";
|
||||
|
||||
const customProvider = (modelName: string) => ({
|
||||
@@ -100,3 +101,8 @@ export function collectModelsWithDefaultModel(
|
||||
const allModels = Object.values(modelTable);
|
||||
return allModels;
|
||||
}
|
||||
|
||||
export function isModelAvailableInServer(customModels, modelName) {
|
||||
const modelTable = collectModelTable(DEFAULT_MODELS, customModels);
|
||||
return modelTable[modelName ?? ""].available === false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user