Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,49 @@ import streamlit as st
|
|
| 2 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 3 |
from datetime import datetime
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
# Function to generate interview questions
|
| 8 |
def generate_questions(role, topic, difficulty, num_questions):
|
|
@@ -33,7 +75,8 @@ def provide_tips(role=None):
|
|
| 33 |
return tips.content if tips else "No tips available."
|
| 34 |
|
| 35 |
# Interface for generating questions
|
| 36 |
-
with st.form('question_form'):
|
|
|
|
| 37 |
role = st.selectbox('Select Role', ['Software Developer', 'Data Analyst', 'Marketing Manager'])
|
| 38 |
topic = st.selectbox('Select Topic', ['Behavioral', 'Technical', 'Situational'])
|
| 39 |
difficulty = st.selectbox('Select Difficulty Level', ['Easy', 'Medium', 'Hard'])
|
|
@@ -43,32 +86,36 @@ with st.form('question_form'):
|
|
| 43 |
if question_submitted:
|
| 44 |
questions = generate_questions(role, topic, difficulty, num_questions)
|
| 45 |
st.info(questions)
|
|
|
|
| 46 |
|
| 47 |
# Interface for feedback on responses
|
| 48 |
-
with st.form('feedback_form'):
|
|
|
|
| 49 |
response = st.text_area('Type your interview response')
|
| 50 |
feedback_submitted = st.form_submit_button('Get Feedback')
|
| 51 |
|
| 52 |
if feedback_submitted and response:
|
| 53 |
feedback = analyze_responses(response)
|
| 54 |
st.info(feedback)
|
|
|
|
| 55 |
|
| 56 |
# Interface for interview tips
|
| 57 |
-
with st.form('tips_form'):
|
|
|
|
| 58 |
role_for_tips = st.selectbox('Select Role for Tips', ['', 'Software Developer', 'Data Analyst', 'Marketing Manager'])
|
| 59 |
tips_submitted = st.form_submit_button('Get Tips')
|
| 60 |
|
| 61 |
if tips_submitted:
|
| 62 |
tips = provide_tips(role_for_tips if role_for_tips else None)
|
| 63 |
st.info(tips)
|
|
|
|
| 64 |
|
| 65 |
-
#
|
| 66 |
st.sidebar.header("Mock Interview Scheduler")
|
| 67 |
st.sidebar.write("Schedule a mock interview with the bot.")
|
| 68 |
mock_date = st.sidebar.date_input("Select Date", datetime.now())
|
| 69 |
mock_time = st.sidebar.time_input("Select Time", datetime.now().time())
|
| 70 |
st.sidebar.button("Schedule Interview", on_click=lambda: st.sidebar.write("Interview scheduled!"))
|
| 71 |
|
| 72 |
-
# Placeholder for engagement metrics and resource recommendations
|
| 73 |
st.sidebar.header("Engagement Metrics and Resources")
|
| 74 |
-
st.sidebar.write("Track your progress over time and connect with resources.")
|
|
|
|
| 2 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 3 |
from datetime import datetime
|
| 4 |
|
| 5 |
+
# Custom CSS for styling
|
| 6 |
+
st.markdown("""
|
| 7 |
+
<style>
|
| 8 |
+
/* Style the title */
|
| 9 |
+
.stApp {
|
| 10 |
+
background-color: #f5f5f5;
|
| 11 |
+
font-family: 'Arial', sans-serif;
|
| 12 |
+
}
|
| 13 |
+
.stTitle {
|
| 14 |
+
color: #2c3e50;
|
| 15 |
+
font-size: 32px;
|
| 16 |
+
font-weight: bold;
|
| 17 |
+
text-align: center;
|
| 18 |
+
margin-bottom: 20px;
|
| 19 |
+
}
|
| 20 |
+
/* Style the buttons and forms */
|
| 21 |
+
.stButton > button {
|
| 22 |
+
background-color: #2980b9;
|
| 23 |
+
color: white;
|
| 24 |
+
padding: 10px 20px;
|
| 25 |
+
border-radius: 5px;
|
| 26 |
+
border: none;
|
| 27 |
+
font-weight: bold;
|
| 28 |
+
}
|
| 29 |
+
.stForm {
|
| 30 |
+
background-color: #ecf0f1;
|
| 31 |
+
padding: 20px;
|
| 32 |
+
border-radius: 10px;
|
| 33 |
+
margin-bottom: 20px;
|
| 34 |
+
}
|
| 35 |
+
/* Style the sidebar */
|
| 36 |
+
.stSidebar > div {
|
| 37 |
+
background-color: #bdc3c7;
|
| 38 |
+
padding: 15px;
|
| 39 |
+
border-radius: 10px;
|
| 40 |
+
}
|
| 41 |
+
.stSidebar > div > h1 {
|
| 42 |
+
color: #2c3e50;
|
| 43 |
+
}
|
| 44 |
+
</style>
|
| 45 |
+
""", unsafe_allow_html=True)
|
| 46 |
+
|
| 47 |
+
st.markdown("<h1 class='stTitle'>Job Interview Preparation Bot</h1>", unsafe_allow_html=True)
|
| 48 |
|
| 49 |
# Function to generate interview questions
|
| 50 |
def generate_questions(role, topic, difficulty, num_questions):
|
|
|
|
| 75 |
return tips.content if tips else "No tips available."
|
| 76 |
|
| 77 |
# Interface for generating questions
|
| 78 |
+
with st.form('question_form', clear_on_submit=True):
|
| 79 |
+
st.markdown("<div class='stForm'>", unsafe_allow_html=True)
|
| 80 |
role = st.selectbox('Select Role', ['Software Developer', 'Data Analyst', 'Marketing Manager'])
|
| 81 |
topic = st.selectbox('Select Topic', ['Behavioral', 'Technical', 'Situational'])
|
| 82 |
difficulty = st.selectbox('Select Difficulty Level', ['Easy', 'Medium', 'Hard'])
|
|
|
|
| 86 |
if question_submitted:
|
| 87 |
questions = generate_questions(role, topic, difficulty, num_questions)
|
| 88 |
st.info(questions)
|
| 89 |
+
st.markdown("</div>", unsafe_allow_html=True)
|
| 90 |
|
| 91 |
# Interface for feedback on responses
|
| 92 |
+
with st.form('feedback_form', clear_on_submit=True):
|
| 93 |
+
st.markdown("<div class='stForm'>", unsafe_allow_html=True)
|
| 94 |
response = st.text_area('Type your interview response')
|
| 95 |
feedback_submitted = st.form_submit_button('Get Feedback')
|
| 96 |
|
| 97 |
if feedback_submitted and response:
|
| 98 |
feedback = analyze_responses(response)
|
| 99 |
st.info(feedback)
|
| 100 |
+
st.markdown("</div>", unsafe_allow_html=True)
|
| 101 |
|
| 102 |
# Interface for interview tips
|
| 103 |
+
with st.form('tips_form', clear_on_submit=True):
|
| 104 |
+
st.markdown("<div class='stForm'>", unsafe_allow_html=True)
|
| 105 |
role_for_tips = st.selectbox('Select Role for Tips', ['', 'Software Developer', 'Data Analyst', 'Marketing Manager'])
|
| 106 |
tips_submitted = st.form_submit_button('Get Tips')
|
| 107 |
|
| 108 |
if tips_submitted:
|
| 109 |
tips = provide_tips(role_for_tips if role_for_tips else None)
|
| 110 |
st.info(tips)
|
| 111 |
+
st.markdown("</div>", unsafe_allow_html=True)
|
| 112 |
|
| 113 |
+
# Sidebar for mock interview scheduling and resources
|
| 114 |
st.sidebar.header("Mock Interview Scheduler")
|
| 115 |
st.sidebar.write("Schedule a mock interview with the bot.")
|
| 116 |
mock_date = st.sidebar.date_input("Select Date", datetime.now())
|
| 117 |
mock_time = st.sidebar.time_input("Select Time", datetime.now().time())
|
| 118 |
st.sidebar.button("Schedule Interview", on_click=lambda: st.sidebar.write("Interview scheduled!"))
|
| 119 |
|
|
|
|
| 120 |
st.sidebar.header("Engagement Metrics and Resources")
|
| 121 |
+
st.sidebar.write("Track your progress over time and connect with resources.")
|