MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / countModels

Function countModels

cmd/fetch_codex_models/main.go:297–308  ·  view source on GitHub ↗
(raw []byte)

Source from the content-addressed store, hash-verified

295}
296
297func countModels(raw []byte) (int, error) {
298 var payload struct {
299 Models []map[string]any `json:"models"`
300 }
301 if err := json.Unmarshal(raw, &payload); err != nil {
302 return 0, fmt.Errorf("failed to parse response JSON: %w", err)
303 }
304 if payload.Models == nil {
305 return 0, fmt.Errorf("response JSON does not contain models array")
306 }
307 return len(payload.Models), nil
308}
309
310func prettyJSON(raw []byte) ([]byte, error) {
311 var buf bytes.Buffer

Callers 1

fetchModelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected