(feat) s3 logging - log cache hits

This commit is contained in:
ishaan-jaff 2024-01-11 15:57:54 +05:30
parent a645e982ee
commit 0da0909f2d

View file

@ -93,6 +93,7 @@ class S3Logger:
messages = kwargs.get("messages") messages = kwargs.get("messages")
optional_params = kwargs.get("optional_params", {}) optional_params = kwargs.get("optional_params", {})
call_type = kwargs.get("call_type", "litellm.completion") call_type = kwargs.get("call_type", "litellm.completion")
cache_hit = kwargs.get("cache_hit", False)
usage = response_obj["usage"] usage = response_obj["usage"]
id = response_obj.get("id", str(uuid.uuid4())) id = response_obj.get("id", str(uuid.uuid4()))
@ -100,6 +101,7 @@ class S3Logger:
payload = { payload = {
"id": id, "id": id,
"call_type": call_type, "call_type": call_type,
"cache_hit": cache_hit,
"startTime": start_time, "startTime": start_time,
"endTime": end_time, "endTime": end_time,
"model": kwargs.get("model", ""), "model": kwargs.get("model", ""),