Skip to content

Commit 4286b50

Browse files
authored
Merge pull request #154 from RiccardoRobb/main
Fast bugfix
2 parents 407562e + 61248b1 commit 4286b50

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pentestgpt/utils/APIs/chatgpt_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def _chat_completion(
9393
logger.error("Token size error; will retry with compressed message ", e)
9494
# compress the message in two ways.
9595
## 1. compress the last message
96-
history[-1]["content"] = self.token_compression(history)
96+
history[-1]["content"] = self._token_compression(history)
9797
## 2. reduce the number of messages in the history. Minimum is 2
9898
if self.history_length > 2:
9999
self.history_length -= 1

pentestgpt/utils/llm_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def _token_compression(self, complete_messages) -> str:
9696
-------
9797
compressed_message: str
9898
"""
99-
if self.config.model == "gpt-4":
99+
if self.model == "gpt-4":
100100
token_limit = 8000
101101
else:
102102
token_limit = 14000 # leave some budget

0 commit comments

Comments
 (0)