Skip to content

HassanKhan610/ai-interviewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AI Interview Chatbot

A Streamlit app that simulates a job interview with an AI HR interviewer. You enter your background, pick a role and company, answer up to five questions in a live chat, then receive a scored performance review.

What it does

The app runs in three stages:

  1. Setup — Enter your name, experience, and skills. Choose interview level (Junior / Mid-level / Senior), position (e.g. Data Scientist, ML Engineer), and company (Amazon, Meta, Spotify, etc.).
  2. Interview — GPT-4o acts as an HR executive and conducts a short mock interview based on your profile. You can send up to 5 messages (intro + follow-up answers). Responses stream in real time.
  3. Feedback — After the interview, click Get Feedback to receive a score (1–10) and written feedback on your performance. Use Restart Interview to start over.

Prerequisites

  • Python 3.10+ (tested with 3.13)
  • An OpenAI API key with billing enabled (platform.openai.com)
  • Internet access (calls OpenAI API)

Project structure

streamlitapp/
├── app.py                 # Main Streamlit application
├── requirements.txt       # Python dependencies
├── .streamlit/
│   └── secrets.toml       # API key (not committed — see setup below)
├── .gitignore
└── README.md

Setup

1. Clone and enter the project

cd /path/to/streamlitapp

2. Create a virtual environment

python3 -m venv .venv
source .venv/bin/activate   # macOS/Linux
# .venv\Scripts\activate    # Windows

3. Install dependencies

pip install -r requirements.txt

4. Configure your OpenAI API key

Create .streamlit/secrets.toml in the project root (this file is gitignored):

API_KEY = "sk-your-openai-api-key-here"

The app reads the key via st.secrets["API_KEY"]. Do not commit this file.

Alternative (global secrets): you can place the same file at ~/.streamlit/secrets.toml.

Run the app

source .venv/bin/activate
streamlit run app.py

Streamlit opens in your browser (usually http://localhost:8501).

How to use

  1. Fill in Personal Information (name, experience, skills).
  2. Choose level, position, and company.
  3. Click Start Interview.
  4. Introduce yourself in the chat, then answer the interviewer’s questions (max 5 user messages).
  5. When the chat ends, click Get Feedback for your score and review.
  6. Click Restart Interview to reset and try again.

Configuration

Setting Location Default
OpenAI model app.pyst.session_state["openai_model"] gpt-4o
Max user messages app.pyuser_message_count < 5 5
Max chars per message st.chat_input(..., max_chars=1000) 1000

Tech stack

Troubleshooting

Issue Solution
StreamlitSecretNotFoundError Create .streamlit/secrets.toml with API_KEY = "sk-..."
ModuleNotFoundError: streamlit_js_eval Run pip install streamlit-js-eval inside .venv
insufficient_quota / 429 from OpenAI Add billing at OpenAI Billing
Wrong Python / missing packages Activate .venv and run pip install -r requirements.txt

Security notes

  • Never commit .streamlit/secrets.toml or expose your API key in code.
  • Interview content is sent to OpenAI for chat and feedback generation.

License

For personal / educational use unless otherwise specified.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages