MCPcopy
hub / github.com/QuantumNous/new-api / normalizeModelNames

Function normalizeModelNames

controller/channel_upstream_update.go:93–98  ·  view source on GitHub ↗
(models []string)

Source from the content-addressed store, hash-verified

91}
92
93func normalizeModelNames(models []string) []string {
94 return lo.Uniq(lo.FilterMap(models, func(model string, _ int) (string, bool) {
95 trimmed := strings.TrimSpace(model)
96 return trimmed, trimmed != ""
97 }))
98}
99
100func mergeModelNames(base []string, appended []string) []string {
101 merged := normalizeModelNames(base)

Calls

no outgoing calls

Tested by 1

TestNormalizeModelNamesFunction · 0.68