async def _arun_step(
        self, state: Dict[str, Any], task: Task, input: Optional[str] = None
    ) -> Tuple[AgentChatResponse, bool]:
        """
        Run step (async).

        Can override this method if you want to run the step asynchronously.

        Returns:
            Tuple of (agent_response, is_done)

        """
        if self.async_fn is None:
            current_state, is_done = self.fn(state)
        else:
            current_state, is_done = await self.async_fn(state)
        # TODO: return auxiliary response
        return (
            AgentChatResponse(response=state[self.output_key], metadata=current_state),
            is_done,
        )

        Run step (async).

        Can override this method if you want to run the step asynchronously.

        Returns:
            Tuple of (agent_response, is_done)

        
llama-index-core/llama_index/core/agent/custom/simple_function.py