MCPcopy
hub / github.com/Aider-AI/aider / _update_cache

Method _update_cache

aider/openrouter.py:114–128  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

112 self._cache_loaded = True
113
114 def _update_cache(self) -> None:
115 try:
116 response = requests.get(self.MODELS_URL, timeout=10, verify=self.verify_ssl)
117 if response.status_code == 200:
118 self.content = response.json()
119 try:
120 self.cache_file.write_text(json.dumps(self.content, indent=2))
121 except OSError:
122 pass # Non-fatal if we can’t write the cache
123 except Exception as ex: # noqa: BLE001
124 print(f"Failed to fetch OpenRouter model list: {ex}")
125 try:
126 self.cache_file.write_text("{}")
127 except OSError:
128 pass

Callers 1

_ensure_contentMethod · 0.95

Calls 2

jsonMethod · 0.80
write_textMethod · 0.80

Tested by

no test coverage detected