run-llama / llama-hub

A library of data loaders for LLMs made by the community -- to be used with LlamaIndex and/or LangChain
https://llamahub.ai/
MIT License
3.42k stars 727 forks source link

asyncio bug fix in telegram loader #928

Closed diicellman closed 5 months ago

diicellman commented 5 months ago

Description

I encountered this error while using the Telegram Loader in a FastAPI application: "RuntimeError: There is no current event loop in thread 'AnyIO worker thread'." I resolved it by replacing asyncio.get_event_loop() with asyncio.new_event_loop().

Fixes # (issue)

Type of Change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Suggested Checklist: