mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
fix(utils.py): fix double hashing issue on spend logs, streaming usage metadata logging iss
ue for spend logs
This commit is contained in:
parent
f8870fb48e
commit
d52f5234b4
3 changed files with 23 additions and 9 deletions
|
@ -834,7 +834,7 @@ def get_logging_payload(kwargs, response_obj, start_time, end_time):
|
|||
usage = response_obj["usage"]
|
||||
id = response_obj.get("id", str(uuid.uuid4()))
|
||||
api_key = metadata.get("user_api_key", "")
|
||||
if api_key is not None and type(api_key) == str:
|
||||
if api_key is not None and isinstance(api_key, str) and api_key.startswith("sk-"):
|
||||
# hash the api_key
|
||||
api_key = hash_token(api_key)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue