Download setting/auto_group.go from AZILS/new-api: direct link, hf CLI and curl.
- Browser
- Download file 648 Bytes
-
https://huggingface.co/spaces/AZILS/new-api/resolve/main/setting/auto_group.go
- Command line
-
hf download hf://spaces/AZILS/new-api/setting/auto_group.go
-
curl -L -o auto_group.go https://huggingface.co/spaces/AZILS/new-api/resolve/main/setting/auto_group.go
648 Bytes
| package setting | |
| import ( | |
| "github.com/QuantumNous/new-api/common" | |
| ) | |
| var autoGroups = []string{ | |
| "default", | |
| } | |
| var DefaultUseAutoGroup = false | |
| func ContainsAutoGroup(group string) bool { | |
| for _, autoGroup := range autoGroups { | |
| if autoGroup == group { | |
| return true | |
| } | |
| } | |
| return false | |
| } | |
| func UpdateAutoGroupsByJsonString(jsonString string) error { | |
| autoGroups = make([]string, 0) | |
| return common.Unmarshal([]byte(jsonString), &autoGroups) | |
| } | |
| func AutoGroups2JsonString() string { | |
| jsonBytes, err := common.Marshal(autoGroups) | |
| if err != nil { | |
| return "[]" | |
| } | |
| return string(jsonBytes) | |
| } | |
| func GetAutoGroups() []string { | |
| return autoGroups | |
| } | |