Find answers from the community

Updated last year

Hello,

At a glance
Hello,
I am trying to implement SubQuestionQueryEngine using the code below using Azure Open AI.
---------------------------------------------------------------------------------------------------------
from llama_index.question_gen.llm_generators import LLMQuestionGenerator

question_gen = LLMQuestionGenerator.from_defaults(service_context=service_context)
sub_question_query_engine = SubQuestionQueryEngine.from_defaults(query_engine_tools=query_engine_tools,
question_gen=question_gen,
service_context=service_context
-----------------------------------------------------------------------------------------------------------
I am getting the below error message:

)RuntimeError: asyncio.run() cannot be called from a running event loop
-----------------------------------------------------------------------------------------------------------
Any idea how I can fix the issue?
L
D
2 comments
Put this at the top of your code

Plain Text
import nest_asyncio
nest_asyncio.apply()
Thank you! This solution worked
Add a reply
Sign up and join the conversation on Discord