mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix cost tracking for vertex ai native
This commit is contained in:
parent
8a62f9121f
commit
2474400796
3 changed files with 30 additions and 10 deletions
|
@ -693,10 +693,10 @@ def load_from_azure_key_vault(use_azure_key_vault: bool = False):
|
|||
def cost_tracking():
|
||||
global prisma_client, custom_db_client
|
||||
if prisma_client is not None or custom_db_client is not None:
|
||||
if isinstance(litellm.success_callback, list):
|
||||
if isinstance(litellm._async_success_callback, list):
|
||||
verbose_proxy_logger.debug("setting litellm success callback to track cost")
|
||||
if (_PROXY_track_cost_callback) not in litellm.success_callback: # type: ignore
|
||||
litellm.success_callback.append(_PROXY_track_cost_callback) # type: ignore
|
||||
if (_PROXY_track_cost_callback) not in litellm._async_success_callback: # type: ignore
|
||||
litellm._async_success_callback.append(_PROXY_track_cost_callback) # type: ignore
|
||||
|
||||
|
||||
async def _PROXY_failure_handler(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue