mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-15 08:27:36 +00:00
(feat) show semantic-cache on health/readiness
This commit is contained in:
committed by
Krrish Dholakia
parent
0d03b28a3b
commit
325ca43946
@@ -531,6 +531,9 @@ class RedisSemanticCache(BaseCache):
|
||||
return None
|
||||
pass
|
||||
|
||||
async def _index_info(self):
|
||||
return await self.index.ainfo()
|
||||
|
||||
|
||||
class S3Cache(BaseCache):
|
||||
def __init__(
|
||||
|
||||
@@ -4051,8 +4051,18 @@ async def health_readiness():
|
||||
|
||||
cache_type = None
|
||||
if litellm.cache is not None:
|
||||
from litellm.caching import RedisSemanticCache
|
||||
|
||||
cache_type = litellm.cache.type
|
||||
|
||||
if isinstance(litellm.cache.cache, RedisSemanticCache):
|
||||
# ping the cache
|
||||
try:
|
||||
index_info = await litellm.cache.cache._index_info()
|
||||
except Exception as e:
|
||||
index_info = "index does not exist - error: " + str(e)
|
||||
cache_type = {"type": cache_type, "index_info": index_info}
|
||||
|
||||
if prisma_client is not None: # if db passed in, check if it's connected
|
||||
if prisma_client.db.is_connected() == True:
|
||||
response_object = {"db": "connected"}
|
||||
|
||||
Reference in New Issue
Block a user