strands.types.collections
¶
Generic collection types for the Strands SDK.
T = TypeVar('T')
module-attribute
¶
PaginatedList
¶
Bases: list, Generic[T]
A generic list-like object that includes a pagination token.
This maintains backwards compatibility by inheriting from list, so existing code that expects List[T] will continue to work.
Source code in strands/types/collections.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |
__init__(data, token=None)
¶
Initialize a PaginatedList with data and an optional pagination token.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
List[T]
|
The list of items to store. |
required |
token
|
Optional[str]
|
Optional pagination token for retrieving additional items. |
None
|
Source code in strands/types/collections.py
15 16 17 18 19 20 21 22 23 | |