Hi,
I have a WhatsApp chatbot that has a webhook to receive messages from WhatsApp and sends messages to WhatsApp using Meta GraphAPI. To test it, I would like to use Streamlit as the test UI. Sending messages from Streamlit to my chatbot backend is easy, I just send them to the webhook. However, how can I receive messages from my chatbot backend? For that, I would need to add a webhook to the Streamlit app that could listen for incoming messages. After some research on the Internet, it seems that it’s not possible. Or is it? Alternatively, I could automatically refresh the page every couple of seconds. However, it seems that also that is not possible. Is that correct?
Any hints are appreciated!
Best,
Konstantin
EDIT: I tried to run FastAPI in a parallel process that implements the webhook and then uses Selenium to refresh the Streamlit app, as described here but it doesn’t work and I even don’t understand how the solution in that post could have worked at all, as it opens a separate connection to the Streamlit app and so doesn’t affect the already existing instance of the UI. Or am I missing an important step?