openai-python
openai-python copied to clipboard
Fix the issue where the task was being scheduled in stopped loop
- [x] I understand that this repository is auto-generated and my pull request may not be merged
Changes being requested
Properly call httpx AsyncClient aclose method.
Additional context & links
As of now, there is an issue when using AsyncOpenAI in AWS Lambdas because the event loop is closed and after that the aclose() coroutine is scheduled.
By checking if the loop is running before actually scheduling the coroutine, the issue is resolved.