from typing import Generic, List, TypeVar from pydantic import BaseModel T = TypeVar('T') class PaginatedResponse(BaseModel, Generic[T]): """ Generic schema for paginated responses. Attributes: total (int): Total number of items items (List[T]): List of items in the current page page (int): Current page number size (int): Number of items per page """ total: int items: List[T] page: int size: int class Config: from_attributes = True