Update app.py
Browse files
app.py
CHANGED
|
@@ -1107,11 +1107,11 @@ def traffic_ai_agent(user_query):
|
|
| 1107 |
|
| 1108 |
"AI TRAFFIC ANALYSIS\n"
|
| 1109 |
|
| 1110 |
-
f"EV vehicles detected: {ev}
|
| 1111 |
|
| 1112 |
-
f"
|
| 1113 |
|
| 1114 |
-
f"EV percentage: "
|
| 1115 |
f"{ev_percentage:.2f}%"
|
| 1116 |
|
| 1117 |
)
|
|
@@ -1138,10 +1138,10 @@ def traffic_ai_agent(user_query):
|
|
| 1138 |
|
| 1139 |
"AI TRAFFIC ANALYSIS\n\n"
|
| 1140 |
|
| 1141 |
-
f"Non-EV vehicles detected: "
|
| 1142 |
f"{non_ev}\n\n"
|
| 1143 |
|
| 1144 |
-
f"EV vehicles detected: {ev}\n\n"
|
| 1145 |
|
| 1146 |
f"Total vehicles: {total}"
|
| 1147 |
|
|
@@ -1202,14 +1202,13 @@ def traffic_ai_agent(user_query):
|
|
| 1202 |
|
| 1203 |
" AI INCENTIVE ANALYSIS\n\n"
|
| 1204 |
|
| 1205 |
-
f"EV vehicles: {ev}\n\n"
|
| 1206 |
|
| 1207 |
f"Discount per EV: "
|
| 1208 |
f"₹{EV_DISCOUNT}\n\n"
|
| 1209 |
|
| 1210 |
-
f"Total discount provided: "
|
| 1211 |
-
|
| 1212 |
-
|
| 1213 |
)
|
| 1214 |
|
| 1215 |
|
|
@@ -1257,7 +1256,7 @@ def traffic_ai_agent(user_query):
|
|
| 1257 |
f"Highest traffic date: "
|
| 1258 |
f"{highest['date']}\n\n"
|
| 1259 |
|
| 1260 |
-
f"Vehicles on highest traffic date: "
|
| 1261 |
f"{highest['vehicles']}"
|
| 1262 |
|
| 1263 |
)
|
|
@@ -1312,11 +1311,11 @@ def traffic_ai_agent(user_query):
|
|
| 1312 |
|
| 1313 |
" TRAFFIC ANALYSIS\n\n"
|
| 1314 |
|
| 1315 |
-
f"Total vehicles detected: {total}\n"
|
| 1316 |
|
| 1317 |
-
f"EV vehicles: {ev}\n"
|
| 1318 |
|
| 1319 |
-
f"Non-EV vehicles: {non_ev}"
|
| 1320 |
|
| 1321 |
)
|
| 1322 |
|
|
@@ -1337,20 +1336,21 @@ def traffic_ai_agent(user_query):
|
|
| 1337 |
or "environment" in query
|
| 1338 |
or "emission" in query
|
| 1339 |
or "CO2 savings" in query
|
|
|
|
| 1340 |
):
|
| 1341 |
|
| 1342 |
# Project-level illustrative estimate.
|
| 1343 |
# Replace with validated emission methodology
|
| 1344 |
# for final research evaluation.
|
| 1345 |
|
| 1346 |
-
estimated_co2 =
|
| 1347 |
|
| 1348 |
|
| 1349 |
response = (
|
| 1350 |
|
| 1351 |
" AI ENVIRONMENTAL ANALYSIS\n\n"
|
| 1352 |
|
| 1353 |
-
f"EV vehicles detected: {
|
| 1354 |
|
| 1355 |
f"Illustrative estimated CO₂ saving: "
|
| 1356 |
f"{estimated_co2:.2f} kg\n\n"
|
|
@@ -1394,7 +1394,7 @@ def traffic_ai_agent(user_query):
|
|
| 1394 |
f" EV Percentage: "
|
| 1395 |
f"{ev_percentage:.2f}%\n"
|
| 1396 |
|
| 1397 |
-
f"Total Discount: ₹{discount}"
|
| 1398 |
|
| 1399 |
)
|
| 1400 |
|
|
|
|
| 1107 |
|
| 1108 |
"AI TRAFFIC ANALYSIS\n"
|
| 1109 |
|
| 1110 |
+
f"EV vehicles detected are: {ev}"
|
| 1111 |
|
| 1112 |
+
f"out of {total} Total vehicles: \n"
|
| 1113 |
|
| 1114 |
+
f"EV vehicle percentage is : "
|
| 1115 |
f"{ev_percentage:.2f}%"
|
| 1116 |
|
| 1117 |
)
|
|
|
|
| 1138 |
|
| 1139 |
"AI TRAFFIC ANALYSIS\n\n"
|
| 1140 |
|
| 1141 |
+
f"Non-EV vehicles detected are: "
|
| 1142 |
f"{non_ev}\n\n"
|
| 1143 |
|
| 1144 |
+
f"EV vehicles detected are: {ev}\n\n"
|
| 1145 |
|
| 1146 |
f"Total vehicles: {total}"
|
| 1147 |
|
|
|
|
| 1202 |
|
| 1203 |
" AI INCENTIVE ANALYSIS\n\n"
|
| 1204 |
|
| 1205 |
+
f"EV vehicles are: {ev}\n\n"
|
| 1206 |
|
| 1207 |
f"Discount per EV: "
|
| 1208 |
f"₹{EV_DISCOUNT}\n\n"
|
| 1209 |
|
| 1210 |
+
f"Total discount provided is: ₹{discount} for {ev} vehicles"
|
| 1211 |
+
|
|
|
|
| 1212 |
)
|
| 1213 |
|
| 1214 |
|
|
|
|
| 1256 |
f"Highest traffic date: "
|
| 1257 |
f"{highest['date']}\n\n"
|
| 1258 |
|
| 1259 |
+
f"Vehicles on highest traffic date:{highest['date']} "
|
| 1260 |
f"{highest['vehicles']}"
|
| 1261 |
|
| 1262 |
)
|
|
|
|
| 1311 |
|
| 1312 |
" TRAFFIC ANALYSIS\n\n"
|
| 1313 |
|
| 1314 |
+
f"Total vehicles detected are: {total}\n"
|
| 1315 |
|
| 1316 |
+
f"No. of EV vehicles are: {ev}\n"
|
| 1317 |
|
| 1318 |
+
f"No. of Non-EV vehicles: {non_ev}"
|
| 1319 |
|
| 1320 |
)
|
| 1321 |
|
|
|
|
| 1336 |
or "environment" in query
|
| 1337 |
or "emission" in query
|
| 1338 |
or "CO2 savings" in query
|
| 1339 |
+
or "saving" in query
|
| 1340 |
):
|
| 1341 |
|
| 1342 |
# Project-level illustrative estimate.
|
| 1343 |
# Replace with validated emission methodology
|
| 1344 |
# for final research evaluation.
|
| 1345 |
|
| 1346 |
+
estimated_co2 = ev * 2.3
|
| 1347 |
|
| 1348 |
|
| 1349 |
response = (
|
| 1350 |
|
| 1351 |
" AI ENVIRONMENTAL ANALYSIS\n\n"
|
| 1352 |
|
| 1353 |
+
f"EV vehicles detected: {ev}\n\n"
|
| 1354 |
|
| 1355 |
f"Illustrative estimated CO₂ saving: "
|
| 1356 |
f"{estimated_co2:.2f} kg\n\n"
|
|
|
|
| 1394 |
f" EV Percentage: "
|
| 1395 |
f"{ev_percentage:.2f}%\n"
|
| 1396 |
|
| 1397 |
+
f"Total Discount provided: ₹{discount}"
|
| 1398 |
|
| 1399 |
)
|
| 1400 |
|