Spaces:
Runtime error
Runtime error
Josh Wong
commited on
misc: Re-enable chat limit
Browse files- chatbot.py +3 -4
chatbot.py
CHANGED
|
@@ -116,10 +116,9 @@ class Chatbot:
|
|
| 116 |
def stream_chat(self, message, history):
|
| 117 |
self.logger.info(history)
|
| 118 |
self.logger.info(self.convert_to_chat_messages(history))
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
# return
|
| 123 |
response = self.chat_engine.stream_chat(
|
| 124 |
message, chat_history=self.convert_to_chat_messages(history)
|
| 125 |
)
|
|
|
|
| 116 |
def stream_chat(self, message, history):
|
| 117 |
self.logger.info(history)
|
| 118 |
self.logger.info(self.convert_to_chat_messages(history))
|
| 119 |
+
if len(history) > 10:
|
| 120 |
+
yield "Thank you for using AweSumCare. I'm sorry I can't answer your question now, but I'm still learning. Please try to ask me something else.\n感謝使用安心三寶。現時未能回答你的問題,請稍後再試。"
|
| 121 |
+
return
|
|
|
|
| 122 |
response = self.chat_engine.stream_chat(
|
| 123 |
message, chat_history=self.convert_to_chat_messages(history)
|
| 124 |
)
|