MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / _load_config

Function _load_config

api_utils/routers/model_capabilities.py:29–40  ·  view source on GitHub ↗

Load model capabilities configuration from JSON file. Uses LRU cache to avoid repeated file reads. Raises FileNotFoundError if config is missing.

()

Source from the content-addressed store, hash-verified

27
28@lru_cache(maxsize=1)
29def _load_config() -> dict[str, Any]:
30 """
31 Load model capabilities configuration from JSON file.
32
33 Uses LRU cache to avoid repeated file reads.
34 Raises FileNotFoundError if config is missing.
35 """
36 if not _CONFIG_PATH.exists():
37 raise FileNotFoundError(f"Model capabilities config not found: {_CONFIG_PATH}")
38
39 with open(_CONFIG_PATH, encoding="utf-8") as f:
40 return json.load(f)
41
42
43def reload_config() -> None:

Callers 2

_get_model_capabilitiesFunction · 0.70
get_model_capabilitiesFunction · 0.70

Calls 1

loadMethod · 0.80

Tested by

no test coverage detected