Closed yonasuriv closed 10 months ago
May you help to attach the output of pentestgpt-connection
?
May you help to attach the output of
pentestgpt-connection
?
Your CHATGPT_COOKIE is not set. Please set it in the environment variable.
You're testing the connection for PentestGPT v 0.10.1
#### Test connection for OpenAI api (GPT-4)
Traceback (most recent call last):
File "/home/kali/PentestGPT/pentestgpt/utils/APIs/chatgpt_api.py", line 64, in _chat_completion
response = openai.ChatCompletion.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kali/.local/lib/python3.11/site-packages/openai/api_resources/chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kali/.local/lib/python3.11/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
^^^^^^^^^^^^^^^^^^
File "/home/kali/.local/lib/python3.11/site-packages/openai/api_requestor.py", line 298, in request
resp, got_stream = self._interpret_response(result, stream)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kali/.local/lib/python3.11/site-packages/openai/api_requestor.py", line 700, in _interpret_response
self._interpret_response_line(
File "/home/kali/.local/lib/python3.11/site-packages/openai/api_requestor.py", line 765, in _interpret_response_line
raise self.handle_error_response(
openai.error.InvalidRequestError: The model `gpt-4` does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/kali/.local/bin/pentestgpt-connection", line 33, in <module>
sys.exit(load_entry_point('pentestgpt', 'console_scripts', 'pentestgpt-connection')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kali/PentestGPT/pentestgpt/test_connection.py", line 46, in main
result, conversation_id = chatgpt.send_new_message("Hi how are you?")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kali/PentestGPT/pentestgpt/utils/llm_api.py", line 225, in send_new_message
response = self._chat_completion(history)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kali/PentestGPT/pentestgpt/utils/APIs/chatgpt_api.py", line 96, in _chat_completion
history[-1]["content"] = self.token_compression(history)
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ChatGPTAPI' object has no attribute 'token_compression'. Did you mean: '_token_compression'?
Two possible issues. (1) you did not initialize your OpenAI API key with a proper payment method. To use the tool, a valid payment method (credit card) shall be added to OpenAI account. (2) The openai
library is not the latest. To check that, use pip show openai
. It should be updated to at least 0.27.1
Was the payment method. Thanks mate!
Describe the bug PentestGPT won't initialize.
To Reproduce Steps to reproduce the behavior:
Expected behavior I've cloned the repository, installed the requeriments and using GPT4 model properly. When asked for the penetration task to perform I get this output:
Version You're testing the connection for PentestGPT v 0.10.1