Spaces:
Runtime error
Runtime error
| title: Voice Chat Assistant | |
| emoji: π’ | |
| colorFrom: gray | |
| colorTo: blue | |
| sdk: docker | |
| pinned: false | |
| license: apache-2.0 | |
| # Voice-Enabled Chat Application | |
| This is a web-based chat application that allows users to interact with a personal assistant through both text and voice. It features a clean user interface with light and dark modes and voice input. | |
| ## Features | |
| - **Personal Assistant:** The backend is powered by the Groq API to provide helpful and conversational responses. | |
| - **Text and Voice Input:** Users can type messages or use their microphone to speak to the assistant. | |
| - **Light/Dark Mode:** The user interface can be switched between light and dark themes for user comfort. | |
| - **Multi-language Speech-to-Text:** Users can select from multiple languages for speech-to-text transcription. | |
| - **Docker Support:** The application can be easily containerized and deployed using Docker. | |
| ## Technologies Used | |
| - **Docker** | |
| ### Frontend | |
| - HTML5 | |
| - CSS3 | |
| - JavaScript | |
| - jQuery | |
| - Bootstrap | |
| - Font Awesome | |
| ### Backend | |
| - Python | |
| - Flask | |
| - Flask-Cors | |
| - Groq API | |
| - SpeechRecognition | |
| ## Prerequisites | |
| - Python 3.x | |
| - `pip` for installing Python packages | |
| - A Groq API key | |
| ## Installation and Setup | |
| 1. **Clone the repository:** | |
| ```bash | |
| git clone https://github.com/your-username/chatapp-with-voice.git | |
| cd chatapp-with-voice | |
| ``` | |
| 2. **Create a virtual environment (optional but recommended):** | |
| ```bash | |
| python -m venv env | |
| source env/bin/activate # On Windows, use `env\Scripts\activate` | |
| ``` | |
| 3. **Install the required Python packages:** | |
| ```bash | |
| pip install -r requirements.txt | |
| ``` | |
| 4. **Set up your environment variables:** | |
| Create a `.env` file in the root of the project and add your Groq API key: | |
| ``` | |
| GROQ_API_KEY=your_groq_api_key | |
| ``` | |
| ## Usage | |
| To run the application, execute the following command from the root of the project: | |
| ```bash | |
| python -u server.py | |
| ``` | |
| The application will be available at `http://localhost:8000`. | |
| ## Project Structure | |
| ``` | |
| . | |
| βββ Dockerfile | |
| βββ LICENSE | |
| βββ README.md | |
| βββ requirements.txt | |
| βββ server.py | |
| βββ static | |
| β βββ js | |
| β β βββ WebAudioRecorder.min.js | |
| β β βββ WebAudioRecorderWav.min.js | |
| β βββ script.js | |
| β βββ style.css | |
| βββ templates | |
| β βββ index.html | |
| βββ worker.py | |
| ``` | |
| - `server.py`: The main Flask application file that handles routing and serves the web pages. | |
| - `worker.py`: Contains the core logic for speech-to-text and processing user messages with the Groq API. | |
| - `static/`: Contains the frontend JavaScript and CSS files. | |
| - `templates/`: Contains the HTML templates for the web pages. | |
| - `requirements.txt`: A list of the Python packages required for the project. | |
| - `Dockerfile`: Allows for building a Docker image of the application. | |
| ## License | |
| This project is licensed under the terms of the Apache-2.0 license. See the `LICENSE` file for more details. |