langchain_core.utils.iter
.batch_iterate¶
- langchain_core.utils.iter.batch_iterate(size: Optional[int], iterable: Iterable[T]) Iterator[List[T]] [source]¶
Utility batching function.
- Parameters
size (Optional[int]) – The size of the batch. If None, returns a single batch.
iterable (Iterable[T]) – The iterable to batch.
- Yields
The batches of the iterable.
- Return type
Iterator[List[T]]