Find answers from the community

Updated 9 months ago

sometimes the following line of code

sometimes the following line of code takes 10+ seconds to get result. how can I set timeout to this call? I want to stop requesting if the response can not be returned in a given time period. but I didn't find related documentation how to do it.

Plain Text
response = query_engine.query(question) 
L
a
2 comments
probably use tenacity or similar and wrap with a timeout?
thank you, I used "await asyncio.wait_for(func, timeout)" and it works
Add a reply
Sign up and join the conversation on Discord