File size: 1,394 Bytes
006fa6e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | """
Seeds the incident log CSV and ChromaDB with sample data for testing.
Run once: python -m utils.seed_data
"""
import sys, os
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
from utils.incident_logger import log_incident
from rag_module.vector_store import rebuild_from_csv
SAMPLE_INCIDENTS = [
("KA05MN1234", "car", "Gate_A", "normal", ""),
("MH12AB5678", "truck", "VIP_LOT", "unauthorized", "Heavy vehicle in VIP zone"),
("KA01XY9999", "car", "Gate_B", "flagged", "Reported stolen vehicle"),
("DL4CAF0001", "bus", "Gate_A", "normal", ""),
("TN09CD2222", "car", "COMPACT_ONLY","normal", ""),
("UNKNOWN", "car", "Gate_C", "flagged", "Plate unreadable"),
("KA05MN1234", "car", "Gate_A", "anomaly", "Same plate seen 6x in 10 min"),
("AP28PQ3344", "motorcycle", "Gate_B", "normal", ""),
("KA01XY9999", "car", "Gate_A", "unauthorized", "Blacklisted vehicle re-entry"),
("GJ05BK7777", "car", "Gate_A", "normal", ""),
]
print("Seeding incidents...")
for plate, cls, zone, status, notes in SAMPLE_INCIDENTS:
row = log_incident(plate, cls, zone, status, notes)
print(f" Logged: {row['id']} | {plate} | {status}")
print("\nRebuilding ChromaDB from CSV...")
rebuild_from_csv()
print("Done! You can now query the RAG pipeline.")
|