Let's take chickens. They predict at a day old whether a chick is going to produce sperm or eggs - be male or female. This is vital for profitability. They sex the chickens based on gamete types. They make their prediction based on subtle differences in the cloaca. Do you want to dispute this?