Github user jxnl has published a SDL library (in python) to work with prompts more naturally.

It also makes it incredibly easy to work with function calls using Python’s typings