MCPcopy Create free account
hub / github.com/alibaba/open-code-review / parseModelListValue

Function parseModelListValue

cmd/opencodereview/config_cmd.go:724–739  ·  view source on GitHub ↗
(value string)

Source from the content-addressed store, hash-verified

722}
723
724func parseModelListValue(value string) ([]string, error) {
725 value = strings.TrimSpace(value)
726 if value == "" {
727 return nil, nil
728 }
729
730 if strings.HasPrefix(value, "[") {
731 var models []string
732 if err := json.Unmarshal([]byte(value), &models); err == nil {
733 return normalizeModelList(models), nil
734 }
735 value = strings.TrimSpace(strings.TrimSuffix(strings.TrimPrefix(value, "["), "]"))
736 }
737
738 return normalizeModelList(strings.Split(value, ",")), nil
739}
740
741func activeModelForProvider(cfg *Config, providerName string, entry ProviderEntry) string {
742 if entry.Model != "" {

Callers 2

TestParseModelListValueFunction · 0.85
applyProviderFieldFunction · 0.85

Calls 1

normalizeModelListFunction · 0.85

Tested by 1

TestParseModelListValueFunction · 0.68