(items: Any, source: str)
| 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") |
no outgoing calls
no test coverage detected