Skip to content

Latest commit

 

History

History
245 lines (172 loc) · 5.28 KB

File metadata and controls

245 lines (172 loc) · 5.28 KB

Interview Copilot - Setup Guide

This is a real-time interview assistant application that provides AI-powered answers during interviews using Azure GPT-4o.

🏗️ Architecture

  • Backend: Python (FastAPI) with WebSocket support
  • Frontend: Electron + React + TypeScript
  • AI Services: Azure GPT-4o for LLM, Deepgram Nova-2 for Speech-to-Text

📋 Prerequisites

Backend Requirements

  • Python 3.10 or higher
  • pip (Python package manager)

Frontend Requirements

  • Node.js 18.x or higher
  • npm or yarn

API Keys Required

  1. Azure OpenAI API Key - Get from Azure Portal
  2. Deepgram API Key - Get from Deepgram Console

🚀 Installation

1. Backend Setup

# Navigate to backend folder
cd backend

# Create virtual environment (recommended)
python -m venv venv

# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Create .env file
# Copy the example and fill in your API keys

Create a .env file in the backend folder with the following:

# Azure OpenAI Configuration
AZURE_OPENAI_API_KEY=your_azure_openai_api_key_here
AZURE_OPENAI_ENDPOINT=https://your-resource-name.openai.azure.com/
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o
AZURE_OPENAI_API_VERSION=2024-02-15-preview

# Deepgram Configuration
DEEPGRAM_API_KEY=your_deepgram_api_key_here

# Server Configuration
HOST=0.0.0.0
PORT=8000
CORS_ORIGINS=http://localhost:3000,http://localhost:5173

2. Frontend Setup

# Navigate to frontend folder
cd frontend

# Install dependencies
npm install

# Or with yarn
yarn install

🎯 Running the Application

Start Backend Server

# In the backend folder
cd backend

# Activate virtual environment if not already active
# Windows: venv\Scripts\activate
# macOS/Linux: source venv/bin/activate

# Run the server
python main.py

The backend will start on http://localhost:8000

Start Frontend Application

# In the frontend folder (in a new terminal)
cd frontend

# Run in development mode
npm run dev

# Or with yarn
yarn dev

The Electron app will launch automatically.

🎮 Usage

Global Shortcuts

  • Ctrl+Shift+L - Toggle audio listening
  • Ctrl+Shift+S - Capture screen for coding problem analysis
  • Ctrl+Shift+H - Hide/Show the overlay window

Features

  1. Audio Capture

    • Click "Start Listening" or press Ctrl+Shift+L
    • When prompted, select the tab/window you want to capture audio from
    • IMPORTANT: Check "Share system audio" checkbox
    • The app will transcribe in real-time and provide AI answers
  2. Screen Capture

    • Click "Capture Screen" or press Ctrl+Shift+S
    • Select the screen/window to capture
    • The app will analyze coding problems using GPT-4o Vision
    • Provides complete solutions with explanations
  3. Overlay Window

    • Always on top of other windows
    • Draggable and resizable
    • Adjustable opacity
    • Minimizable

⚙️ Configuration

Backend Configuration

Edit backend/config.py or use environment variables in .env file.

Key settings:

  • AZURE_OPENAI_DEPLOYMENT_NAME: Your Azure GPT-4o deployment name
  • DEEPGRAM_API_KEY: Your Deepgram API key for STT
  • PORT: Backend server port (default: 8000)

Frontend Configuration

Edit frontend/src/services/websocket.ts to change backend URL if needed:

const BACKEND_URL = 'http://localhost:8000';

🏗️ Building for Production

Backend

The backend doesn't require building. Just ensure all dependencies are installed.

Frontend

cd frontend

# Build the app
npm run build

# Build Electron distributable
npm run build:electron

The built application will be in frontend/release/

🔧 Troubleshooting

Audio Capture Not Working

  • Ensure you check "Share system audio" when prompted
  • Try selecting a different audio source
  • Check browser/Electron permissions for audio capture

Backend Connection Failed

  • Verify backend is running on port 8000
  • Check CORS settings in .env
  • Ensure firewall allows the connection

Deepgram Errors

  • Verify your API key is correct
  • Check your Deepgram account has sufficient credits
  • Ensure internet connection is stable

Azure OpenAI Errors

  • Verify your API key and endpoint are correct
  • Check deployment name matches your Azure configuration
  • Ensure your Azure account has GPT-4o access

📊 Performance

Target latency: < 4 seconds (Speech-to-Answer)

Factors affecting latency:

  • Network speed
  • Azure OpenAI response time
  • Deepgram transcription speed
  • Audio quality

🔒 Security Notes

  • Keep your .env file secure and never commit it to git
  • API keys should never be exposed in frontend code
  • The app requires screen capture permissions
  • System audio capture requires user consent

📝 Development

Backend Development

cd backend
python main.py

The server runs with auto-reload enabled.

Frontend Development

cd frontend
npm run dev

Vite dev server runs on port 5173 with hot-reload.

🤝 Support

For issues or questions:

  1. Check the troubleshooting section
  2. Review API provider documentation
  3. Check console logs for errors

📄 License

See LICENSE file for details.