You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"1. You're connected with ChatGPT Plus cookie. \nTo start PentestGPT, please use <pentestgpt --reasoning_model=gpt-4>",
44
-
style="bold green",
45
-
)
46
-
else:
47
-
console.print(
48
-
"The cookie is not properly configured with ChatGPT Cookie. Please follow README to update cookie through `export CHATGPT_COOKIE=<your cookie>`",
49
-
style="bold red",
50
-
)
51
-
exceptExceptionase: # use a general exception first. Update later for debug
52
-
logger.error(e)
53
-
print(
54
-
"The cookie is not properly configured. Please follow README to update cookie in config/chatgpt_config.py"
55
-
)
56
-
57
-
# 2. test the connection for chatgpt api with GPT-4
36
+
# 1. test the connection for chatgpt api with GPT-4
58
37
print("#### Test connection for OpenAI api (GPT-4)")
59
38
try:
60
39
chatgpt_config.model="gpt-4"
61
40
chatgpt=ChatGPTAPI(chatgpt_config)
62
41
openai.api_key=chatgpt_config.openai_key
63
42
result, conversation_id=chatgpt.send_new_message("Hi how are you?")
64
43
console.print(
65
-
"2. You're connected with OpenAI API. You have GPT-4 access. To start PentestGPT, please use <pentestgpt --reasoning_model=gpt-4 --useAPI>",
44
+
"1. You're connected with OpenAI API. You have GPT-4 access. To start PentestGPT, please use <pentestgpt --reasoning_model=gpt-4>",
66
45
style="bold green",
67
46
)
68
47
exceptExceptionase: # use a general exception first. Update later for debug
69
48
console.print(
70
-
"The OpenAI API key is not properly configured. Please follow README to update OpenAI API key through `export OPENAI_KEY=<>`.",
49
+
"1. The OpenAI API key is not properly configured. Please follow README to update OpenAI API key through `export OPENAI_KEY=<>`.",
71
50
style="bold red",
72
51
)
73
52
print("The error is below:", e)
74
53
75
-
# 3. test the connection for chatgpt api with GPT-3.5
54
+
# 2. test the connection for chatgpt api with GPT-3.5
76
55
print("#### Test connection for OpenAI api (GPT-3.5)")
77
56
try:
78
-
chatgpt_config.model="gpt-3.5-turbo"
57
+
chatgpt_config.model="gpt-3.5-turbo-16k"
79
58
chatgpt=ChatGPTAPI(chatgpt_config)
80
59
openai.api_key=chatgpt_config.openai_key
81
60
result, conversation_id=chatgpt.send_new_message("Hi how are you?")
82
61
console.print(
83
-
"3. You're connected with OpenAI API. You have GPT-3.5 access. To start PentestGPT, please use <pentestgpt --reasoning_model=gpt-3.5-turbo --useAPI>",
62
+
"2. You're connected with OpenAI API. You have GPT-3.5 access. To start PentestGPT, please use <pentestgpt --reasoning_model=gpt-3.5-turbo-16k>",
84
63
style="bold green",
85
64
)
86
65
exceptExceptionase: # use a general exception first. Update later for debug
87
66
logger.error(e)
88
67
console.print(
89
-
"The OpenAI API key is not properly configured. Please follow README to update OpenAI API key through `export OPENAI_KEY=<>`",
68
+
"2. The OpenAI API key is not properly configured. The likely reason is that you do not link a payment method to OpenAI so your key is not active. \nPlease follow README to update OpenAI API key through `export OPENAI_KEY=<>`",
90
69
style="bold red",
91
70
)
92
71
print("The error is below:", e)
93
72
73
+
# 3. test the connection for chatgpt cookie (deprecated)
74
+
print("#### Test connection for chatgpt cookie")
75
+
try:
76
+
chatgpt=ChatGPT(chatgpt_config)
77
+
conversations=chatgpt.get_conversation_history()
78
+
ifconversationsisnotNone:
79
+
console.print(
80
+
"3. You're connected with ChatGPT Plus cookie. \nTo start PentestGPT, please use <pentestgpt --reasoning_model=gpt-4>",
81
+
style="bold green",
82
+
)
83
+
else:
84
+
console.print(
85
+
"3. The cookie is not properly configured with ChatGPT Cookie. If you're not using cookie bypass for testing, please neglect this message.",
86
+
style="bold red",
87
+
)
88
+
exceptExceptionase: # use a general exception first. Update later for debug
0 commit comments