mr_mistral / README.md
dcrey7's picture
v1gradio
f4f0acf
---
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