Duckduckgo-search for real-time data

I try to develop a Streamlit app with duckduckgo-search to have a chatbot which can know real-time context.

Found a such great app:

It worked month ago, but now each time I visit the site there is an error message

RuntimeError(‘There is no current event loop in thread %r.’)

Also deployed the code locally on my computer and I get the same error message.

How can it be fixed?

thx,
Aga

It’s failing with Python 3.9 due to the usage of asyncio with the duckduckgo_search package. I also faced a similar issue while working on my app recently, but it’s been resolved since I upgraded to Python 3.10. You can check out this app for more details - https://langchain-chatbot.streamlit.app/chatbot_with_internet_access