From 0afb5d6573dbf4af91ad371abee850330f9635eb Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Thu, 18 Apr 2024 16:53:34 -0700 Subject: [PATCH] fix(caching.py): add call type to service logger object --- litellm/caching.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/litellm/caching.py b/litellm/caching.py index 79c816ff744..99f9012b1bf 100644 --- a/litellm/caching.py +++ b/litellm/caching.py @@ -272,7 +272,9 @@ class RedisCache(BaseCache): _duration = end_time - start_time asyncio.create_task( self.service_logger_obj.async_service_success_hook( - service=ServiceTypes.REDIS, duration=_duration + service=ServiceTypes.REDIS, + duration=_duration, + call_type="async_set_cache", ) ) except Exception as e: @@ -280,7 +282,10 @@ class RedisCache(BaseCache): _duration = end_time - start_time asyncio.create_task( self.service_logger_obj.async_service_failure_hook( - service=ServiceTypes.REDIS, duration=_duration, error=e + service=ServiceTypes.REDIS, + duration=_duration, + error=e, + call_type="async_set_cache", ) ) # NON blocking - notify users Redis is throwing an exception @@ -321,7 +326,9 @@ class RedisCache(BaseCache): _duration = end_time - start_time asyncio.create_task( self.service_logger_obj.async_service_success_hook( - service=ServiceTypes.REDIS, duration=_duration + service=ServiceTypes.REDIS, + duration=_duration, + call_type="async_set_cache_pipeline", ) ) return results @@ -331,7 +338,10 @@ class RedisCache(BaseCache): _duration = end_time - start_time asyncio.create_task( self.service_logger_obj.async_service_failure_hook( - service=ServiceTypes.REDIS, duration=_duration, error=e + service=ServiceTypes.REDIS, + duration=_duration, + error=e, + call_type="async_set_cache_pipeline", ) )