From 3effdef34aa1243e9b578d86afdd259d10b06202 Mon Sep 17 00:00:00 2001 From: "Laisky.Cai" Date: Wed, 12 Mar 2025 02:36:41 +0000 Subject: [PATCH] fix: synchronize custom channel updates with allModels relates #39 --- controller/model.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/controller/model.go b/controller/model.go index 6f016997..ba58ea77 100644 --- a/controller/model.go +++ b/controller/model.go @@ -48,6 +48,7 @@ type OpenAIModels struct { Parent *string `json:"parent"` } +// BUG: 更新 custom channel 时,应该同步更新所有自定义的 models 到 allModels var allModels []OpenAIModels var modelsMap map[string]OpenAIModels var channelId2Models map[int][]string @@ -177,8 +178,6 @@ func ListModels(c *gin.Context) { // Filter models that match user's abilities with EXACT model+channel matches userAvailableModels := make([]OpenAIModels, 0) - fmt.Println(allModels) - // Only include models that have a matching model+channel combination for _, model := range allModels { key := model.Id + ":" + model.OwnedBy