CabOps AI is a Streamlit app for handling cab operations incidents such as driver absence, vehicle breakdowns, bad weather, and backup capacity shortages. It calculates operational metrics, sends the incident context to Gemini, and returns a structured incident response with priority, dispatch strategy, impact, ready-to-send messages, and manual decision points.
demo.mp4
- Incident input form for route, client, driver absence, weather, breakdown details, and employee counts
- Pre-calculated operational metrics before the AI step
- Risk score and priority classification
- Gemini-powered response generation
- Recommended actions for dispatch and operations teams
- Ready messages for HR, employees, and backup drivers
- Streamlit interface for quick demo usage
.
|-- app.py # Streamlit app UI and response display
|-- business_logic.py # Metric, risk score, delay, and priority calculations
|-- LLM.py # Gemini API integration
|-- models.py # Data models
|-- prompt.py # System prompt and response rules
|-- requirements.txt # Python dependencies
`-- .gitignore # Local files excluded from Git
The risk score is calculated before calling Gemini. It gives the app a consistent operational severity signal.
Risk score =
+ 35 if a driver is marked absent
+ 30 if a vehicle breakdown is entered
+ 10 for Rain, or 20 for Heavy Rain
+ 5 for each waiting employee
+ 10 for each employee beyond backup vehicle capacity
Priority is then assigned from the score:
80 or more: Critical
60 to 79: High
35 to 59: Medium
Below 35: Low
- Python 3.10 or newer
- Gemini API key
- Git
Clone the repository:
git clone https://github.com/Tanmay0766/Cabops.git
cd CabopsCreate and activate a virtual environment:
python -m venv .venvOn Windows PowerShell:
.\.venv\Scripts\Activate.ps1Install dependencies:
pip install -r requirements.txtCreate a .env file in the project root:
GEMINI_API_KEY=your_gemini_api_key_hereRun the app:
streamlit run app.py- Enter the incident details in the form.
- Add the number of employees already picked and still waiting.
- Enter backup vehicle capacity.
- Select the weather condition.
- Add breakdown and client HR message details if available.
- Click
Analyze Incident. - Review the priority, dispatch strategy, impact, recommended actions, and ready messages.
The easiest demo deployment path is Streamlit Community Cloud.
- Push this repository to GitHub.
- Go to
https://share.streamlit.io. - Create a new app from the GitHub repository.
- Set the main file path to
app.py. - Add
GEMINI_API_KEYin the app secrets or environment settings. - Deploy the app.
Do not commit your .env file or API keys. This project already ignores .env, .venv, __pycache__, and Python bytecode files through .gitignore.
- Streamlit
- Python
- Google Gemini API
- python-dotenv