def _run(
        self,
        *args: Any,
        return_values_direct: bool = True,
        show_intermediates: bool = False,
        batch: bool = False,
        **kwargs: Any,
    ) -> Tuple[Any, Dict[str, ComponentIntermediates]]:
        """
        Run the pipeline.

        Assume that there is a single root module and a single output module.

        For multi-input and multi-outputs, please see `run_multi`.

        """
        root_key, kwargs = self._get_root_key_and_kwargs(*args, **kwargs)

        if batch:
            result_outputs = []
            intermediates = []

            if len({len(value) for value in kwargs.values()}) != 1:
                raise ValueError("Length of batch inputs must be the same.")

            # List of individual inputs from batch input
            kwargs_list = [
                dict(zip(kwargs.keys(), values)) for values in zip(*kwargs.values())
            ]

            jobs = [
                self._arun_multi(
                    {root_key: kwarg}, show_intermediates=show_intermediates
                )
                for kwarg in kwargs_list
            ]

            results = asyncio_run(run_jobs(jobs, workers=len(jobs)))

            for result in results:
                result_outputs.append(
                    self._get_single_result_output(result[0], return_values_direct)
                )
                intermediates.append(result[1])

            return result_outputs, intermediates  # type: ignore[return-value]
        else:
            result_output_dicts, intermediate_dicts = self._run_multi(
                {root_key: kwargs}, show_intermediates=show_intermediates
            )

            return (
                self._get_single_result_output(
                    result_output_dicts, return_values_direct
                ),
                intermediate_dicts,
            )

        Run the pipeline.

        Assume that there is a single root module and a single output module.

        For multi-input and multi-outputs, please see `run_multi`.

        
llama-index-core/llama_index/core/query_pipeline/query.py