openai-python icon indicating copy to clipboard operation
openai-python copied to clipboard

Fix the issue where the task was being scheduled in stopped loop

Open joaovbsevero opened this issue 10 months ago • 0 comments

  • [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.

joaovbsevero avatar Feb 12 '25 17:02 joaovbsevero