ayush2917 commited on
Commit
7fbd607
·
verified ·
1 Parent(s): 2025201

Update backend/firebase_config.py

Browse files
Files changed (1) hide show
  1. backend/firebase_config.py +8 -1
backend/firebase_config.py CHANGED
@@ -27,4 +27,11 @@ def save_chat_message(user_input, krishna_response):
27
  ref.push({
28
  'user': user_input,
29
  'krishna': krishna_response
30
- })
 
 
 
 
 
 
 
 
27
  ref.push({
28
  'user': user_input,
29
  'krishna': krishna_response
30
+ })
31
+
32
+ def get_chat_history():
33
+ ref = db.reference('chat_history')
34
+ history = ref.get()
35
+ if history:
36
+ return [(msg['user'], msg['krishna']) for msg in history.values()]
37
+ return []