MEOW commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -73,15 +73,15 @@ def load_documents(file_objs):
|
|
| 73 |
return f"Error loading documents: {str(e)}"
|
| 74 |
|
| 75 |
# Function to handle chat interactions
|
| 76 |
-
def chat(message,history):
|
| 77 |
-
global query_engine
|
| 78 |
-
if query_engine is None:
|
| 79 |
-
return history + [("Please upload a file first.",None)]
|
| 80 |
-
try:
|
| 81 |
-
response = query_engine.query(message)
|
| 82 |
-
return history + [(message,response)]
|
| 83 |
-
except Exception as e:
|
| 84 |
-
return history + [(message,f"Error processing query: {str(e)}")]
|
| 85 |
|
| 86 |
# Function to stream responses
|
| 87 |
def stream_response(message,history):
|
|
|
|
| 73 |
return f"Error loading documents: {str(e)}"
|
| 74 |
|
| 75 |
# Function to handle chat interactions
|
| 76 |
+
#def chat(message,history):
|
| 77 |
+
# global query_engine
|
| 78 |
+
# if query_engine is None:
|
| 79 |
+
# return history + [("Please upload a file first.",None)]
|
| 80 |
+
# try:
|
| 81 |
+
# response = query_engine.query(message)
|
| 82 |
+
# return history + [(message,response)]
|
| 83 |
+
# except Exception as e:
|
| 84 |
+
# return history + [(message,f"Error processing query: {str(e)}")]
|
| 85 |
|
| 86 |
# Function to stream responses
|
| 87 |
def stream_response(message,history):
|