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

Function parseModelListValue

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

Source from the content-addressed store, hash-verified

626}
627
628func parseModelListValue(value string) ([]string, error) {
629 value = strings.TrimSpace(value)
630 if value == "" {
631 return nil, nil
632 }
633
634 if strings.HasPrefix(value, "[") {
635 var models []string
636 if err := json.Unmarshal([]byte(value), &models); err == nil {
637 return normalizeModelList(models), nil
638 }
639 value = strings.TrimSpace(strings.TrimSuffix(strings.TrimPrefix(value, "["), "]"))
640 }
641
642 return normalizeModelList(strings.Split(value, ",")), nil
643}
644
645func activeModelForProvider(cfg *Config, providerName string, entry ProviderEntry) string {
646 if entry.Model != "" {

Callers 2

TestParseModelListValueFunction · 0.85
applyProviderFieldFunction · 0.85

Calls 1

normalizeModelListFunction · 0.85

Tested by 1

TestParseModelListValueFunction · 0.68