File size: 1,860 Bytes
12c48e3
7ee5fa7
f4f0acf
7ee5fa7
 
12c48e3
7ee5fa7
12c48e3
 
7ee5fa7
 
 
 
12c48e3
 
7ee5fa7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: French Tutor
emoji: πŸš€
colorFrom: blue
colorTo: red
sdk: gradio
sdk_version: 4.31.0
app_file: app.py
pinned: false
secrets:
- MISTRAL_API_KEY
- GEMINI_API_KEY
- GROQ_API_KEY
---

# πŸ‡«πŸ‡· French Conversation Tutor

This is a Gradio app for practicing French conversation through natural speech interaction with Mr. Mistral!

**How it works:**
1. The app gives you a scenario and some helpful phrases.
2. You record your response in French using your microphone.
3. The AI tutor (Mr. Mistral) replies, and you have a short conversation (3 exchanges).
4. At the end, you get a detailed analysis of your grammar, pronunciation, and vocabulary.

**Tech Stack:**
- **Primary LLM:** Mistral AI (mistral-large-latest)
- **Fallback LLM:** Google Gemini API (gemini-1.5-flash-latest)
- **STT:** Groq API (Whisper large-v3-turbo)
- **TTS:** Groq API (TTS-1 model)
- **UI:** Gradio

The app will show which LLM is being used in the interface. It prioritizes Mistral AI, but falls back to Google Gemini if Mistral is unavailable.

**Features:**
- 🎀 Speech-to-text transcription of French audio
- πŸ”Š Text-to-speech for AI tutor responses
- πŸ’¬ Natural conversation flow
- πŸ“Š Detailed analysis after 3 exchanges
- 🎲 Random topic generation for variety
- πŸ€– Model indicator showing which AI is responding

**Setup:**
1. Create a `.env` file with:
   ```
   MISTRAL_API_KEY=your_mistral_api_key
   GEMINI_API_KEY=your_gemini_api_key  # Optional fallback
   GROQ_API_KEY=your_groq_api_key
   ```
   **Important:** Never commit your `.env` file to version control!
   
2. Install dependencies: `pip install -r requirements.txt`
3. Test your API keys: `python test_api_keys.py`
4. Run: `python app.py`

**For HuggingFace Spaces:**
- Add `MISTRAL_API_KEY`, `GEMINI_API_KEY` (optional), and `GROQ_API_KEY` in the Space's Settings > Variables and secrets