mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-11 11:43:42 +08:00
Merge 69fcb92a3b into c3b8c1587c
This commit is contained in:
@@ -76,6 +76,7 @@ export function collectModelTable(
|
||||
// server custom models
|
||||
customModels
|
||||
.split(",")
|
||||
.map((v) => v.trim())
|
||||
.filter((v) => !!v && v.length > 0)
|
||||
.forEach((m) => {
|
||||
const available = !m.startsWith("-");
|
||||
@@ -88,6 +89,13 @@ export function collectModelTable(
|
||||
Object.values(modelTable).forEach(
|
||||
(model) => (model.available = available),
|
||||
);
|
||||
} else if (name.startsWith("*")) {
|
||||
const modelId = name.substring(1).toLowerCase();
|
||||
Object.values(modelTable).forEach((model) => {
|
||||
if (model?.provider?.id === modelId) {
|
||||
model.available = available;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 1. find model by name, and set available value
|
||||
const [customModelName, customProviderName] = getModelProvider(name);
|
||||
|
||||
Reference in New Issue
Block a user