Skip to content

Commit

Permalink
removed _trim
Browse files Browse the repository at this point in the history
  • Loading branch information
jpal91 committed Oct 12, 2023
1 parent a18aeb3 commit 012e880
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions xontrib_chatgpt/chatgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,6 @@ def chat(self, text: str) -> str:
self.trim_convo()

return res_text["content"]

def _trim(self) -> None:
"""Trims conversation to make sure it doesn't exceed the max tokens"""
tokens = self.tokens
while tokens > self._max_tokens:
self.messages.pop(0)
tokens -= self._tokens.pop(0)

def trim_convo(self) -> None:
while self.chat_idx < -1 and self.tokens > self._max_tokens:
Expand Down

0 comments on commit 012e880

Please sign in to comment.