Spaces:
Sleeping
Sleeping
import streamlit as st | |
import os | |
from dotenv import load_dotenv | |
from langchain_community.llms import OpenAI | |
from langchain_google_genai import ChatGoogleGenerativeAI | |
# Load environment variables | |
load_dotenv() | |
def generate_resume(details): | |
prompt = f""" | |
Create an ATS-optimized resume based on the following details: | |
Name: {details['name']} | |
Contact Information: {details['contact']} | |
LinkedIn Profile: {details['linkedin']} | |
Professional Summary: {details['summary']} | |
Work Experience: {details['experience']} | |
Education: {details['education']} | |
Skills: {details['skills']} | |
Certifications: {details['certifications']} | |
Projects: {details['projects']} | |
Provide the resume in a well-structured format. | |
""" | |
llm = OpenAI(temperature=0.7, openai_api_key=st.secrets["OPENAI_API_KEY"]) | |
resume = llm(prompt) | |
return resume | |
def app(): | |
st.title("Profile Detail") | |
with st.form("profile_form"): | |
st.header("Enter your details to generate an ATS-optimized resume") | |
name = st.text_input("Name") | |
contact = st.text_area("Contact Information (phone, email, address)") | |
linkedin = st.text_input("LinkedIn Profile URL") | |
summary = st.text_area("Professional Summary") | |
experience = st.text_area("Work Experience (provide details of each job including company name, job title, duration, and responsibilities)") | |
education = st.text_area("Education (provide details of degrees, institutions, and graduation dates)") | |
skills = st.text_area("Skills (list your skills)") | |
certifications = st.text_area("Certifications (list any relevant certifications)") | |
projects = st.text_area("Projects (provide details of your projects)") | |
submitted = st.form_submit_button("Generate Resume") | |
if submitted: | |
if name and contact and linkedin and summary and experience and education and skills and certifications and projects: | |
details = { | |
'name': name, | |
'contact': contact, | |
'linkedin': linkedin, | |
'summary': summary, | |
'experience': experience, | |
'education': education, | |
'skills': skills, | |
'certifications': certifications, | |
'projects': projects | |
} | |
resume = generate_resume(details) | |
st.header("Generated Resume") | |
st.text(resume) | |
else: | |
st.error("Please fill in all the fields to generate the resume.") | |