import streamlit as st from resume_parser import extract_resume_data from gemini_api import authenticate_gemini, generate_summary # Your hardcoded API key (You can also set this in environment variables) api_key = "AIzaSyCG-qpFRqJc0QOJT-AcAaO5XIEdE-nk3Tc" def main(): st.title("Resume Analyzer") st.write("Upload a resume to extract information") uploaded_file = st.file_uploader("Choose a PDF or DOCX file", type=["pdf", "docx", "doc"]) if uploaded_file is not None: try: # Authenticate with Google Gemini API model = authenticate_gemini(api_key) if model is None: return # Extract resume data extracted_data, resume_text = extract_resume_data(uploaded_file) # Generate summary using Gemini API summary = generate_summary(resume_text, model) # Display results st.subheader("Extracted Information") for key, value in extracted_data.items(): st.write(f"*{key}:* {value}") st.subheader("Generated Summary") st.write(summary) except Exception as e: st.error(f"Error during processing: {e}") if __name__ == "__main__": main()