Skip to content

Latest commit

Β 

History

History
64 lines (48 loc) Β· 1.71 KB

File metadata and controls

64 lines (48 loc) Β· 1.71 KB

🧠 UPSC Mains Answer Generator

A Streamlit-powered AI app that generates structured, exam-oriented UPSC Mains-style answers using Google Gemini.
It follows official UPSC answer-writing best practices β€” with clear introductions, multi-dimensional subheadings, and crisp conclusions enriched with data, committee references, and government reports.


πŸš€ Features

βœ… Generates high-quality, analytical UPSC-style answers
βœ… Automatically structures answers with:

  • Introduction (2 lines, with data or background)
  • Multi-dimensional body (logical subheadings + bullet points)
  • Conclusion (2 lines, with optimism and real references)

βœ… Clean Streamlit UI with fixed footer
βœ… Adjustable word limit
βœ… Real-time generation using Google Gemini API


🧩 Tech Stack

Component Technology Used
Frontend/UI Streamlit
Backend Python
AI Model Google Gemini (via pydantic_ai)
Environment dotenv
Libraries streamlit, google-genai, pydantic, python-dotenv

βš™οΈ Installation & Setup

Follow the steps below to set up and run the UPSC Mains Answer Generator locally.


1. Clone the Repository

git clone https://github.com/laleetborse/upsc-answer-generator.git

cd upsc-answer-generator

2. Create and Activate a Virtual Environment

python3 -m venv venv
source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Configure Environment Variables

GEMINI_KEY=your_google_gemini_api_key_here

5. Run the Streamlit App

streamlit run main.py