File size: 761 Bytes
d86584f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
36
37
38
39
40
41
42
43
44
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)