This PR updates the asyncio main loop handling to ensure compatibility with Python 3.7 and newer versions, switching from the outdated loop setup to the more efficient asyncio.run() function.
In Python 3.12, running the example .py files triggers a DeprecationWarning indicating that there is no current event loop.
basic_generation.py:23: DeprecationWarning: There is no current event loop
loop = asyncio.get_event_loop_policy().get_event_loop()
This PR updates the asyncio main loop handling to ensure compatibility with Python 3.7 and newer versions, switching from the outdated loop setup to the more efficient asyncio.run() function.
In Python 3.12, running the example .py files triggers a DeprecationWarning indicating that there is no current event loop.