Thank @WhiteFang_Jr . I have another question: I use CondenseQuestionChatEngine to add history along with query_engine = RetrieverQueryEngine. But when I asked many questions, the answers were not as good as when using query_engine.query. Here is the code:
You will get a response object in which you can check whether there is a response returned from llm or not. If there is no response then response.response will be equal to None. That way you can handle this case