fix(playground): resolve auto group model listing (#6163)
* fix(playground): resolve auto group model listing - merge and deduplicate available models in configured auto group order. - reuse special usable group rules and add model filtering regression coverage. * refactor: extract GetGroupsEnabledModels to dedupe group model expansion
This commit is contained in:
+1
-13
@@ -245,19 +245,7 @@ func ListModels(c *gin.Context, modelType int) {
|
||||
userModelNames = append(userModelNames, allowModel)
|
||||
}
|
||||
} else {
|
||||
var models []string
|
||||
if groups.tokenGroup == "auto" {
|
||||
for _, autoGroup := range ownerGroups {
|
||||
groupModels := model.GetGroupEnabledModels(autoGroup)
|
||||
for _, g := range groupModels {
|
||||
if !common.StringsContains(models, g) {
|
||||
models = append(models, g)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
models = model.GetGroupEnabledModels(ownerGroups[0])
|
||||
}
|
||||
models := service.GetGroupsEnabledModels(ownerGroups)
|
||||
for _, modelName := range models {
|
||||
if !acceptUnsetRatioModel {
|
||||
if !helper.HasModelBillingConfig(modelName) {
|
||||
|
||||
Reference in New Issue
Block a user