mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-10-22 17:39:02 +00:00
15 lines
544 B
Python
15 lines
544 B
Python
from typing import TypeVar, Generic, List
|
|
from dbgpt._private.pydantic import BaseModel, Field
|
|
|
|
T = TypeVar("T")
|
|
|
|
|
|
class PaginationResult(BaseModel, Generic[T]):
|
|
"""Pagination result"""
|
|
|
|
items: List[T] = Field(..., description="The items in the current page")
|
|
total_count: int = Field(..., description="Total number of items")
|
|
total_pages: int = Field(..., description="total number of pages")
|
|
page: int = Field(..., description="Current page number")
|
|
page_size: int = Field(..., description="Number of items per page")
|