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

Function parseModelListValue

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

Source from the content-addressed store, hash-verified

527}
528
529func parseModelListValue(value string) ([]string, error) {
530 value = strings.TrimSpace(value)
531 if value == "" {
532 return nil, nil
533 }
534
535 if strings.HasPrefix(value, "[") {
536 var models []string
537 if err := json.Unmarshal([]byte(value), &models); err == nil {
538 return normalizeModelList(models), nil
539 }
540 value = strings.TrimSpace(strings.TrimSuffix(strings.TrimPrefix(value, "["), "]"))
541 }
542
543 return normalizeModelList(strings.Split(value, ",")), nil
544}
545
546func activeModelForProvider(cfg *Config, providerName string, entry ProviderEntry) string {
547 if entry.Model != "" {

Callers 2

TestParseModelListValueFunction · 0.85
applyProviderFieldFunction · 0.85

Calls 1

normalizeModelListFunction · 0.85

Tested by 1

TestParseModelListValueFunction · 0.68