AI-Yash / st-chat

Streamlit Component, for a Chatbot UI

Home Page:https://pypi.org/project/streamlit-chat/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to build a survey bot using st-chat?

KartikPadmanabhan opened this issue · comments

I am a noob here; I am building a simple survey chatbot using streamlit. I have a list of questions {Q1, Q2, … Qn} that I want to ask a user and collect the user’s response in the database. For each user’s response to each question, I also have one follow-up question (FQ1 that I want to ask further and collect responses. The follow-up question is generated on the fly through a hugging face model.

In essence, here is the following workflow I want to be able to see in the chat history:

Bot: Q1
User Response: [text input]
Bot: FQ1 (follow-up question generated on the fly through a model)
User Response: [text input]

Bot: Q2
User Response: [text input]
Bot: FQ2 (follow-up question generated on the fly)
User Response: [text input]
| |
| |
Bot: Q5
User Response: [text input]
Bot: FQ5 (follow-up question generated on the fly)
User Response: [text input]

For now, if we assume the questions and follow-up questions are pre-defined lists, can someone please help provide a vanilla code to solve the above? There are multiple examples of streamlit chat, but none of them deal with asking a pre-defined set of questions (something like a survey bot). Having a bunch of issues while playing through session variables. Any help is appreciated.