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

Function parseModelListValue

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

Source from the content-addressed store, hash-verified

493}
494
495func parseModelListValue(value string) ([]string, error) {
496 value = strings.TrimSpace(value)
497 if value == "" {
498 return nil, nil
499 }
500
501 if strings.HasPrefix(value, "[") {
502 var models []string
503 if err := json.Unmarshal([]byte(value), &models); err == nil {
504 return normalizeModelList(models), nil
505 }
506 value = strings.TrimSpace(strings.TrimSuffix(strings.TrimPrefix(value, "["), "]"))
507 }
508
509 return normalizeModelList(strings.Split(value, ",")), nil
510}
511
512func activeModelForProvider(cfg *Config, providerName string, entry ProviderEntry) string {
513 if entry.Model != "" {

Callers 2

TestParseModelListValueFunction · 0.85
applyProviderFieldFunction · 0.85

Calls 1

normalizeModelListFunction · 0.85

Tested by 1

TestParseModelListValueFunction · 0.68