-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
283 lines (199 loc) · 9.1 KB
/
app.py
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# from dotenv import load_dotenv
import streamlit as st
from streamlit_option_menu import option_menu
# import os
import google.generativeai as genai
# load_dotenv()
# api = os.getenv("GOOGLE_API_KEY")
api = st.secrets["GOOGLE_API_KEY"]
genai.configure(api_key=api)
model = genai.GenerativeModel('gemini-pro')
st.set_page_config(
page_title="Career Crafter by Sarthak Mishra",
initial_sidebar_state="auto",
page_icon="random",
menu_items={
'Get Help': 'https://www.linkedin.com/in/sarthakmishraa/',
'Report a bug': "http://sarthakmishra.lovestoblog.com/",
'About': "https://github.com/sarthakmishraa/career-crafter"
}
)
with st.sidebar:
selected = option_menu(
menu_title = "Main Menu",
options = ["About Sarthak", "ATS Resume Matcher", "Application Question Help", "Cover Letter Help", "Referral Message Help", "Interview Prep Assistant"],
icons = ["person-circle", "file-earmark-person", "question-circle", "file-earmark-text-fill", "chat-dots", "file-earmark-text-fill"],
menu_icon = "cast"
)
if selected == "About Sarthak":
st.title("Career Crafter")
st.markdown("Trusted by 200+ users.")
st.header("Discover four essential sections designed to supercharge your job application process:")
st.divider()
st.header("📑ATS Resume Matcher")
st.subheader("Tailor your resume to beat Applicant Tracking Systems and get noticed.")
st.divider()
st.header("❓Application Question Help")
st.subheader("Get expert tips on impressing recruiters with your answers.")
st.divider()
st.header("📝Cover Letter Help")
st.subheader("Craft compelling cover letters to set yourself apart.")
st.divider()
st.header("💌Referral Message Help")
st.subheader("Land interviews with effective networking messages.")
st.divider()
st.header("🎙️Interview Prep Assistant")
st.subheader("Get tailored interview questions and suggested answers to ace your next interview with confidence.")
st.divider()
st.subheader("Navigate effortlessly through each section using the sidebar menu, and let our app empower you on your journey to career success! 🌟")
st.divider()
st.subheader("About Sarthak")
st.image('me.jpg', caption='Sarthak Mishra', width=200)
st.write("MS CS graduate from University at Buffalo | Front End Development, AI, Data Analysis, UI/UX")
linkedin_url = "https://www.linkedin.com/in/sarthakmishraa/"
github_url = "https://github.com/sarthakmishraa"
portfolio_url = "http://sarthakmishra.lovestoblog.com/?i=2"
st.write("[LinkedIn](%s)" % linkedin_url)
st.write("[GitHub](%s)" % github_url)
st.write("[Digital Portfolio](%s)" % portfolio_url)
st.divider()
if selected == "ATS Resume Matcher":
st.title("ATS Resume Matcher using Gemini")
st.subheader("Enter your resume:")
resume = st.text_area(label=" ", value="", height=400, key=1)
st.subheader("Enter job description:")
job_desc = st.text_area(label=" ", value="", height=400, key=2)
prompt = f'''
I know you are an LLM but you have to act like a skilled or experienced ATS(Application Tracking System)
with a deep understanding of tech field,software engineering and data analyst. Your task is to evaluate the resume based on the given job description.
You must consider the job market is very competitive and you should provide
best assistance for improving the resumes. Assign the percentage Matching based
on Jd and the missing keywords with high accuracy
resume:{resume}
description:{job_desc}
I want the response in the below format, put JD match, missing keywords and profile summary in an new line
Job Description Match: %
MissingKeywords: []
Profile Summary: ""
'''
if st.button(label="Go"):
if resume=="" and job_desc=="":
st.error("Please enter the job description and your resume")
elif resume=="":
st.error("Please add your resume")
elif job_desc=="":
st.error("Please add the job description")
else:
with st.spinner("Wait for the app to generate the results..."):
result = model.generate_content(prompt)
st.write(result.text)
st.divider()
if selected == "Application Question Help":
st.title("Application question help using Gemini")
st.subheader("Enter your application question:")
app_ques = st.text_area(label=" ", value="", height=100, key=3)
st.subheader("Enter your resume:")
resume = st.text_area(label=" ", value="", height=400, key=1)
st.subheader("Enter job description:")
job_desc = st.text_area(label=" ", value="", height=400, key=2)
prompt = f'''
I know you are an LLM but you have to act like a skilled or experienced professional
with a deep understanding of tech field,software engineering and data analyst.
Your task is to answer a question for the job application I am filling based on the given job description.
You must consider the job market is very competitive and you should provide
best assistance for improving the resumes.
Application question: {app_ques}
resume:{resume}
job description:{job_desc}
I want the response in a paragraph.
'''
if st.button(label="Go"):
if resume=="" and job_desc=="" and app_ques=="":
st.error("Please enter the question, job description and your resume")
elif resume=="":
st.error("Please add your resume")
elif job_desc=="":
st.error("Please add the job description")
elif app_ques=="":
st.error("Please add the application question")
else:
with st.spinner("Wait for the app to generate the results..."):
result = model.generate_content(prompt)
st.write(result.text)
st.divider()
if selected == "Cover Letter Help":
st.title("Cover letter generator using Gemini")
st.subheader("Enter your resume:")
resume = st.text_area(label=" ", value="", height=400, key=1)
st.subheader("Enter job description:")
job_desc = st.text_area(label=" ", value="", height=400, key=2)
prompt = f'''
Write a cover letter for my resume and job description given below.
resume: {resume}
job description: {job_desc}
I want the response in three paragraphs.
'''
if st.button(label="Go"):
if resume=="" and job_desc=="":
st.error("Please enter the job description and your resume")
elif resume=="":
st.error("Please add your resume")
elif job_desc=="":
st.error("Please add the job description")
else:
with st.spinner("Wait for the app to generate the results..."):
result = model.generate_content(prompt)
st.write(result.text)
st.divider()
if selected == "Referral Message Help":
st.title("Referral message generator using Gemini")
st.subheader("Enter the role you're applying for:")
job_role = st.text_area(label=" ", value="", height=100, key=4)
st.subheader("Enter your resume:")
resume = st.text_area(label=" ", value="", height=400, key=1)
st.subheader("Enter job description:")
job_desc = st.text_area(label=" ", value="", height=400, key=2)
prompt = f'''
Write a very short message to ask for a referral for the role, my resume and job description given below.
Job role: {job_role}
resume: {resume}
job description: {job_desc}
I want the response in three paragraphs.
'''
if st.button(label="Go"):
if resume=="" and job_desc=="" and job_role=="":
st.error("Please enter the job description and your resume")
elif resume=="":
st.error("Please add your resume")
elif job_desc=="":
st.error("Please add the job description")
elif job_role=="":
st.error("Please add the job role")
else:
with st.spinner("Wait for the app to generate the results..."):
result = model.generate_content(prompt)
st.write(result.text)
st.divider()
if selected == "Interview Prep Assistant":
st.title("Interview Prep Assistant using Gemini")
st.subheader("Enter your resume:")
resume = st.text_area(label=" ", value="", height=400, key=1)
st.subheader("Enter job description:")
job_desc = st.text_area(label=" ", value="", height=400, key=2)
prompt = f'''
Write 15 interview questions and their answers, my resume and job description given below.
resume: {resume}
job description: {job_desc}
'''
if st.button(label="Go"):
if resume=="" and job_desc=="":
st.error("Please enter the job description and your resume")
elif resume=="":
st.error("Please add your resume")
elif job_desc=="":
st.error("Please add the job description")
else:
with st.spinner("Wait for the app to generate the results..."):
result = model.generate_content(prompt)
st.write(result.text)
st.divider()