UAIBlueprintHelperLibrary::GetAIController

The way it works exactly is if the actor passed in is a pawn, then the function retrieves pawn's controller cast to AIController.