def _get_root_key_and_kwargs(
        self, *args: Any, **kwargs: Any
    ) -> Tuple[str, Dict[str, Any]]:
        """
        Get root key and kwargs.

        This is for `_run`.

        """
        ## run pipeline
        ## assume there is only one root - for multiple roots, need to specify `run_multi`
        root_keys = self._get_root_keys()
        if len(root_keys) != 1:
            raise ValueError("Only one root is supported.")
        root_key = root_keys[0]

        root_module = self.module_dict[root_key]
        if len(args) > 0:
            # if args is specified, validate. only one arg is allowed, and there can only be one free
            # input key in the module
            if len(args) > 1:
                raise ValueError("Only one arg is allowed.")
            if len(kwargs) > 0:
                raise ValueError("No kwargs allowed if args is specified.")
            if len(root_module.free_req_input_keys) != 1:
                raise ValueError("Only one free input key is allowed.")
            # set kwargs
            kwargs[next(iter(root_module.free_req_input_keys))] = args[0]

        # if one kwarg and module only needs one kwarg, align them
        if len(root_module.free_req_input_keys) == 1 and len(kwargs) == 1:
            module_input_key = next(iter(root_module.free_req_input_keys))
            kwarg = next(iter(kwargs.values()))
            kwargs = {module_input_key: kwarg}

        return root_key, kwargs

        Get root key and kwargs.

        This is for `_run`.

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