File size: 2,648 Bytes
b110ab4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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.")