It is well documented that the Antikythera mechanism could predict solar and lunar eclipses. The device's operation was based on 7th century BC Babylonian astronomy, specifically the Saros cycle, and Greek astronomy. The theory and data was definitely present in Thales' time.