Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions src/contextual/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
"AsyncDocumentsPage",
"SyncAgentsPage",
"AsyncAgentsPage",
"SyncPage",
"AsyncPage",
]

_T = TypeVar("_T")
Expand Down Expand Up @@ -137,43 +135,3 @@ def next_page_info(self) -> Optional[PageInfo]:
return None

return PageInfo(params={"cursor": next_cursor})


class SyncPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
data: List[_T]
next_cursor: Optional[str] = None

@override
def _get_page_items(self) -> List[_T]:
data = self.data
if not data:
return []
return data

@override
def next_page_info(self) -> Optional[PageInfo]:
next_cursor = self.next_cursor
if not next_cursor:
return None

return PageInfo(params={"cursor": next_cursor})


class AsyncPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
data: List[_T]
next_cursor: Optional[str] = None

@override
def _get_page_items(self) -> List[_T]:
data = self.data
if not data:
return []
return data

@override
def next_page_info(self) -> Optional[PageInfo]:
next_cursor = self.next_cursor
if not next_cursor:
return None

return PageInfo(params={"cursor": next_cursor})