How to fix code deprecation?

I still can not figure out to me that something is wrong
BlackboardComp->SetValueAsObject(EnemyKeyID, InPawn); code do

BlackboardComp->SetValue<UBlackboardValueAsObject>(EnemyKeyID, InPawn);  code after 

its not work