Spaces:
Runtime error
Runtime error
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,109 +1,120 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
-
|
| 20 |
-
-
|
| 21 |
-
-
|
| 22 |
-
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
-
|
| 31 |
-
-
|
| 32 |
-
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
```
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
βββ
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
This project is licensed under the terms of the Apache-2.0 license. See the `LICENSE` file for more details.
|
|
|
|
| 1 |
+
|
| 2 |
+
---
|
| 3 |
+
title: Voice Chat Assistant
|
| 4 |
+
emoji: π’
|
| 5 |
+
colorFrom: gray
|
| 6 |
+
colorTo: blue
|
| 7 |
+
sdk: docker
|
| 8 |
+
pinned: false
|
| 9 |
+
license: apache-2.0
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# Voice-Enabled Chat Application
|
| 13 |
+
|
| 14 |
+
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.
|
| 15 |
+
|
| 16 |
+
## Features
|
| 17 |
+
|
| 18 |
+
- **Personal Assistant:** The backend is powered by the Groq API to provide helpful and conversational responses.
|
| 19 |
+
- **Text and Voice Input:** Users can type messages or use their microphone to speak to the assistant.
|
| 20 |
+
- **Light/Dark Mode:** The user interface can be switched between light and dark themes for user comfort.
|
| 21 |
+
- **Multi-language Speech-to-Text:** Users can select from multiple languages for speech-to-text transcription.
|
| 22 |
+
- **Docker Support:** The application can be easily containerized and deployed using Docker.
|
| 23 |
+
|
| 24 |
+
## Technologies Used
|
| 25 |
+
|
| 26 |
+
- **Docker**
|
| 27 |
+
|
| 28 |
+
### Frontend
|
| 29 |
+
|
| 30 |
+
- HTML5
|
| 31 |
+
- CSS3
|
| 32 |
+
- JavaScript
|
| 33 |
+
- jQuery
|
| 34 |
+
- Bootstrap
|
| 35 |
+
- Font Awesome
|
| 36 |
+
|
| 37 |
+
### Backend
|
| 38 |
+
|
| 39 |
+
- Python
|
| 40 |
+
- Flask
|
| 41 |
+
- Flask-Cors
|
| 42 |
+
- Groq API
|
| 43 |
+
- SpeechRecognition
|
| 44 |
+
|
| 45 |
+
## Prerequisites
|
| 46 |
+
|
| 47 |
+
- Python 3.x
|
| 48 |
+
- `pip` for installing Python packages
|
| 49 |
+
- A Groq API key
|
| 50 |
+
|
| 51 |
+
## Installation and Setup
|
| 52 |
+
|
| 53 |
+
1. **Clone the repository:**
|
| 54 |
+
|
| 55 |
+
```bash
|
| 56 |
+
git clone https://github.com/your-username/chatapp-with-voice.git
|
| 57 |
+
cd chatapp-with-voice
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
2. **Create a virtual environment (optional but recommended):**
|
| 61 |
+
|
| 62 |
+
```bash
|
| 63 |
+
python -m venv env
|
| 64 |
+
source env/bin/activate # On Windows, use `env\Scripts\activate`
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
3. **Install the required Python packages:**
|
| 68 |
+
|
| 69 |
+
```bash
|
| 70 |
+
pip install -r requirements.txt
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
4. **Set up your environment variables:**
|
| 74 |
+
|
| 75 |
+
Create a `.env` file in the root of the project and add your Groq API key:
|
| 76 |
+
|
| 77 |
+
```
|
| 78 |
+
GROQ_API_KEY=your_groq_api_key
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
## Usage
|
| 82 |
+
|
| 83 |
+
To run the application, execute the following command from the root of the project:
|
| 84 |
+
|
| 85 |
+
```bash
|
| 86 |
+
python -u server.py
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
The application will be available at `http://localhost:8000`.
|
| 90 |
+
|
| 91 |
+
## Project Structure
|
| 92 |
+
|
| 93 |
+
```
|
| 94 |
+
.
|
| 95 |
+
βββ Dockerfile
|
| 96 |
+
βββ LICENSE
|
| 97 |
+
βββ README.md
|
| 98 |
+
βββ requirements.txt
|
| 99 |
+
βββ server.py
|
| 100 |
+
βββ static
|
| 101 |
+
β βββ js
|
| 102 |
+
β β βββ WebAudioRecorder.min.js
|
| 103 |
+
β β βββ WebAudioRecorderWav.min.js
|
| 104 |
+
β βββ script.js
|
| 105 |
+
β βββ style.css
|
| 106 |
+
βββ templates
|
| 107 |
+
β βββ index.html
|
| 108 |
+
βββ worker.py
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
- `server.py`: The main Flask application file that handles routing and serves the web pages.
|
| 112 |
+
- `worker.py`: Contains the core logic for speech-to-text and processing user messages with the Groq API.
|
| 113 |
+
- `static/`: Contains the frontend JavaScript and CSS files.
|
| 114 |
+
- `templates/`: Contains the HTML templates for the web pages.
|
| 115 |
+
- `requirements.txt`: A list of the Python packages required for the project.
|
| 116 |
+
- `Dockerfile`: Allows for building a Docker image of the application.
|
| 117 |
+
|
| 118 |
+
## License
|
| 119 |
+
|
| 120 |
This project is licensed under the terms of the Apache-2.0 license. See the `LICENSE` file for more details.
|