Spaces:
Running
Running
trim more
Browse files- chatbot_simulator.py +2 -2
chatbot_simulator.py
CHANGED
@@ -5,7 +5,7 @@ import json_repair
|
|
5 |
class ChatbotSimulation:
|
6 |
def __init__(self, site_map, page_details, user_state, task,
|
7 |
app_name, log_location, openai_api_key, agent='human',
|
8 |
-
max_steps=50, max_tokens=8192, buffer_tokens=
|
9 |
self.sitemap = site_map
|
10 |
self.page_details = page_details
|
11 |
self.user_state = user_state
|
@@ -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+
|
88 |
self.conversation.pop(0) #
|
89 |
|
90 |
def one_conversation_round(self, user_input):
|
|
|
5 |
class ChatbotSimulation:
|
6 |
def __init__(self, site_map, page_details, user_state, task,
|
7 |
app_name, log_location, openai_api_key, agent='human',
|
8 |
+
max_steps=50, max_tokens=8192, buffer_tokens=500):
|
9 |
self.sitemap = site_map
|
10 |
self.page_details = page_details
|
11 |
self.user_state = user_state
|
|
|
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):
|