This project implements a multi-agent chatbot using the Groq API and Flask, allowing each agent to have specific training data and behavior. You can interact with the chatbot via POST requests for both chatting and training.
- Two pre-configured agents (
Agent1
andAgent2
). - Support for custom agent-specific training.
- Easy-to-use RESTful API for interaction.
- Python 3.8+
- A valid API Key from Groq (set in
.env
file).
- Clone this repository:
git clone https://github.com/yourusername/your-repo-name.git cd your-repo-name
- Create a virtual environment:
python -m venv venv source venv/bin/activate # Linux/MacOS venv\Scripts\activate # Windows
- Install dependencies:
pip install -r requirements.txt
- Create a
.env
file in the root directory:GROQ_API_KEY=your_api_key_here
- Run the application:
python app.py
- Access the API locally at
http://127.0.0.1:5000
.
-
Chat with an agent
POST
/chat/<agent_name>
- request Body:
{ "user_input": "hello!, i would like to know where you from" }
- response:
{ "response": "Hello! Welcome to Z! I'm happy to help you with that.." }
-
Train an agent
POST
/train/<agent_name>
- request Body:
{ "content": "You are Mario from Super Mario Bros. Answer as Mario, the assistant, only." }
- response:
{ "message": "Training updated successfully!" }
- Modify
training/
files for persistent updates to agent training. - Ensure your
.env
file is never should be shared for security purposes.
- This project is licensed under the MIT License.