mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
fix: support streaming custom cost completion tracking
This commit is contained in:
parent
82bbf336d5
commit
074ea17325
4 changed files with 58 additions and 11 deletions
|
@ -449,6 +449,7 @@ class PrismaClient:
|
|||
"update": {}, # don't do anything if it already exists
|
||||
},
|
||||
)
|
||||
verbose_proxy_logger.info(f"Data Inserted into Keys Table")
|
||||
return new_verification_token
|
||||
elif table_name == "user":
|
||||
db_data = self.jsonify_object(data=data)
|
||||
|
@ -459,6 +460,7 @@ class PrismaClient:
|
|||
"update": {}, # don't do anything if it already exists
|
||||
},
|
||||
)
|
||||
verbose_proxy_logger.info(f"Data Inserted into User Table")
|
||||
return new_user_row
|
||||
elif table_name == "config":
|
||||
"""
|
||||
|
@ -483,6 +485,7 @@ class PrismaClient:
|
|||
|
||||
tasks.append(updated_table_row)
|
||||
await asyncio.gather(*tasks)
|
||||
verbose_proxy_logger.info(f"Data Inserted into Config Table")
|
||||
elif table_name == "spend":
|
||||
db_data = self.jsonify_object(data=data)
|
||||
new_spend_row = await self.db.litellm_spendlogs.upsert(
|
||||
|
@ -492,6 +495,7 @@ class PrismaClient:
|
|||
"update": {}, # don't do anything if it already exists
|
||||
},
|
||||
)
|
||||
verbose_proxy_logger.info(f"Data Inserted into Spend Table")
|
||||
return new_spend_row
|
||||
|
||||
except Exception as e:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue