KunaalNaik's picture
Update app.py
6416d81 verified
import streamlit as st
import google.generativeai as genai
# Header for the Streamlit app
st.header("Resume Maker")
# Retrieve the API key from Streamlit secrets
GOOGLE_API_KEY = st.secrets["GEMINI_API_KEY"]
# Configure the Google Generative AI API with your API key
genai.configure(api_key=GOOGLE_API_KEY)
# Text input for user prompt
user_input_resume = st.text_area("Enter your Resume", height = 100)
user_input_job_description = st.text_area("Enter JD", height = 100)
prompt = f"""
Imagine you are an ATS-compliant Resume Creator. Use my current resume:
{user_input_resume} and the new job description (JD):
{user_input_job_description} to create a tailored resume that incorporates
keywords from the JD and paraphrases them appropriately.
Start by creating a professional summary.
Then, list six main skill categories and organize all the relevant keywords
under each category in a comma-separated format.
Finally, update the 'Current Experience' section by including keywords from the JD.
"""
# Button to submit the prompt
if st.button("Generate"):
if user_input_resume:
# Initialize the model
model = genai.GenerativeModel('gemini-pro') # Assuming this is the correct model
try:
# Generate content based on the user's input
response = model.generate_content(prompt)
# Display the generated content
st.write("Generated Content:")
st.write(response.text)
except Exception as e:
st.error(f"Error: {e}")
else:
st.error("Please enter a prompt.")