MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / _normalize_param_list

Function _normalize_param_list

src/harness/submodules/loader.py:68–83  ·  view source on GitHub ↗
(items: Any, source: str)

Source from the content-addressed store, hash-verified

66 if isinstance(params, dict):
67
68 def _normalize_param_list(items: Any, source: str) -> List[Dict[str, Any]]:
69 if items is None:
70 return []
71 if not isinstance(items, list):
72 items = [items]
73 normalized: List[Dict[str, Any]] = []
74 for item in items:
75 if isinstance(item, str):
76 normalized.append({"name": item, "source": source})
77 elif isinstance(item, dict):
78 entry = dict(item)
79 entry["source"] = source
80 normalized.append(entry)
81 else:
82 raise ValueError(f"Invalid parameter spec in {module_path}: {item}")
83 return normalized
84
85 model_params = _normalize_param_list(params.get("model"), "model")
86 context_params = _normalize_param_list(params.get("context"), "context")

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected