didxchatbot / bot.py
muhammadnasar's picture
Create bot.py
d86584f
import streamlit as st
import os
from main import DIDx_Chatbot
abc = DIDx_Chatbot()
st.title("DIDX Bot (Powered by OpenAI Assistant!")
access_code = st.text_input('Please Enter your access code', type="password")
if access_code == os.environ['token']:
col1, col2 = st.columns(2)
with col1:
user_id = st.text_input('Please Enter user ID')
with col2:
password = st.text_input('Please Enter Password', type="password")
abc.user_auth(user_id, password)
user_input = st.text_input('How can I help you?')
with st.spinner('Sit back and relax. It takes a while.'):
if st.button('Ask'):
if user_input:
answer = abc.user_chat(user_input)
st.write(answer)