I am utilizing the GPT API to obtain skill recommendations for enhancing a resume. The input parameters include the job description, keywords extracted from the job description, and existing skills. The objective is to generate a list of additional skills that would make the resume more competitive for the desired role.
import openai
api_key = ‘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’
openai.api_key = api_key
def get_gpt_response(prompt, model=”gpt-3.5-turbo”, max_tokens=150):
try:
messages = [{“role”: “user”, “content”: prompt}]
response = client.chat.completions.create(
model=model,
messages=messages,
max_tokens=max_tokens,
temperature=0.5
)
message_content = response.choices[0].message.content
except Exception as e:
print(f”An error occurred: {e}”)
return None
def recommend_skills(existing_skills, job_description, job_keywords, model=”gpt-3.5-turbo”):
prompt = (
f”Given the following existing skills: {existing_skills}, and the following job description: {job_description} ”
f”with these keywords: {job_keywords}, recommend additional skills that would be beneficial for the role.”
)
response = get_gpt_response(prompt, model=model, max_tokens=200)
return response
if name == “main“:
existing_skills = [“Java”, “Python”, “Data Analysis”, “Machine Learning”, “SQL”, “Business Analytics”]
# sample job description
job_description = “””
Qualifications
Bachelor's Degree in Statistics, Mathematics, Analytics, Engineering, Computer Science, Marketing, Business, Economics or related field AND 2+ years experience in data analysis and reporting, business intelligence, or business and financial analysis
OR Master's Degree in Mathematics, Analytics, Engineering, Computer Science, Marketing, Business, Economics or related field
OR equivalent experience.
“”” #key words from job description
job_keywords = [
“Strategic planning”, “Business Analyst”, “data quality”, “communication”,
“stakeholders”, “leadership”, “Demand forecasting”, “data analysis”, “integration”, “execution excellence”, “compliance”,
“business enablement”, “data insights”, “collaborating”, “metrics”, “policies”, “standards”, “risk control”,
“cross-group coordination”, “agile workload management”, “analytical approach”
]
recommended_skills = recommend_skills(existing_skills, job_description, job_keywords)
print("Recommended Skills:")
print(recommended_skills)
and I keep getting “Recommended Skills:
None” Could someone give me a pointer where this problem is coming from?
Biruk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.