LeTI: Learning to Generate from Textual Interactions