Skip to content

Commit 7a8f6bc

Browse files
authored
Merge pull request #4 from Public-Computing-Lab/experiment2
Experiment2
2 parents b140c38 + a4512fd commit 7a8f6bc

File tree

13 files changed

+431459
-2
lines changed

13 files changed

+431459
-2
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,8 @@ build/
7070
*.log
7171
gemini_api.key.txt
7272

73-
# Nova
74-
.nova
73+
# nova
74+
.nova
75+
76+
# vercel
77+
.vercel

.vercelignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
*.pyc
2+
__pycache__/
3+
*.pkl
4+
*.csv
5+
*.json
6+
*.xml
7+
*.yaml
8+
*.yml
9+
*.h5
10+
*.ckpt
11+
*.log
12+
*.txt
13+
*.md
14+
.vscode/
15+
.idea/
16+
*.ipynb
17+
node_modules/
18+
data/
19+
datasets/
20+
models/
21+
db/

experiment-2/Boston_Crime_Cleaned_v2.csv

Lines changed: 215207 additions & 0 deletions
Large diffs are not rendered by default.

experiment-2/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# ✅ Use the official Python slim image
2+
FROM python:3.11-slim
3+
4+
# ✅ Set working directory inside the container
5+
WORKDIR /app/ReThink_AI_Chatbot
6+
7+
# ✅ Copy everything from the current directory to the container
8+
COPY . .
9+
10+
# ✅ Ensure the database folder exists
11+
RUN mkdir -p /app/ReThink_AI_Chatbot/db
12+
13+
# ✅ Explicitly copy the CSV file
14+
COPY db/Boston_Crime_Cleaned_v2.csv /app/ReThink_AI_Chatbot/db/Boston_Crime_Cleaned_v2.csv
15+
16+
# ✅ Install dependencies
17+
RUN pip install --no-cache-dir -r requirements.txt
18+
19+
# ✅ Expose the correct port (Fly.io expects 8080)
20+
EXPOSE 8080
21+
22+
# ✅ Start the Flask app
23+
CMD ["gunicorn", "-b", "0.0.0.0:8080", "app:app"]

experiment-2/Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: gunicorn app:app

experiment-2/README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# RethinkAI
2+
3+
# 🔥 LLM Chatbot using Flask & Gemini API
4+
5+
This project is a **Flask-based chatbot** that interacts with **Google Gemini API** to provide intelligent responses. It processes user questions dynamically using a dataset stored in memory and allows users to provide feedback on responses.
6+
7+
## 📌 Features
8+
9+
-**Flask-based API** to interact with Google Gemini LLM.
10+
-**Gemini API Integration** for generating responses.
11+
-**Logging System** to track user queries and responses.
12+
-**Feedback System** (👍 / 👎) to collect user feedback.
13+
14+
---
15+
16+
## 🚀 Getting Started
17+
18+
### **1️⃣ Clone the Repository**
19+
20+
```sh
21+
git clone https://github.com/yourusername/llm-flask-chatbot.git
22+
cd llm-flask-chatbot
23+
24+
```
25+
26+
### **2️⃣ Create & Activate a Virtual Environment**
27+
28+
```sh
29+
python3 -m venv venv
30+
source venv/bin/activate # On Mac/Linux
31+
venv\Scripts\activate # On Windows
32+
```
33+
34+
### **3️⃣ Install Dependencies**
35+
36+
pip install -r requirements.txt
37+
38+
### **4️⃣ Setup Environment Variables**
39+
40+
- Create a .env file in the project root
41+
42+
```sh
43+
nano .env
44+
```
45+
46+
- Add the following:
47+
48+
```sh
49+
GEMINI_API_KEY=your_google_gemini_api_key
50+
```

0 commit comments

Comments
 (0)