from llama_index.query_engine import CustomQueryEngine from llama_index.llms import OpenAI class LLMQueryEngine(CustomQueryEngine): llm: OpenAI def custom_query(self, query_str: str): response = llm.complete(query_str) return str(response) llm_query_engine = LLMQueryEngine(llm=OpenAI())