async def create_collection(
            name: str = Body(..., description="The name of the collection"),
            description: Optional[str] = Body(
                None, description="An optional description of the collection"
            ),
            auth_user=Depends(self.providers.auth.auth_wrapper()),
        ) -> WrappedCollectionResponse:
            """Create a new collection and automatically add the creating user
            to it.

            This endpoint allows authenticated users to create a new collection
            with a specified name and optional description. The user creating
            the collection is automatically added as a member.
            """
            user_collections_count = (
                await self.services.management.collections_overview(
                    user_ids=[auth_user.id], limit=1, offset=0
                )
            )["total_entries"]
            user_max_collections = (
                await self.services.management.get_user_max_collections(
                    auth_user.id
                )
            )
            if (user_collections_count + 1) >= user_max_collections:  # type: ignore
                raise R2RException(
                    f"User has reached the maximum number of collections allowed ({user_max_collections}).",
                    400,
                )
            collection = await self.services.management.create_collection(
                owner_id=auth_user.id,
                name=name,
                description=description,
            )
            # Add the creating user to the collection
            await self.services.management.add_user_to_collection(
                auth_user.id, collection.id
            )
            return collection  # type: ignore
Create a new collection and automatically add the creating user
            to it.

            This endpoint allows authenticated users to create a new collection
            with a specified name and optional description. The user creating
            the collection is automatically added as a member.
            
py/core/main/api/v3/collections_router.py