Skip to content

RakeshGowdaSN/verbal_skills_trainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Verbal Skills Trainer

Overview

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.

Features

  • 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.

Project Structure


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

Backend Setup

Prerequisites

  • Python 3.11
  • pip package installer

Installation

  1. Clone the repository:

    git clone <repository_url>
    cd verbal_skills_trainer/backend
    
  2. Create a virtual environment:

    python -m venv venv
    
  3. Activate the virtual environment:

    • On Windows:

      .\venv\Scripts\activate
      
    • On macOS and Linux:

      source venv/bin/activate
      
  4. Install the required dependencies:

    pip install -r requirements.txt
    
  5. Create a .env file in the backend/ directory and add your OpenAI API key:

    OPENAI_API_KEY="your_openai_api_key"
    

Running the Backend

cd backend uvicorn main:app --host 0.0.0.0 --port 8000

The API will be accessible at http://localhost:8000.

Frontend Setup

Prerequisites

  • Python 3.11
  • pip package installer

Installation

  1. Navigate to the frontend/ directory:

    cd frontend
    
  2. Create a virtual environment (if you haven't already):

    python -m venv venv
    
  3. Activate the virtual environment:

    • On Windows:

      .\venv\Scripts\activate
      
    • On macOS and Linux:

      source venv/bin/activate
      
  4. Install the required dependencies:

    pip install -r requirements.txt
    

Running the Frontend

streamlit run app.py

The Streamlit app will open in your browser, usually at http://localhost:8501.

API Endpoints

  • 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.

Testing

To run the backend tests, navigate to the backend/ directory and run:

pytest

Docker

Building the Docker Image

docker build -t verbal_skills_trainer_backend ./backend

Running the Docker Container

docker run -p 8000:8000 verbal_skills_trainer_backend

The API will be accessible at http://localhost:8000.

Environment Variables

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).

About

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.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages