Update app.py
Browse files
app.py
CHANGED
@@ -91,6 +91,7 @@ def handle_input(user_input, state):
|
|
91 |
if state['mode'] == 'waiting_for_upload':
|
92 |
state['chat_history'].append(("Bot", "Please upload a file first."))
|
93 |
logger.info("User attempted to interact without uploading a file.")
|
|
|
94 |
elif state['mode'] == 'waiting_for_query':
|
95 |
query = user_input
|
96 |
state['current_query'] = query
|
@@ -105,6 +106,7 @@ def handle_input(user_input, state):
|
|
105 |
state['mode'] = 'waiting_for_feedback'
|
106 |
state['chat_history'].append(("User", query))
|
107 |
state['chat_history'].append(("Bot", f"Answer: {answer}\nPlease provide feedback: good, too vague, not helpful."))
|
|
|
108 |
logger.info(f"Query: {query}, Answer: {answer}")
|
109 |
elif state['mode'] == 'waiting_for_feedback':
|
110 |
feedback = user_input.lower()
|
|
|
91 |
if state['mode'] == 'waiting_for_upload':
|
92 |
state['chat_history'].append(("Bot", "Please upload a file first."))
|
93 |
logger.info("User attempted to interact without uploading a file.")
|
94 |
+
return state['chat_history'], state
|
95 |
elif state['mode'] == 'waiting_for_query':
|
96 |
query = user_input
|
97 |
state['current_query'] = query
|
|
|
106 |
state['mode'] = 'waiting_for_feedback'
|
107 |
state['chat_history'].append(("User", query))
|
108 |
state['chat_history'].append(("Bot", f"Answer: {answer}\nPlease provide feedback: good, too vague, not helpful."))
|
109 |
+
# Log the query and initial answer here:
|
110 |
logger.info(f"Query: {query}, Answer: {answer}")
|
111 |
elif state['mode'] == 'waiting_for_feedback':
|
112 |
feedback = user_input.lower()
|