MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / parseModelsOutput

Function parseModelsOutput

internal/providers/models.go:340–350  ·  view source on GitHub ↗

parseModelsOutput splits stdout on \n and drops empty/whitespace lines. Each surviving line is trimmed.

(raw string)

Source from the content-addressed store, hash-verified

338// parseModelsOutput splits stdout on \n and drops empty/whitespace lines.
339// Each surviving line is trimmed.
340func parseModelsOutput(raw string) []string {
341 var models []string
342 for _, line := range strings.Split(raw, "\n") {
343 trimmed := strings.TrimSpace(line)
344 if trimmed == "" {
345 continue
346 }
347 models = append(models, trimmed)
348 }
349 return models
350}
351
352// buildDiscoveryEnv constructs the env slice passed to list_models_cmd.
353// Starts from os.Environ() (via getenv if injected via tests), strips

Callers 1

runListModelsCmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected