This application allows users to generate interview mock tests based on a specified topic. It generates theory questions and coding problems.
Manas_Android_Research/
├── src/
│ ├── langchain_logic/
│ │ ├── __init__.py
│ │ ├── coding_prompt_template.txt
│ │ ├── question_generator.py
│ │ └── theory_prompt_template.txt
│ ├── static/
│ │ ├── index.html
│ │ ├── script.js
│ │ └── style.css
│ ├── main.py
│ └── pdf_exporter.py
├── requirements.txt
└── README.md
Follow these steps to run the application locally:
-
Prerequisites:
- Python 3.8 or higher.
pip(Python package installer).
-
Clone or Download the Code:
- Ensure you have all the files from the
Manas_Android_Researchdirectory.
- Ensure you have all the files from the
-
Navigate to the Project Directory:
cd path/to/Manas_Android_Research -
Create and Activate a Python Virtual Environment:
- It is highly recommended to use a virtual environment to manage dependencies.
# For Linux/macOS python3 -m venv venv source venv/bin/activate # For Windows python -m venv venv .\venv\Scripts\activate
-
Install Dependencies:
- Install all required Python packages using the
requirements.txtfile.
pip install -r requirements.txt
- Install all required Python packages using the
-
Set Environment Variables:
- This application requires API keys for Together AI (LLM provider) and Tavily (web search). You need to obtain these keys from their respective websites.
- Set the following environment variables in your terminal session before running the app:
# For Linux/macOS export TOGETHER_API_KEY="your_together_api_key_here" export TAVILY_API_KEY="your_tavily_api_key_here" # For Windows (PowerShell) $env:TOGETHER_API_KEY="your_together_api_key_here" $env:TAVILY_API_KEY="your_tavily_api_key_here" # For Windows (Command Prompt) set TOGETHER_API_KEY=your_together_api_key_here set TAVILY_API_KEY=your_tavily_api_key_here
- Replace
"your_together_api_key_here"and"your_tavily_api_key_here"with your actual API keys. - Note: Without these keys, the question generation will fail or produce limited results.
-
Run the Flask Application:
- Execute the main Python script to start the Flask development server.
python src/main.py
- The application will typically be available at
http://127.0.0.1:5000orhttp://localhost:5000in your web browser.
-
Access the Application:
- Open your web browser and navigate to the URL provided in the terminal output (usually
http://127.0.0.1:5000).
- Open your web browser and navigate to the URL provided in the terminal output (usually
- Topic Input: Enter any technical topic for which you want a mock test.
- Theory Questions: Generates 30 theory-based questions (basic to advanced, Bloom's taxonomy variety).
- Coding Questions: Generates 2 coding questions with problem statements, constraints, sample I/O, and difficulty tags.
- Web Search Augmentation: Uses Tavily search to augment LLM knowledge for more relevant theory questions.
- PDF Export: Export the generated mock test as a PDF document.
- Copy to Clipboard: Copy the generated mock test content to your clipboard.
- Backend: Python, Flask, Langchain, Together AI (LLM), Tavily Search API.
- Frontend: HTML, CSS, JavaScript.
- PDF Generation: WeasyPrint.
src/langchain_logic/theory_prompt_template.txt: Template for generating theory questions.src/langchain_logic/coding_prompt_template.txt: Template for generating coding questions.