This project is a Django-based chatbot and rest-api application that uses Django Channels for real-time WebSocket communication and Google Generative AI for generating chat responses in addition to an endpoint for generating text based on image input using Gemini API.
Follow these steps to set up the project environment and run the server:
Open your terminal or command prompt and run:
git clone https://github.com/Aya-Jafar/Gemini-API.git
cd your-repository
Creating a virtual environment isolates your project dependencies. Use the following commands based on your operating system:
python3 -m venv env
Activate the virtual environment with the following commands:
source env/bin/activate
source env\Scripts\activate
With the virtual environment activated, install the necessary Python packages from requirements.txt:
pip install -r requirements.txt
With the virtual environment activated, install the necessary Python packages from requirements.txt:
DJANGO_SECRET_KEY=your_project_secret_key
GEMINI_API_KEY=your_gemini_api_key
In a new terminal window, start the Daphne server for WebSocket support:
daphne Gemini_API.asgi:application