from __future__ import annotations from typing import Generic, TypeVar from pydantic import BaseModel T = TypeVar("T") class ErrorResponse(BaseModel): detail: str class PaginatedResponse(BaseModel, Generic[T]): items: list[T] total: int page: int size: int pages: int