import streamlit as st import google.generativeai as genai from dotenv import load_dotenv import os # Load environment variables load_dotenv() # Configure Gemini genai.configure(api_key=os.getenv("GEMINI_API_KEY")) model = genai.GenerativeModel('gemini-pro') def main(): st.title("JEE SOCA Analysis System 🚀") st.subheader("AI-Powered Skill Assessment for JEE Aspirants") with st.form("student_form"): st.header("Student Questionnaire") # Subject Knowledge st.subheader("📚 Subject Knowledge") math_score = st.slider("Mathematics Proficiency (1-10)", 1, 10) physics_score = st.slider("Physics Proficiency (1-10)", 1, 10) chemistry_score = st.slider("Chemistry Proficiency (1-10)", 1, 10) # Study Habits st.subheader("⏰ Study Habits") study_hours = st.number_input("Daily Study Hours", min_value=0, max_value=16) time_management = st.select_slider("Time Management Skills", options=["Poor", "Average", "Good", "Excellent"]) # Problem Solving st.subheader("🔍 Problem Solving") problem_approach = st.radio("Preferred Problem Solving Approach", ("Conceptual Understanding", "Formula Memorization", "Practice Problems")) # Stress Management st.subheader("🧘 Stress Management") stress_level = st.select_slider("Stress Level", options=["Very Low", "Low", "Moderate", "High", "Very High"]) # Submission submitted = st.form_submit_button("Generate SOCA Analysis") if submitted: with st.spinner("Analyzing responses..."): # Prepare prompt prompt = f"""Analyze this JEE student's profile and create a SOCA analysis: Subject Scores: - Mathematics: {math_score}/10 - Physics: {physics_score}/10 - Chemistry: {chemistry_score}/10 Study Habits: - Daily Study Hours: {study_hours} - Time Management: {time_management} Problem Solving: - Approach: {problem_approach} Stress Management: - Stress Level: {stress_level} Provide the analysis in this format: **Strengths:** [Identify 3 key strengths] **Opportunities:** [Suggest 3 improvement areas] **Challenges:** [List 3 main challenges] **Action Plan:** [Create 4 actionable steps] """ # Get Gemini response response = model.generate_content(prompt) # Display analysis st.subheader("SOCA Analysis Report") st.markdown(response.text) if __name__ == "__main__": main()