import streamlit as st from assistant import chat_with_hf_bot from resume_parser import extract_text_from_pdf from skill_matcher import match_skills from tracker import log_question from database import init_db, save_chat st.set_page_config(page_title="AI Career Coach", layout="wide") init_db() st.title("🎓 AI Career Coach") st.subheader("Chatbot + Resume Analysis + Weekly Guidance") tab1, tab2 = st.tabs(["💬 Chatbot", "📄 Resume Matcher"]) with tab1: user_input = st.text_input("Ask career-related questions:") if user_input: response = chat_with_hf_bot(user_input) save_chat(user_input, response) log_question(user_input) st.success(response) with tab2: uploaded_file = st.file_uploader("Upload your Resume (PDF only)", type="pdf") if uploaded_file: resume_text = extract_text_from_pdf(uploaded_file) st.markdown("**Extracted Skills from Resume:**") st.write(resume_text) matched_roles = match_skills(resume_text) st.markdown("**Suggested Roles based on Resume:**") for role in matched_roles: st.write(f"✅ {role}")