Iterate through paginated results
mainPaginated requests return a SyncPager or AsyncPager. You can iterate over the items directly (which handles pagination automatically), iterate page-by-page, or manually control the next page.
from hume.client import HumeClient
client = HumeClient(api_key="YOUR_API_KEY")
# 1. Automatic iteration (generator over items)
for tool in client.empathic_voice.tools.list_tools():
print(tool)
# 2. Page-by-page iteration
for page in client.empathic_voice.tools.list_tools().iter_pages():
print(page.items)
# 3. Manual pagination
pager = client.empathic_voice.tools.list_tools()
print(pager.items) # First page
pager = pager.next_page()
print(pager.items) # Next page