(fix) _update_team_db

This commit is contained in:
ishaan-jaff 2024-03-05 19:03:27 -08:00
parent 6b6775f68e
commit 92753f558c

View file

@ -1247,6 +1247,11 @@ async def update_database(
# Calculate the new cost by adding the existing cost and response_cost
new_spend = existing_spend + response_cost
if existing_spend_obj is None:
spend_per_model = {}
else:
spend_per_model = existing_spend_obj.model_spend or {}
# track cost per model, for the given team
spend_per_model = existing_spend_obj.model_spend or {}
current_model = kwargs.get("model")