Skip to content

Commit

Permalink
Vision (#230)
Browse files Browse the repository at this point in the history
* fix: ๐Ÿ› fix OPENAI key setting issue and update readme

* feat: ๐ŸŽธ update gpt4o

* style: format code with Black

This commit fixes the style issues introduced in 99581a8 according to the output
from Black.

Details: #229

* fix: ๐Ÿ› fix OPENAI_KEY typo

* style: format code with Black

This commit fixes the style issues introduced in 8f9091c according to the output
from Black.

Details: #230

---------

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
  • Loading branch information
GreyDGL and deepsource-autofix[bot] authored May 14, 2024
1 parent 7fa106b commit f072f90
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ PentestGPT is tested under `Python 3.10`. Other Python3 versions should work but
- `pip3 install -e .`
2. To use OpenAI API
- **Ensure that you have link a payment method to your OpenAI account.**
- export your API key with `export OPENAI_KEY='<your key here>'`
- export your API key with `export OPENAI_API_KEY='<your key here>'`
- export API base with `export OPENAI_BASEURL='https://api.xxxx.xxx/v1'`if you need.
- Test the connection with `pentestgpt-connection`
3. To verify that the connection is configured properly, you may run `pentestgpt-connection`. After a while, you should see some sample conversation with ChatGPT.
Expand Down
2 changes: 1 addition & 1 deletion pentestgpt/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '"0.13.0"'
__version__ = '"0.13.1"'
2 changes: 1 addition & 1 deletion pentestgpt/utils/APIs/azure_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AzureGPTAPI(LLMAPI):
def __init__(self, config_class, use_langfuse_logging=False):
self.name = str(config_class.model)
openai.api_type = "azure"
openai.api_key = os.getenv("OPENAI_KEY", None)
openai.api_key = os.getenv("OPENAI_API_KEY", None)
openai.api_base = config_class.api_base
self.model = config_class.model
self.log_dir = config_class.log_dir
Expand Down
2 changes: 1 addition & 1 deletion pentestgpt/utils/APIs/chatgpt_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(self, config_class, use_langfuse_logging=False):

self.langfuse = Langfuse()

openai.api_key = os.getenv("OPENAI_KEY", None)
openai.api_key = os.getenv("OPENAI_API_KEY", None)
openai.api_base = config_class.api_base
self.model = config_class.model
self.log_dir = config_class.log_dir
Expand Down
2 changes: 1 addition & 1 deletion pentestgpt/utils/APIs/chatgpt_vision_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(self, config_class, use_langfuse_logging=False):

self.langfuse = Langfuse()

openai.api_key = os.getenv("OPENAI_KEY", None)
openai.api_key = os.getenv("OPENAPI_API_KEY", None)
openai.api_base = config_class.api_base
self.model = config_class.model
self.log_dir = config_class.log_dir
Expand Down
4 changes: 3 additions & 1 deletion pentestgpt/utils/APIs/module_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ class GPT35Turbo16kConfigClass:
# set up the openai key
openai_key = os.getenv("OPENAI_API_KEY", None)
if openai_key is None:
print("Your OPENAI_KEY is not set. Please set it in the environment variable.")
print(
"Your OPENAI_API_KEY is not set. Please set it in the environment variable."
)
error_wait_time: float = 20
is_debugging: bool = False

Expand Down
2 changes: 1 addition & 1 deletion pentestgpt/utils/vectorDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, project_name: str, vectordb_name: str):

# load configurations
pinecone_api_key = os.getenv("PINECONE_API_KEY", None)
os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_KEY", None)
os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY", None)
# save the abs directory of the vectorDB on top of the project directory
self.vectordb_directory = os.path.join(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="pentestgpt",
version="0.13.0",
version="0.13.1",
description="PentestGPT, a GPT-empowered penetration testing tool",
long_description="""
PentestGPT is a penetration testing tool empowered by ChatGPT.
Expand Down

0 comments on commit f072f90

Please sign in to comment.