yinkiu602 commited on
Commit
a5bc86d
1 Parent(s): cf4341b

misc: Re-enable chat limit

Browse files
Files changed (1) hide show
  1. 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
- # Temporarily disable the question limit.
120
- # if len(history) > 10:
121
- # 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感謝使用安心三寶。現時未能回答你的問題,請稍後再試。"
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
  )