def METHOD_NAME(
    self,
    query_str: str,
    text_chunks: Sequence[str],
    **response_kwargs: Any,
) -> RESPONSE_TEXT_TYPE:
    """Get tree summarize response."""
    summary_template = self._summary_template.partial_format(query_str=query_str)
    # repack text_chunks so that each chunk fills the context window
    text_chunks = self._service_context.prompt_helper.repack(
        summary_template, text_chunks=text_chunks
    )
    if self._verbose:
        print(f"{len(text_chunks)} text chunks after repacking")
    # give final response if there is only one chunk
    if len(text_chunks) == 1:
        response: RESPONSE_TEXT_TYPE
        if self._streaming:
            response = self._service_context.llm_predictor.stream(
                summary_template,
                context_str=text_chunks[0],
            )
        else:
            response = self._service_context.llm_predictor.predict(
                summary_template,
                context_str=text_chunks[0],
            )
        return response
    else:
        # summarize each chunk
        if self._use_async:
            tasks = [
                self._service_context.llm_predictor.apredict(
                    summary_template,
                    context_str=text_chunk,
                )
                for text_chunk in text_chunks
            ]
            summaries: List[str] = run_async_tasks(tasks)
        else:
            summaries = [
                self._service_context.llm_predictor.predict(
                    summary_template,
                    context_str=text_chunk,
                )
                for text_chunk in text_chunks
            ]
        # recursively summarize the summaries
        return self.METHOD_NAME(
            query_str=query_str,
            text_chunks=summaries,
        )