Get a cached response if it exists and is not expired
(self, request_id: str)
| 144 | del self._pending[request_id] |
| 145 | |
| 146 | def get_cached(self, request_id: str) -> dict[str, Any] | None: |
| 147 | """Get a cached response if it exists and is not expired""" |
| 148 | entry = self._cache.get(request_id) |
| 149 | if entry and not entry.is_expired(self._ttl_seconds): |
| 150 | return entry.response |
| 151 | return None |
| 152 | |
| 153 | def is_pending(self, request_id: str) -> bool: |
| 154 | """Check if a request is currently in-flight""" |