diff --git a/src/anthropic/pagination.py b/src/anthropic/pagination.py index b6ee5293..c4553fba 100644 --- a/src/anthropic/pagination.py +++ b/src/anthropic/pagination.py @@ -23,6 +23,14 @@ def _get_page_items(self) -> List[_T]: return [] return data + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: if self._options.params.get("before_id"): @@ -52,6 +60,14 @@ def _get_page_items(self) -> List[_T]: return [] return data + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: if self._options.params.get("before_id"):