jjz5463 commited on
Commit
e74e7eb
·
1 Parent(s): 41f933e
Files changed (1) hide show
  1. chatbot_simulator.py +2 -1
chatbot_simulator.py CHANGED
@@ -84,7 +84,7 @@ Rules:
84
 
85
  def _trim_conversation(self):
86
  """Trim the conversation to keep it within the token limit."""
87
- while self._calculate_token_count(self.conversation) > self.max_tokens - (self.buffer_tokens+1500):
88
  self.conversation.pop(0) #
89
 
90
  def one_conversation_round(self, user_input):
@@ -155,6 +155,7 @@ Rules:
155
 
156
  self.user_state = updated_state
157
 
 
158
  system_prompt = self._generate_system_prompt()
159
 
160
  # GPT generates the page instructions
 
84
 
85
  def _trim_conversation(self):
86
  """Trim the conversation to keep it within the token limit."""
87
+ while self._calculate_token_count(self.conversation) > self.max_tokens - self.buffer_tokens:
88
  self.conversation.pop(0) #
89
 
90
  def one_conversation_round(self, user_input):
 
155
 
156
  self.user_state = updated_state
157
 
158
+ self.conversation.clear()
159
  system_prompt = self._generate_system_prompt()
160
 
161
  # GPT generates the page instructions