question = tools.contextualize(prompts["context"], chat) top_documents = tools.get_documents(question) answer = tools.answer(prompts["answer"], question, top_documents) for chunk in answer: yield chunk