Spaces:
Running
Running
#!/usr/bin/env python3 | |
""" | |
Test script for the voice conversation feature. | |
Run this to test the voice conversation functionality. | |
""" | |
import os | |
import sys | |
# Add the src directory to the path | |
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src')) | |
try: | |
from fitness_gradio.ui.app import FitnessAppUI | |
print("β Successfully imported FitnessAppUI") | |
# Test creating the app | |
app = FitnessAppUI() | |
print("β Successfully created FitnessAppUI instance") | |
# Test getting the demo | |
demo = app.get_demo() | |
print("β Successfully got Gradio demo") | |
print("\nπ Voice conversation feature is ready!") | |
print("\nπ To launch the app, run:") | |
print("python scripts/run_gradio.py") | |
print("\nπ Voice Conversation Features:") | |
print("- π€ Start Voice Conversation button") | |
print("- π Automatic voice activity detection (VAD)") | |
print("- π£οΈ Speech-to-text using Groq Whisper") | |
print("- π€ AI responses using your selected model") | |
print("- π Text-to-speech using Groq TTS") | |
print("- π¬ Chat history preserved in main conversation") | |
print("- β Exit button to end voice chat") | |
print("\nβ οΈ Requirements:") | |
print("- GROQ_API_KEY environment variable must be set") | |
print("- Microphone access will be requested by the browser") | |
print("- Modern browser with JavaScript enabled") | |
except ImportError as e: | |
print(f"β Import error: {e}") | |
print("\nTry installing missing dependencies:") | |
print("pip install gradio groq soundfile") | |
except Exception as e: | |
print(f"β Error: {e}") | |
print("\nPlease check your setup and try again.") | |