Ancastal commited on
Commit
178cdea
Β·
verified Β·
1 Parent(s): 52819f4

Delete populate_sample_data.py

Browse files
Files changed (1) hide show
  1. populate_sample_data.py +0 -81
populate_sample_data.py DELETED
@@ -1,81 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Sample data population script for the LLM Chatbot database.
4
- This script adds realistic sample transactions to help test the dashboard.
5
- """
6
-
7
- import sys
8
- import os
9
- sys.path.append(os.path.join(os.path.dirname(__file__), 'src'))
10
-
11
- from chatbot import Chatbot
12
- from models import ChatbotRequest
13
-
14
- def populate_sample_data():
15
- """Add sample transactions to the database"""
16
-
17
- print("πŸ”§ Populating database with sample transactions...")
18
-
19
- # Sample transactions to add
20
- sample_transactions = [
21
- # Purchases
22
- "Add a purchase of 100 wireless mice from TechMart at €25 each",
23
- "Add a purchase of 50 laptop stands from Office Supplies Co at €35 each",
24
- "Add a purchase of 30 webcams from Electronics Plus at €80 each",
25
- "Add a purchase of 75 desk lamps from Office Supplies Co at €40 each",
26
- "Add a purchase of 20 printers from TechMart at €200 each",
27
- "Add a purchase of 60 surge protectors from Electronics Plus at €15 each",
28
- "Add a purchase of 40 ethernet cables from TechMart at €12 each",
29
- "Add a purchase of 15 projectors from Electronics Plus at €450 each",
30
-
31
- # Sales
32
- "Sold 80 wireless mice to StartupTech Corp at €35 each",
33
- "Sold 30 laptop stands to Creative Agency Ltd at €50 each",
34
- "Sold 25 webcams to Remote Work Solutions at €120 each",
35
- "Sold 50 desk lamps to Modern Office Inc at €55 each",
36
- "Sold 12 printers to Small Business Hub at €280 each",
37
- "Sold 45 surge protectors to Tech Solutions Ltd at €25 each",
38
- "Sold 35 ethernet cables to Network Systems Corp at €18 each",
39
- "Sold 10 projectors to Conference Center Co at €650 each",
40
- "Sold 5 laptops to Freelance Collective at €1400 each",
41
- "Sold 25 monitors to Design Studio Ltd at €380 each",
42
- ]
43
-
44
- chatbot = Chatbot()
45
-
46
- try:
47
- successful_transactions = 0
48
- failed_transactions = 0
49
-
50
- for transaction in sample_transactions:
51
- try:
52
- print(f"πŸ“ Processing: {transaction}")
53
- request = ChatbotRequest(message=transaction)
54
- response = chatbot.process_message(request)
55
-
56
- if "recorded" in response.response.lower():
57
- successful_transactions += 1
58
- print(f"βœ… Success: {response.response}")
59
- else:
60
- failed_transactions += 1
61
- print(f"⚠️ Warning: {response.response}")
62
-
63
- except Exception as e:
64
- failed_transactions += 1
65
- print(f"❌ Error processing transaction: {e}")
66
-
67
- print(f"\nπŸ“Š Summary:")
68
- print(f"βœ… Successful transactions: {successful_transactions}")
69
- print(f"❌ Failed transactions: {failed_transactions}")
70
- print(f"🎯 Total attempted: {len(sample_transactions)}")
71
-
72
- if successful_transactions > 0:
73
- print(f"\nπŸŽ‰ Database populated with {successful_transactions} sample transactions!")
74
- print("πŸ’‘ You can now run the dashboard to see meaningful data.")
75
- print("πŸš€ Run 'python run_gui.py' to launch the Gradio interface.")
76
-
77
- finally:
78
- chatbot.close()
79
-
80
- if __name__ == "__main__":
81
- populate_sample_data()