Sometimes "TODO" means something you would do if you had infinite time, refactor the code completely or something that will likely need to be revisited in the future but currently adds no value to implement.
It's just a ~~reduce~~ loop, with an API call to an LLM in the middle, and a data-structure to save the conversation messages and append them in next iterations of the loop. If you wanna get fancy, you can add other API calls, or access to your filesystem. Nothing to go crazy about...
Technically it's `scan`, not `reduce`, since every intermediate output is there too. But it's also kind of a trampoline (tail-call re-write for languages that don't support true tail calls), or it will be soon, since these things loose the plot and need to start over.
If you are doing anything serious, then yes. OTP is a top tier framework for writing any sort of complex parallel/distributed processing. I’d pick OTP over ActiveJobWhatever any day. Elixir code is also easier to maintain at scale due to stronger packaging and typing. OTP’s application abstraction is genius.