Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -49,6 +49,10 @@ def respond(
|
|
| 49 |
# Update conversation state with the last user message
|
| 50 |
conversation_state["last_message"] = message.choices[0].delta.content
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
yield response
|
| 53 |
|
| 54 |
def pose_follow_up_question(user_response):
|
|
@@ -82,4 +86,3 @@ demo = gr.ChatInterface(
|
|
| 82 |
|
| 83 |
if __name__ == "__main__":
|
| 84 |
demo.launch()
|
| 85 |
-
|
|
|
|
| 49 |
# Update conversation state with the last user message
|
| 50 |
conversation_state["last_message"] = message.choices[0].delta.content
|
| 51 |
|
| 52 |
+
# Check if the chatbot should ask a question based on the current response
|
| 53 |
+
if "ask a question" in token.lower():
|
| 54 |
+
conversation_state["ask_question"] = True
|
| 55 |
+
|
| 56 |
yield response
|
| 57 |
|
| 58 |
def pose_follow_up_question(user_response):
|
|
|
|
| 86 |
|
| 87 |
if __name__ == "__main__":
|
| 88 |
demo.launch()
|
|
|