I think I found the right place for it.

@ui.in_background def got_input(st) : theModel.parse(st)

That works in my program too.
Thanks everyone for running such a patient and informative forum.