How Does Artificial Intelligence Really Work in Agriculture?

How far are we from a computer being able to decide what variety or hybrid should be planted in a field, how it is fertilized, and prescribe crop protection chemicals needed? The promise of artificial intelligence (AI) has been a popular discussion in the media, not only for agriculture but for a variety of applications.