Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,16 +14,53 @@ OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
|
| 14 |
|
| 15 |
prompt = """
|
| 16 |
|
| 17 |
-
You
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
| 22 |
|
| 23 |
-
|
| 24 |
|
| 25 |
-
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
"""
|
| 29 |
|
|
@@ -69,45 +106,11 @@ def call_openai_api(job_description, resume_text):
|
|
| 69 |
)
|
| 70 |
|
| 71 |
return completion.choices[0].message.content
|
| 72 |
-
|
| 73 |
-
# url = "https://api.openai.com/v1/chat/completions"
|
| 74 |
-
# headers = {
|
| 75 |
-
# "Content-Type": "application/json",
|
| 76 |
-
# "Authorization": f"Bearer {api_key}"
|
| 77 |
-
# }
|
| 78 |
-
#
|
| 79 |
-
# payload = {
|
| 80 |
-
# "model": "gpt-4o",
|
| 81 |
-
# "messages": [
|
| 82 |
-
# {"role": "system", "content": prompt},
|
| 83 |
-
# {"role": "user",
|
| 84 |
-
# "content": user_prompt}
|
| 85 |
-
# ],
|
| 86 |
-
# "temperature": 0.1,
|
| 87 |
-
# # "max_tokens": 385
|
| 88 |
-
# }
|
| 89 |
-
#
|
| 90 |
-
# async with aiohttp.ClientSession() as session:
|
| 91 |
-
# async with session.post(url, headers=headers, json=payload) as response:
|
| 92 |
-
# if response.status != 200:
|
| 93 |
-
# print(f"Error: {response.status}")
|
| 94 |
-
# return None
|
| 95 |
-
# response_json = await response.json()
|
| 96 |
-
# return response_json
|
| 97 |
|
| 98 |
def call_api(resume_text, job_description):
|
| 99 |
task = call_openai_api(job_description, resume_text)
|
| 100 |
return task
|
| 101 |
-
# async def main(resume_text, job_description):
|
| 102 |
-
# api_key = "sk-learning-bot-staging-account-SmwsiBUPWrJdslovYypiT3BlbkFJ70FRptLQcReZElmMFv6P"
|
| 103 |
-
#
|
| 104 |
-
# default_prompt = construct_default_prompt(resume_text, job_description)
|
| 105 |
-
# objective_prompt = construct_objective_prompt(resume_text)
|
| 106 |
-
#
|
| 107 |
-
# task1 = generate_completion(prompt, default_prompt, api_key)
|
| 108 |
-
# responses_async = await asyncio.gather(task1)
|
| 109 |
-
#
|
| 110 |
-
# return responses_async
|
| 111 |
|
| 112 |
|
| 113 |
st.set_page_config(page_title="Resume Analyzer", layout="centered")
|
|
@@ -134,11 +137,6 @@ if resume_file:
|
|
| 134 |
st.subheader("Resume Preview")
|
| 135 |
st.text_area("Resume", resume_text, height=200)
|
| 136 |
|
| 137 |
-
# def construct_default_prompt(resume_text, job_description):
|
| 138 |
-
# return f"Here is the resume text: {resume_text} \n Here is the job description: {job_description}"
|
| 139 |
-
#
|
| 140 |
-
# def construct_objective_prompt(resume_text):
|
| 141 |
-
# return f"Here is the resume text: {resume_text}"
|
| 142 |
|
| 143 |
if st.button("Analyze Resume"):
|
| 144 |
if job_description and resume_file:
|
|
|
|
| 14 |
|
| 15 |
prompt = """
|
| 16 |
|
| 17 |
+
You are tasked with creating a detailed and specific 10-Day Interview Preparation Guide for a user based on their resume and a provided job description. This guide should be tailored to prepare the user for an interview for the given job role. The guide should cover both technical and soft skills, with a focus on specific topics relevant to the job description. The preparation plan should balance revising concepts already known to the user and addressing any gaps in their knowledge.
|
| 18 |
|
| 19 |
+
Instructions:
|
| 20 |
|
| 21 |
+
Your responses for Day 1 and Day 10 will be fixed and as follows:
|
| 22 |
|
| 23 |
+
Day 1: Research & Initial Study
|
| 24 |
|
| 25 |
+
Your response for Day 1 should include -
|
| 26 |
|
| 27 |
+
Researching the company, its mission, and its products or services. Also, study the job description thoroughly to understand the key responsibilities and required skills. And finally, note down any unfamiliar terms or technologies for further research.
|
| 28 |
+
|
| 29 |
+
Day 10: Review and Final Preparation
|
| 30 |
+
|
| 31 |
+
Your response for Day 1 should include -
|
| 32 |
+
|
| 33 |
+
A review all the topics covered in the previous days.
|
| 34 |
+
|
| 35 |
+
Focus on the soft skills required for the role.
|
| 36 |
+
|
| 37 |
+
Conducting a final mock interview, including a variety of question types (behavioral, technical, situational, etc.), to ensure thorough preparation.
|
| 38 |
+
|
| 39 |
+
The remaining days (ie, days 2-9) will address specific aspects of the preparation that are most needed for the job and should include :
|
| 40 |
+
|
| 41 |
+
- For each day, provide a detailed plan focusing on specific technical skills, concepts, or tools that are relevant to the job role.
|
| 42 |
+
|
| 43 |
+
- Include concepts that align with both the user's existing knowledge (as indicated by their resume) and new areas that are essential according to the job description.
|
| 44 |
+
|
| 45 |
+
- Ensure there is a balance between reinforcing known skills and addressing knowledge gaps.
|
| 46 |
+
|
| 47 |
+
- Have each day or a group of day focus on a specific aspect or group of skills required for the job
|
| 48 |
+
|
| 49 |
+
Additional Requirements:
|
| 50 |
+
|
| 51 |
+
If there isn't enough content to cover over 10 individual days, combine multiple days to cover a single concepts in order to avoid repetition across different days
|
| 52 |
+
|
| 53 |
+
Within the points for each day avoid further subheadings
|
| 54 |
+
|
| 55 |
+
Speak to the user - "Your Resume..."
|
| 56 |
+
|
| 57 |
+
Simply begin by saying - "Here is your 10 Day Interview Prep Guide:"
|
| 58 |
+
|
| 59 |
+
The guide should be specific, with each day's tasks clearly outlined and explained.
|
| 60 |
+
|
| 61 |
+
The steps for each day should be detailed, with technical depth and practical advice.
|
| 62 |
+
|
| 63 |
+
Ensure the guide is practical and actionable, helping the user prepare effectively for their interview.
|
| 64 |
|
| 65 |
"""
|
| 66 |
|
|
|
|
| 106 |
)
|
| 107 |
|
| 108 |
return completion.choices[0].message.content
|
| 109 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
def call_api(resume_text, job_description):
|
| 112 |
task = call_openai_api(job_description, resume_text)
|
| 113 |
return task
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
|
| 116 |
st.set_page_config(page_title="Resume Analyzer", layout="centered")
|
|
|
|
| 137 |
st.subheader("Resume Preview")
|
| 138 |
st.text_area("Resume", resume_text, height=200)
|
| 139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
|
| 141 |
if st.button("Analyze Resume"):
|
| 142 |
if job_description and resume_file:
|