File size: 1,765 Bytes
78240ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
45
46
47
48
49
import streamlit as st
from chating import display_previous_chats, user, bot_response, generate_bar_chart
from variables import thinnk


st.set_page_config("Project", page_icon=":books:", layout="wide")

# Simulated authentication state
auth_state = True  # Simulating authentication by default
hide_streamlit_style = """
            <style>
            #MainMenu {visibility: hidden;}
            footer {visibility: hidden;}
            .viewerBadge_link__qRIco{display:None;}
            </style>
            """
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
if "messages" not in st.session_state:
    st.session_state.messages = []
# Simulated user_info
st.session_state.user_info = {"sub": "123", "given_name": "master", "email": "[email protected]"}

if auth_state:
    profile_completeness = True  # Simulating profile completeness

    if profile_completeness:
        st.snow()
        st.success("Enter a chat to the chat input bar and press enter or tap the arrow")
        st.write(f"# Welcome Back {st.session_state.user_info['given_name']}")
        st.session_state.Prompt = st.chat_input("Detect Cyber Bullying In conversations")
        display_previous_chats()

        if st.session_state.Prompt:
            st.info("TAP ON THE BAR CHART IT'S INTERACTIVE",icon="ℹ️")
            
            user(st.session_state.Prompt)
            Respond, Response = thinnk(st.session_state.Prompt)
            if Respond:
                data_ = generate_bar_chart(Response)
                bot_response(Response,data_)
    else:
        st.info("Please complete your profile")
        # Simulated profile completion steps
        # ...

# Simulated logout button
if not st.session_state.user_info:
    st.write("# Please login to continue")