The ability to predict what others are thinking is called theory of mind, and it is considered exclusive to humans (and possibly, under some circumstances, great apes). Some tests suggest that AI does have theory of mind, but, like many other aspects of AI, that remains controversial, as it could be a convincing illusion.