pvanand commited on
Commit
79b14ac
·
verified ·
1 Parent(s): 86c6f8f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -1
main.py CHANGED
@@ -127,7 +127,7 @@ def update_db(user_id, conversation_id, message, response):
127
  def calculate_tokens(msgs):
128
  return sum(len(encoding.encode(str(m))) for m in msgs)
129
 
130
- def limit_conversation_history(conversation: List[Dict[str, str]], max_tokens: int = 4000) -> List[Dict[str, str]]:
131
  """Limit the conversation history to a maximum number of tokens."""
132
  limited_conversation = []
133
  current_tokens = 0
 
127
  def calculate_tokens(msgs):
128
  return sum(len(encoding.encode(str(m))) for m in msgs)
129
 
130
+ def limit_conversation_history(conversation: List[Dict[str, str]], max_tokens: int = 7500) -> List[Dict[str, str]]:
131
  """Limit the conversation history to a maximum number of tokens."""
132
  limited_conversation = []
133
  current_tokens = 0