I believe that you're describing cloacal prolapse which you can read about here: https://www.beautyofbirds.com/Prolapse.htm You mustn't pull this out; instead, the tissue needs to put back in. A lack of calcium in Pai's diet is a common cause of both her prolapse and soft-shelled eggs. If you can't replace her cloaca or it prolapses once again in spite of your replacing it, an avian vet will be needed. I understand that you might not have such a vet where you live, however.
Nutritional imbalances are a common cause of illness in our pet birds. What has Pai'sdiet consisted of, please? Seeds should compose less than 20% of her diet. Ideally, a balanced pelleted diet such as can be found here: www.harrisonsbirdfoods.com or here: www.lafeber.com/pet-birds should be fed as well as hard boiled egg yolk, pancakes and cornbread, the tops of fresh greens, dairy products such as yogurt and cheese, fresh fruits such as apples, pears, melon, kiwi, and berries, vegetables such as broccoli, carrots, beets, asparagus, cabbage, sweet potato, and squash, and even tiny pieces of meat.