Hello Botpress Community,
I'm currently working on a bot that needs to accumulate multiple user messages over a period and then process them together. I've tried various methods but haven't found a reliable solution yet. I'm reaching out to the community for advice and best practices.
When user input is given, the bot is supposed to create an empty array for the accumulated messages, adds the message to the array and start a timer of 15 minutes. Every time a message is send, it is added to the array, and the timer is reset. After the timer runs out (so no messages have been send in the past 15 minutes), it makes a post request to the OpenAI API with the array consisting of all the combined messages, and it should move on to the next node.
Only what im struggling with, is that the flow continues immediately, so it does not wait for the timer whatsoever. It just asks the OpenAI thread for a response, which will not be there cause the post request is not even made.
My question is, how can i make the flow wait for the timer to run out. Ive tried async processing with await functions, but it just goes on. Has anyone experience in this?
I use botpress 12.31.8 on a local machine, got some experience in javascript but mostly web and client side. Am quite good at python though, so the code shouldn't pose a problem.
Thanks in advance,
Cheers,
Reinhard