Spaces:
Runtime error
Runtime error
Srinivasulu kethanaboina commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -116,7 +116,7 @@ def save_chat_message(session_id, message_data):
|
|
| 116 |
def chat_interface(message, history,request: gr.Request):
|
| 117 |
try:
|
| 118 |
# Generate a unique session ID for this chat session
|
| 119 |
-
session_id = str(
|
| 120 |
|
| 121 |
# Process the user message and generate a response (your chatbot logic)
|
| 122 |
response = handle_query(message)
|
|
@@ -130,7 +130,7 @@ def chat_interface(message, history,request: gr.Request):
|
|
| 130 |
}
|
| 131 |
|
| 132 |
# Call the save function to store in Firebase with the generated session ID
|
| 133 |
-
save_chat_message(
|
| 134 |
|
| 135 |
# Return the bot response
|
| 136 |
return response
|
|
|
|
| 116 |
def chat_interface(message, history,request: gr.Request):
|
| 117 |
try:
|
| 118 |
# Generate a unique session ID for this chat session
|
| 119 |
+
session_id = str(request.client.host)
|
| 120 |
|
| 121 |
# Process the user message and generate a response (your chatbot logic)
|
| 122 |
response = handle_query(message)
|
|
|
|
| 130 |
}
|
| 131 |
|
| 132 |
# Call the save function to store in Firebase with the generated session ID
|
| 133 |
+
save_chat_message(session_id, message_data)
|
| 134 |
|
| 135 |
# Return the bot response
|
| 136 |
return response
|