},
                    callbacks=callbacks,
                )
                ########################
            #####################
            aql_generation_attempt += 1
        if aql_result is None:
            m = f"""
                Maximum amount of AQL Query Generation attempts reached.
                Unable to execute the AQL Query due to the following error:
                {aql_error}
            """
            raise ValueError(m)
        _run_manager.on_text("AQL Result:", end="\n", verbose=self.verbose)
        _run_manager.on_text(
            str(aql_result), color="green", end="\n", verbose=self.verbose
        )
        ########################
        # Interpret AQL Result #
        result = self.qa_chain(
            {
                "adb_schema": self.graph.schema,
                "user_input": user_input,
                "aql_query": aql_query,
                "aql_result": aql_result,
            },
            callbacks=callbacks,
        )
        ########################
        # Return results #
        result = {self.output_key: result[self.qa_chain.output_key]}
        if self.return_aql_query:
            result["aql_query"] = aql_query
        if self.return_aql_result:
            result["aql_result"] = aql_result
        return result