A Flask-based web application that acts as a conversational bot (CometVerse) for the Jindal School of Management (JSOM) at UT Dallas. The bot uses the Groq API to provide answers to questions based on pre-scraped data stored in a JSON file. To view the technical architecture and product market study View Full Project Report (PDF)
- Answers questions about JSOM using pre-scraped web content.
- Provides audio responses via text-to-speech (gTTS).
- Includes source links and contact information in responses.
- Handles large datasets with token limit management for the Groq API.
- Python 3.8 or higher
- Git (for cloning the repository)
- An API key from Groq (sign up at https://console.groq.com)
-
Clone the Repository
git clone https://github.com/your-username/your-repo.git cd your-repo -
Set Up a Virtual Environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies
pip install -r requirements.txt
-
Configure Environment Variables
- Create a
.envfile in the root directory. - Add your Groq API key:
GROQ_API_KEY=your_groq_api_key_here
- Create a
-
Prepare Scraped Data
- Ensure
scraped_data.jsonis in the root directory with the expected format (a list of objects withurlandcontentfields). Example:[ {"url": "https://jindal.utdallas.edu/", "content": "Jindal School content..."}, {"url": "https://utdallas.edu/", "content": "UT Dallas content..."} ]
- Ensure
-
Run the Application
python app.py
- The app will run on
http://0.0.0.0:5001by default.
- The app will run on
-
Interact with the Bot
- Use a tool like Postman or a custom frontend to send POST requests to
/askwith a JSON body:{ "text_question": "What is the impact of mentors?" }
- The response will include `answer`, `audio` (URL to an MP3 file), `link`, and `contact` fields. - Use a tool like Postman or a custom frontend to send POST requests to
- Adjust
max_entries,max_content_length, andmax_tokensinapp.pyto manage token limits for the Groq API. - Modify the port in
app.run()if needed (default is 5001).
- Groq API for AI capabilities.
- gTTS for text-to-speech functionality.
- UT Dallas Jindal School of Management for the content inspiration.
