MCPcopy
hub / github.com/vibrantlabsai/ragas / async_wrapper

Function async_wrapper

src/ragas/cache.py:222–232  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

220
221 @functools.wraps(func)
222 async def async_wrapper(*args, **kwargs):
223 cache_key = _generate_cache_key(func, args, kwargs)
224
225 if backend.has_key(cache_key):
226 logger.debug(f"Cache hit for {cache_key}")
227 return backend.get(cache_key)
228
229 result = await func(*args, **kwargs)
230 picklable_result = _make_pydantic_picklable(result)
231 backend.set(cache_key, picklable_result)
232 return result
233
234 @functools.wraps(func)
235 def sync_wrapper(*args, **kwargs):

Callers

nothing calls this directly

Calls 5

_generate_cache_keyFunction · 0.85
_make_pydantic_picklableFunction · 0.85
has_keyMethod · 0.45
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…