The Verbal Skills Trainer is a comprehensive application designed to help users improve their communication skills through various training modules and assessment tools. The application consists of a backend API built with FastAPI and a frontend interface built with Streamlit.
- Chat Interface: Engage in conversations with AI roles such as speech coaches or job interviewers.
- Voice Input: Transcribe and analyze voice input to provide feedback on verbal delivery.
- Presentation Assessment: Evaluate presentation skills using both text and audio input.
- Training Modules: Practice and improve specific communication skills through targeted training modules.
- Audio Feedback: Receive AI-generated audio feedback to enhance learning.
verbal_skills_trainer/
├── backend/ # Contains the backend API built with FastAPI
│ ├── main.py # Main application file for the FastAPI backend
│ ├── utils/ # Contains utility modules
│ │ ├── constants.py # Defines constant variables and settings
│ │ ├── database.py # Handles saving and loading user progress
│ │ ├── helper_functions.py # Implements helper functions for the API
│ │ ├── model_generation.py # Generates AI responses using OpenAI
│ ├── prompts/ # Contains prompt templates for different AI roles
│ │ ├── prompt_templates.py # Defines prompt templates used by the AI
│ ├── .env # Stores environment-specific variables
│ ├── config.py # Configures logging
│ ├── Dockerfile # Contains instructions for building a Docker image of the backend
│ ├── audio_files/ # Stores audio files generated by the application
│ ├── tests/ # Contains test files for the backend
│ │ ├── test_main.py # Tests the main application endpoints
│ │ ├── test.wav # A dummy audio file for testing
├── frontend/ # Contains the frontend interface built with Streamlit
│ └── app.py # Main application file for the Streamlit frontend
├── requirements.txt # Lists the Python packages required to run the application
├── .gitignore # Specifies intentionally untracked files that Git should ignore
- Python 3.11
pippackage installer
-
Clone the repository:
git clone <repository_url> cd verbal_skills_trainer/backend -
Create a virtual environment:
python -m venv venv -
Activate the virtual environment:
-
On Windows:
.\venv\Scripts\activate -
On macOS and Linux:
source venv/bin/activate
-
-
Install the required dependencies:
pip install -r requirements.txt -
Create a
.envfile in thebackend/directory and add your OpenAI API key:OPENAI_API_KEY="your_openai_api_key"
cd backend uvicorn main:app --host 0.0.0.0 --port 8000
The API will be accessible at http://localhost:8000.
- Python 3.11
pippackage installer
-
Navigate to the
frontend/directory:cd frontend -
Create a virtual environment (if you haven't already):
python -m venv venv -
Activate the virtual environment:
-
On Windows:
.\venv\Scripts\activate -
On macOS and Linux:
source venv/bin/activate
-
-
Install the required dependencies:
pip install -r requirements.txt
streamlit run app.py
The Streamlit app will open in your browser, usually at http://localhost:8501.
POST /chat/: Sends a chat message and receives an AI response.POST /voice/: Processes an uploaded audio file and returns a transcript, AI response, and audio feedback.POST /assess/: Assesses a presentation using either text or audio input and returns feedback.POST /train/: Starts a training module and receives feedback.GET /audio/{filename}: Retrieves an audio file.
To run the backend tests, navigate to the backend/ directory and run:
pytest
docker build -t verbal_skills_trainer_backend ./backend
docker run -p 8000:8000 verbal_skills_trainer_backend
The API will be accessible at http://localhost:8000.
The following environment variables can be set in the .env file:
OPENAI_API_KEY: OpenAI API key.OPENAI_ORGANIZATION: OpenAI organization ID.OPENAI_PROJECT: OpenAI project ID.XAI_API_KEY: XAI API key.USE_OPENAI: Flag to determine whether to use OpenAI or an alternative (e.g., xAI).DATABASE_FILE: Path to the database file for storing user progress.DEBUG: Flag to enable debug mode.API_URL: URL for the backend API (used by the frontend).