@@ -1898,9 +1898,9 @@ async def _handle_logging_proxy_only_error(
18981898 normalized_call_type = CallTypes .aembedding .value
18991899 if normalized_call_type is not None :
19001900 litellm_logging_obj .call_type = normalized_call_type
1901- litellm_logging_obj .model_call_details ["call_type" ] = (
1902- normalized_call_type
1903- )
1901+ litellm_logging_obj .model_call_details [
1902+ "call_type"
1903+ ] = normalized_call_type
19041904 # Pass-through endpoints are logged via the callback loop's
19051905 # async_post_call_failure_hook — skip pre_call and failure handlers.
19061906 if litellm_logging_obj .call_type == CallTypes .pass_through .value :
@@ -2498,7 +2498,8 @@ async def check_view_exists(self):
24982498 required_view = "LiteLLM_VerificationTokenView"
24992499 expected_views_str = ", " .join (f"'{ view } '" for view in expected_views )
25002500 pg_schema = os .getenv ("DATABASE_SCHEMA" , "public" )
2501- ret = await self .db .query_raw (f"""
2501+ ret = await self .db .query_raw (
2502+ f"""
25022503 WITH existing_views AS (
25032504 SELECT viewname
25042505 FROM pg_views
@@ -2510,7 +2511,8 @@ async def check_view_exists(self):
25102511 (SELECT COUNT(*) FROM existing_views) AS view_count,
25112512 ARRAY_AGG(viewname) AS view_names
25122513 FROM existing_views
2513- """ )
2514+ """
2515+ )
25142516 expected_total_views = len (expected_views )
25152517 if ret [0 ]["view_count" ] == expected_total_views :
25162518 verbose_proxy_logger .info ("All necessary views exist!" )
@@ -2519,7 +2521,8 @@ async def check_view_exists(self):
25192521 ## check if required view exists ##
25202522 if ret [0 ]["view_names" ] and required_view not in ret [0 ]["view_names" ]:
25212523 await self .health_check () # make sure we can connect to db
2522- await self .db .execute_raw ("""
2524+ await self .db .execute_raw (
2525+ """
25232526 CREATE VIEW "LiteLLM_VerificationTokenView" AS
25242527 SELECT
25252528 v.*,
@@ -2529,7 +2532,8 @@ async def check_view_exists(self):
25292532 t.rpm_limit AS team_rpm_limit
25302533 FROM "LiteLLM_VerificationToken" v
25312534 LEFT JOIN "LiteLLM_TeamTable" t ON v.team_id = t.team_id;
2532- """ )
2535+ """
2536+ )
25332537
25342538 verbose_proxy_logger .info (
25352539 "LiteLLM_VerificationTokenView Created in DB!"
@@ -2964,6 +2968,7 @@ async def get_data( # noqa: PLR0915
29642968 t.members_with_roles AS team_members_with_roles,
29652969 t.object_permission_id AS team_object_permission_id,
29662970 t.organization_id as org_id,
2971+ p.project_alias AS project_alias,
29672972 tm.spend AS team_member_spend,
29682973 m.aliases AS team_model_aliases,
29692974 -- Added comma to separate b.* columns
@@ -2981,6 +2986,7 @@ async def get_data( # noqa: PLR0915
29812986 LEFT JOIN "LiteLLM_TeamMembership" AS tm ON v.team_id = tm.team_id AND tm.user_id = v.user_id
29822987 LEFT JOIN "LiteLLM_ModelTable" m ON t.model_id = m.id
29832988 LEFT JOIN "LiteLLM_BudgetTable" AS b ON v.budget_id = b.budget_id
2989+ LEFT JOIN "LiteLLM_ProjectTable" AS p ON v.project_id = p.project_id
29842990 LEFT JOIN "LiteLLM_OrganizationTable" AS o ON v.organization_id = o.organization_id
29852991 LEFT JOIN "LiteLLM_BudgetTable" AS b2 ON o.budget_id = b2.budget_id
29862992 WHERE v.token = '{ token } '
0 commit comments