Resume-grounded, bilingual (EN + 中文) mock interview copilot with browser voice input and streaming responses.
Quickstart · Features · Architecture · API · Notes
This project helps you practice mock interviews by generating interview-ready answers that are grounded in your resume.json, while supporting text + voice input and streaming output in the browser.
- 🎤 Voice + Text: Web Speech API recognition in the browser (Chrome recommended)
- 🧾 Resume-grounded: answers are anchored to
resume.jsonto avoid made-up experience - ⚡ Streaming: token streaming from FastAPI to UI
- 🧠 Session memory:
/new-session+/chat/stream - 🌍 Bilingual output: English answer + Chinese explanation (固定输出结构)
- Start the server, then open
http://127.0.0.1:8000 - Type a question, or click the voice button to speak
flowchart TD
UI["Browser UI<br/>Text + Voice"] -->|"Web Speech API"| ASR["Speech Recognition"]
UI -->|"HTTP"| API["FastAPI"]
API -->|"load"| RESUME["resume.json"]
API -->|"prompt + resume grounding"| LLM["OpenAI Chat Completions<br/>streaming"]
LLM -->|"tokens"| API
API -->|"StreamingResponse"| UI
- Python 3.10+
- An OpenAI API key in
OPENAI_API_KEY
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirement.txtexport OPENAI_API_KEY="your_api_key"This file is loaded on startup and injected into the system prompt.
Example:
{
"name": "Your Name",
"skills": ["Java", "Kubernetes"],
"projects": [
{
"name": "Project A",
"tech_stack": ["Spring Boot"],
"details": ["Built APIs"],
"impact": "Improved performance"
}
]
}uvicorn main:app --reloadThen open http://127.0.0.1:8000.
main.py: loadsresume.json, builds a bilingual system prompt, streams model tokens back to the browserstatic/index.html: minimal chat UI + voice recognition + optional TTS
GET /new-session→ returns{ "session_id": "..." }POST /chat/stream→ streams plain text tokens
Request body:
{ "session_id": "...", "message": "..." }Click to expand
[Keywords]
- ...
[Answer - English]
...
[Answer - 中文]
...
- Voice not working: use Chrome, allow microphone permissions, then reload.
- Mixed Chinese/English recognition: tweak
recog.langinstatic/index.html(e.g.zh-CN/en-US). - Prompt too long / slow: keep
resume.jsonconcise (avoid large raw text blocks). - Missing API key: ensure
OPENAI_API_KEYis set in your shell environment.
- Real-time voice streaming (no manual stop)
- Better UI/UX (chat bubbles, markdown rendering)
- Persistent chat history (Redis/DB)
- Multi-user auth + interviewer mode