Update backend/firebase_config.py
Browse files
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 []
|