(fix) log cache hits on SpendLogs table

This commit is contained in:
ishaan-jaff 2024-01-24 18:51:39 -08:00
parent bf851ef19a
commit 2f3765a03f
2 changed files with 10 additions and 0 deletions

View file

@ -1003,6 +1003,10 @@ def get_logging_payload(kwargs, response_obj, start_time, end_time):
cache_key = litellm.cache.get_cache_key(**kwargs)
else:
cache_key = "Cache OFF"
if cache_hit == True:
import time
id = f"{id}_cache_hit{time.time()}" # SpendLogs does not allow duplicate request_id
payload = {
"request_id": id,