Oh dear, I understand why you are worried, but try not to panic too much, an AFI of 19.32 at 31 weeks is on the higher side (polyhydramnios range typically starts around 25, but anything above 18 does get monitored more closely), so your doctor is right to flag it early and adjust your diet now. Cutting rice and sweets is really about managing blood sugar, because high glucose levels can cause the baby to produce more urine, which raises the fluid, so it is not that you can never have anything sweet ever again, but you genuinely need to keep it very controlled, maybe swap to a small piece of fruit instead of cake or sugary drinks. My neighbour went through something similar around 32 weeks and her doctor put her on a strict low-GI diet with repeat scans every two weeks to track whether the fluid level was coming down, which thankfully it did by week 36. The honest truth is that if diet changes do not help, some mums do get referred to a maternal-fetal specialist for closer monitoring, so do not brush off the follow-up appointments even if you are feeling fine. Please do loop back with your own doctor or OB for a personalised plan though, because everyone's situation is a little different and they will know your full picture best.