from llama_index.llms import ChatMessage, MessageRole
from llama_index.llms import ChatMessage, MessageRole
from llama_index import SummaryIndex index = SummaryIndex.from_documents(documents) query_engine = index.as_query_engine(response_mode="tree_summarize", use_async=True) response = query_engine.query("Summarize the provided text.")