mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
(feat) s3 logging - log cache hits
This commit is contained in:
parent
a645e982ee
commit
0da0909f2d
1 changed files with 2 additions and 0 deletions
|
@ -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", ""),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue