forked from phoenix/litellm-mirror
fix(caching.py): fix print statements
This commit is contained in:
parent
bdd2004691
commit
d6537a05ca
3 changed files with 23 additions and 4 deletions
|
@ -1112,15 +1112,25 @@ async def update_database(
|
|||
max_budget=max_user_budget,
|
||||
user_email=None,
|
||||
)
|
||||
|
||||
else:
|
||||
existing_user_obj.spend = (
|
||||
existing_user_obj.spend + response_cost
|
||||
)
|
||||
|
||||
user_object_json = {**existing_user_obj.json(exclude_none=True)}
|
||||
|
||||
user_object_json["model_max_budget"] = json.dumps(
|
||||
user_object_json["model_max_budget"]
|
||||
)
|
||||
user_object_json["model_spend"] = json.dumps(
|
||||
user_object_json["model_spend"]
|
||||
)
|
||||
|
||||
await prisma_client.db.litellm_usertable.upsert(
|
||||
where={"user_id": end_user_id},
|
||||
data={
|
||||
"create": {**existing_user_obj.json(exclude_none=True)},
|
||||
"create": user_object_json,
|
||||
"update": {"spend": {"increment": response_cost}},
|
||||
},
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue