diff --git a/packages/python-sdk/e2b/sandbox_async/commands/command_handle.py b/packages/python-sdk/e2b/sandbox_async/commands/command_handle.py index dfe34e8383..a8fd435e13 100644 --- a/packages/python-sdk/e2b/sandbox_async/commands/command_handle.py +++ b/packages/python-sdk/e2b/sandbox_async/commands/command_handle.py @@ -99,6 +99,14 @@ def __init__( self._wait = asyncio.create_task(self._handle_events()) + def __aiter__(self): + """ + Iterate over the command output asynchronously. + + :return: Async generator of command outputs + """ + return self._iterate_events().__aiter__() + async def _iterate_events( self, ) -> AsyncGenerator[