async def _count_monthly_requests(
        self,
        user_id: UUID,
        route: Optional[str] = None,  # <--- ADDED THIS
    ) -> int:
        """Count the number of requests so far this month for a given user.

        If route is provided, count only for that route. Otherwise, count
        globally.
        """
        now = datetime.now(timezone.utc)
        start_of_month = now.replace(
            day=1, hour=0, minute=0, second=0, microsecond=0
        )
        return await self._count_requests(
            user_id, route=route, since=start_of_month
        )
Count the number of requests so far this month for a given user.

        If route is provided, count only for that route. Otherwise, count
        globally.
        
py/core/providers/database/limits.py