PaginatedResponse
Generic paginated response wrapper. Wraps a list of items with pagination metadata for cursor-based navigation.
Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
items | ForwardRef('List[T]') | ✓ | PydanticUndefined | List of items in the current page |
pagination | ForwardRef('PaginationInfo') | ✓ | PydanticUndefined | Pagination metadata |
Usage Example
from credoai.models import PaginatedResponse
# Create a new instance
model = PaginatedResponse(
items=None, # List of items in the current page
pagination=None, # Pagination metadata
)
# Convert to dictionary
model_dict = model.model_dump()
print(model_dict)
# Create from dictionary
data = {
"items": None,
"pagination": None,
}
model_from_dict = PaginatedResponse(**data)
JSON Schema
{
"type": "object",
"title": "PaginatedResponse",
"description": "Generic paginated response wrapper.
Wraps a list of items with pagination metadata for cursor-based navigation.",
"properties": {
"items": {
"type": "forwardref('list[t]')",
"description": "List of items in the current page"
},
"pagination": {
"type": "forwardref('paginationinfo')",
"description": "Pagination metadata"
}
},
"required": ["items", "pagination"]
}