In order to fulfill the basic functions of our service, the user hereby agrees to allow Xiaomi to collect, process and use personal information which shall include but not be limited to written threads, pictures, comments, replies in the Mi Community, and relevant data types listed in Xiaomi's Private Policy. By selecting "Agree", you agree to Xiaomi's Private Policy and Content Policy .
i faced the same problem yesterday. These are my steps which fixed my problem.
1) Go to the Playstore and then from the voice searching (since the keyboard dosn't work) search for Gboard.
2) Probably, it will show you a option for Gboard update (i think 4-6 Mb)
3) Update Gboard
if it dosn't appear the option update in step (2), i looked for that in other forums and they suggest to reinstall Gboard