hishel 1.0.0.dev0__py3-none-any.whl → 1.0.0.dev2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
hishel/_async_cache.py CHANGED
@@ -25,7 +25,7 @@ from hishel import (
25
25
  create_idle_state,
26
26
  )
27
27
  from hishel._core._spec import InvalidatePairs, vary_headers_match
28
- from hishel._core.models import CompletePair
28
+ from hishel._core.models import CompletePair, ResponseMetadata
29
29
 
30
30
  logger = logging.getLogger("hishel.integrations.clients")
31
31
 
@@ -90,7 +90,14 @@ class AsyncCacheProxy:
90
90
  logger.debug(
91
91
  "Found matching cached response for the request",
92
92
  )
93
- pair.response.metadata["hishel_from_cache"] = True # type: ignore
93
+ response_meta = ResponseMetadata(
94
+ hishel_spec_ignored=True,
95
+ hishel_from_cache=True,
96
+ hishel_created_at=pair.meta.created_at,
97
+ hishel_revalidated=False,
98
+ hishel_stored=False,
99
+ )
100
+ pair.response.metadata.update(response_meta) # type: ignore
94
101
  await self._maybe_refresh_pair_ttl(pair)
95
102
  return pair.response
96
103