Home / Class/ AsyncPageCursor Class — anthropic-sdk-python Architecture

AsyncPageCursor Class — anthropic-sdk-python Architecture

Architecture documentation for the AsyncPageCursor class in pagination.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  a8e6e5b2_36b5_67f5_2c4a_035759135a17["AsyncPageCursor"]
  b906442a_92b7_2131_d6a5_3712533b82f2["pagination.py"]
  a8e6e5b2_36b5_67f5_2c4a_035759135a17 -->|defined in| b906442a_92b7_2131_d6a5_3712533b82f2
  51117064_0a8a_9585_eed1_374f8a1179de["_get_page_items()"]
  a8e6e5b2_36b5_67f5_2c4a_035759135a17 -->|method| 51117064_0a8a_9585_eed1_374f8a1179de
  69709872_f01b_c2e1_2036_2002d978afba["has_next_page()"]
  a8e6e5b2_36b5_67f5_2c4a_035759135a17 -->|method| 69709872_f01b_c2e1_2036_2002d978afba
  06d99620_49d9_5f39_8483_28c46c1ff789["next_page_info()"]
  a8e6e5b2_36b5_67f5_2c4a_035759135a17 -->|method| 06d99620_49d9_5f39_8483_28c46c1ff789

Relationship Graph

Source Code

src/anthropic/pagination.py lines 174–200

class AsyncPageCursor(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
    data: List[_T]
    has_more: Optional[bool] = None
    next_page: Optional[str] = None

    @override
    def _get_page_items(self) -> List[_T]:
        data = self.data
        if not data:
            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]:
        next_page = self.next_page
        if not next_page:
            return None

        return PageInfo(params={"page": next_page})

Frequently Asked Questions

What is the AsyncPageCursor class?
AsyncPageCursor is a class in the anthropic-sdk-python codebase, defined in src/anthropic/pagination.py.
Where is AsyncPageCursor defined?
AsyncPageCursor is defined in src/anthropic/pagination.py at line 174.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free