File size: 2,275 Bytes
832b772
a487466
 
 
 
 
 
 
832b772
a487466
 
832b772
 
a487466
832b772
a487466
832b772
a487466
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
title: Catherine's Catering Voice Simulator
emoji: 🎤
colorFrom: blue
colorTo: purple
sdk: streamlit
sdk_version: 1.37.1
app_file: app.py
pinned: false
license: mit
short_description: Voice role-play simulator for business interviews
---

# Catherine's Catering Voice Simulator

A real-time, voice-to-voice interview simulator featuring Catherine, owner of Catherine's Catering. This application uses OpenAI's Realtime API to provide an interactive role-play experience for business consulting students.

## Features

- **Voice-only interaction** using OpenAI's Realtime API over WebRTC
- **Role-play simulation** with Catherine, a non-technical small business owner
- **Time-limited sessions** (5 minutes per group)
- **Group-based authentication** (groups 1-7)
- **Real-time audio** with automatic voice detection

## How to Use

1. **Set up your OpenAI API key** in the Space's secrets
2. **Login** using group credentials (group1-group7, password same as username)
3. **Start a conversation** and speak directly to Catherine
4. **Interview Catherine** about her catering business challenges
5. **Session automatically ends** after 5 minutes

## Setup for Local Development

1. Create and activate a virtual environment:
   ```bash
   python -m venv .venv && source .venv/bin/activate
   ```

2. Install dependencies:
   ```bash
   pip install -r requirements.txt
   ```

3. Set your OpenAI API key:
   ```bash
   export OPENAI_API_KEY=sk-...
   ```

4. Run the application:
   ```bash
   streamlit run app.py
   ```

## Environment Variables

- `OPENAI_API_KEY`: Your OpenAI API key with Realtime access
- `OPENAI_REALTIME_MODEL`: Model to use (default: gpt-4o-realtime-preview-2024-12-17)
- `OPENAI_VOICE`: Voice selection (default: shimmer)

## Technical Details

- **Backend**: FastAPI server for token management
- **Frontend**: Streamlit with embedded HTML client
- **Audio**: WebRTC for real-time voice communication
- **Authentication**: HTTP Basic Auth for group access
- **Time Management**: 5-minute session limits per group

## Troubleshooting

- Ensure microphone permissions are granted
- Check that your OpenAI API key has Realtime access
- Some corporate networks may block WebRTC connections
- Verify the token server is running at the expected port