This Project was Given as a assignment by SETTYL INC This project implements a negotiation chatbot using the Google Gemini API. The chatbot simulates a negotiation process between a customer and a supplier for a product (in this case, Premium Wireless Headphones).
- Simulates a negotiation process with multiple rounds
- Uses Google's Gemini API for generating responses
- Implements basic pricing logic and sentiment analysis
- Provides both a Flask-based API and a command-line interface
Before you begin, ensure you have met the following requirements:
- Python 3.7 or higher
- pip (Python package manager)
- A Google Cloud account with access to the Gemini API
-
Clone this repository:
git clone https://github.com/yourusername/negotiation-chatbot.git cd negotiation-chatbot -
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate` -
Set up your Gemini API key:
- Go to https://makersuite.google.com/app/apikey
- Create a new API key if you don't have one
- Create a
.envfile in the project root and add your API key:GOOGLE_API_KEY=your_gemini_api_key_here
- Start the Flask server:
The server will start running on
python Negotiation.pyhttp://localhost:5000
You can also interact with the API directly using curl or any HTTP client:
curl -X POST http://localhost:5000/negotiate \
-H "Content-Type: application/json" \
-d '{"message": "I am interested in buying the headphones. What is your best price?", "history": []}'You can customize the product details, pricing logic, and negotiation parameters by modifying the relevant variables in app.py.
If you encounter any issues:
- Ensure your API key is correctly set in the
.envfile. - Check that all dependencies are installed correctly.
- Verify your internet connection and access to Google's servers.
Contributions to this project are welcome. Please fork the repository and submit a pull request with your changes.
This project is licensed under the MIT License - see the LICENSE file for details.
- Google for providing the Gemini API
- The Flask team for their excellent web framework
If you have any questions or feedback, please open an issue in this repository.