from llama_index.core.question_gen import LLMQuestionGenerator from llama_index.core import QueryBundle question_gen = LLMQuestionGenerator.from_defaults(llm=llm) sub_questions = question_gen.generate([tool.metadata for tool in tools], QueryBundle("query")) for question in sub_questions: print(question.sub_question) print(question.tool_name)