Spaces:
Sleeping
Sleeping
fixed bug with ticket
Browse files
chat_logic/chat_stream.py
CHANGED
|
@@ -142,7 +142,7 @@ def handle_user_input(user_input_text, history, conversation_state, response_typ
|
|
| 142 |
print("History before calling Chatbot Interface:", history)
|
| 143 |
|
| 144 |
if conversation_state == "awaiting_support_confirmation":
|
| 145 |
-
yield from support_ticket_needed(user_input_text, history, conversation_state)
|
| 146 |
else:
|
| 147 |
answer, conversation_state, vector_db = chatbot_interface(history, user_input_text, response_type, conversation_state, vector_db)
|
| 148 |
print("Answer before returning to Interface Design:", answer)
|
|
@@ -169,7 +169,7 @@ def feedback_negative(history):
|
|
| 169 |
yield history, conversation_state
|
| 170 |
|
| 171 |
# Support ticket creation
|
| 172 |
-
def support_ticket_needed(message, history, conversation_state):
|
| 173 |
user_message = message.strip().lower()
|
| 174 |
history.append((message, None))
|
| 175 |
if conversation_state == "awaiting_support_confirmation":
|
|
@@ -183,15 +183,15 @@ def support_ticket_needed(message, history, conversation_state):
|
|
| 183 |
)
|
| 184 |
history.append((None, f"🛠️ Your support ticket has been created:\n\n{ticket_text[-1][1]}"))
|
| 185 |
conversation_state = "repair_helper"
|
| 186 |
-
yield history, "", conversation_state
|
| 187 |
elif "no" in user_message:
|
| 188 |
history.append((None, "👍 Ok, I would be happy to help with the next repair problem."))
|
| 189 |
-
yield history, "", conversation_state
|
| 190 |
time.sleep(5)
|
| 191 |
history.clear()
|
| 192 |
conversation_state = "interactive_diagnosis"
|
| 193 |
-
yield history, "", conversation_state
|
| 194 |
else:
|
| 195 |
history.append((None, "❓ Please answer with yes or no."))
|
| 196 |
-
yield history, "", conversation_state
|
| 197 |
|
|
|
|
| 142 |
print("History before calling Chatbot Interface:", history)
|
| 143 |
|
| 144 |
if conversation_state == "awaiting_support_confirmation":
|
| 145 |
+
yield from support_ticket_needed(user_input_text, history, conversation_state, vector_db)
|
| 146 |
else:
|
| 147 |
answer, conversation_state, vector_db = chatbot_interface(history, user_input_text, response_type, conversation_state, vector_db)
|
| 148 |
print("Answer before returning to Interface Design:", answer)
|
|
|
|
| 169 |
yield history, conversation_state
|
| 170 |
|
| 171 |
# Support ticket creation
|
| 172 |
+
def support_ticket_needed(message, history, conversation_state, vector_db):
|
| 173 |
user_message = message.strip().lower()
|
| 174 |
history.append((message, None))
|
| 175 |
if conversation_state == "awaiting_support_confirmation":
|
|
|
|
| 183 |
)
|
| 184 |
history.append((None, f"🛠️ Your support ticket has been created:\n\n{ticket_text[-1][1]}"))
|
| 185 |
conversation_state = "repair_helper"
|
| 186 |
+
yield history, "", conversation_state, vector_db
|
| 187 |
elif "no" in user_message:
|
| 188 |
history.append((None, "👍 Ok, I would be happy to help with the next repair problem."))
|
| 189 |
+
yield history, "", conversation_state, vector_db
|
| 190 |
time.sleep(5)
|
| 191 |
history.clear()
|
| 192 |
conversation_state = "interactive_diagnosis"
|
| 193 |
+
yield history, "", conversation_state, vector_db
|
| 194 |
else:
|
| 195 |
history.append((None, "❓ Please answer with yes or no."))
|
| 196 |
+
yield history, "", conversation_state, vector_db
|
| 197 |
|