abatch_iterate#

async langchain_core.utils.aiter.abatch_iterate(size: int, iterable: AsyncIterable[T]) AsyncIterator[List[T]][source]#

Utility batching function for async iterables.

Parameters:
  • size (int) – The size of the batch.

  • iterable (AsyncIterable[T]) – The async iterable to batch.

Returns:

An async iterator over the batches.

Return type:

AsyncIterator[List[T]]