An autorefractor can already figure out a patient's eyeglass prescription without an optometrist. It doesn't use any AI, just high precision optics with deterministic calculations.
https://en.wikipedia.org/wiki/Autorefractor
However optometrists do a lot more than just write prescriptions for corrective lenses.