File size: 782 Bytes
85dea7a
 
7c9b9c8
85dea7a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import streamlit as st
import os
from chatbot import DIDx_Chatbot


didx_chatbot = 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")

    didx_chatbot.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 = didx_chatbot.user_chat(user_input)
                st.write(answer)