Unity NavMesh path-finding with my own moment script.

I have kept my game fairly modular up to this point. Players and bots in my game use the same scripts for the most part. I also want to make the bot movement the same as the player movement. My player moves with the method call here that takes two floats for direction and a bool to jump.

player.Move(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), Input.GetButton("Jump"));

I would like my bot to be able to use that same Move method and navigate the scene avoiding obstacles.
How can this be done?
Thanks in advance.

Got it. My current solution is this

NavMeshPath path = new NavMeshPath();
navMeshAgent.CalculatePath(currentTarget.transform.position, path);
if(path.corners.Length != 0) desiredDir = (transform.position - path.corners[0]).normalized;
player.Move(desiredDir.x, desiredDir.y, false);