index = SummaryIndex.from_documents(documents) query_engine = index.as_query_engine(response_mode="tree_summarize") response = query_engine.query("Summarize the provided text.")
from llama_index.core.response_synthesizers import TreeSummarize synth = TreeSummarize(llm=llm) summary = synth.get_response("Summarize the provided text.", ["text1", "text2", ...])