* feat: 🎸 add new models
* minor readme update
* style: format code with Black
This commit fixes the style issues introduced in dafa18b according to the output
from Black.
Details: https://github.com/GreyDGL/PentestGPT/pull/274
---------
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
* 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: https://github.com/GreyDGL/PentestGPT/pull/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: https://github.com/GreyDGL/PentestGPT/pull/230
* feat: 🎸 update openai python sdk
---------
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
* 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: https://github.com/GreyDGL/PentestGPT/pull/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: https://github.com/GreyDGL/PentestGPT/pull/230
---------
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
* aider: ## Analysis of Proposed Changes and Potential Improvements
The provided diff introduces the necessary changes to incorporate Gemini 1.0 and 1.5 into the module mapping dictionary and defines corresponding dataclasses. However, let's explore some potential refinements and considerations:
**1. API Base URL:**
* The current implementation assumes the API base URL is the same for both Gemini versions. Verify if this is accurate or if separate base URLs are required.
**2. API Key Environment Variable:**
* Using a single environment variable (`GEMINI_API_KEY`) for both versions might lead to confusion. Consider using distinct variables like `GEMINI_1_0_API_KEY` and `GEMINI_1_5_API_KEY` for clarity.
**3. Error Handling:**
* The current code prints a message if the API key is not set. While informative, consider raising an exception to halt execution and prevent unexpected behavior.
**4. Code Style:**
* For consistency, align the dataclass field order with existing ones (e.g., `model` first, followed by `api_base`).
**5. Additional Considerations:**
* Explore potential rate limits or usage restrictions for the Gemini API and incorporate appropriate handling mechanisms.
* Investigate authentication methods beyond API keys if applicable (e.g., OAuth).
* Consider adding documentation or comments to explain the purpose and usage of the new classes and configuration options.
## Refined Implementation
```python
import dataclasses
import os
# ... (existing code) ...
module_mapping = {
# ... (existing mappings) ...
"gemini-1.0": {
"config_name": "Gemini10ConfigClass",
"module_name": "gemini_api",
"class_name": "GeminiAPI",
},
"gemini-1.5": {
"config_name": "Gemini15ConfigClass",
"module_name": "gemini_api",
"class_name": "GeminiAPI",
},
}
# ... (existing code) ...
@dataclasses.dataclass
class Gemini10ConfigClass:
model: str = "gemini-1.0"
api_base: str = "https://api.gemini.com/v1" # Verify and update if needed
openai_key: str = os.getenv("GEMINI_1_0_API_KEY", None)
if not openai_key:
raise ValueError("GEMINI_1_0_API_KEY environment variable not set")
error_wait_time: float = 20
is_debugging: bool = False
@dataclasses.dataclass
class Gemini15ConfigClass:
model: str = "gemini-1.5"
api_base: str = "https://api.gemini.com/v1" # Verify and update if needed
openai_key: str = os.getenv("GEMINI_1_5_API_KEY", None)
if not openai_key:
raise ValueError("GEMINI_1_5_API_KEY environment variable not set")
error_wait_time: float = 20
is_debugging: bool = False
# ... (existing code) ...
```
## Conclusion
By incorporating these refinements, you can enhance the clarity, robustness, and maintainability of your code while effectively integrating Gemini 1.0 and 1.5 into your project. Remember to adapt and expand upon these suggestions based on the specific requirements and characteristics of the Gemini API.
# Aider chat conversation:
USER: I want to add gemini-1.0 and gemini-1.5 to the module mapping dicionary using the same fields as gpt4all. I then want to add an @dataclasses tag and class for gemini-1.0 and gemini-1.5. Since they need API keys they should be similar to GPT4Turbo dataclass.
ASSISTANT: No changes are needed.
* Update Gemini 1.0 and 1.5 models to include "pro" and "pro-latest" respectively.
* aider: Added GeminiAPI class with Google Gemini specific functionality and imports.
# Aider chat conversation:
USER: I want you to modify gemini_api so that it overrides the necessary classes of LLMAPI and implements the same functionality as chatgpt_api.py, but using google gemini specific functionality and imports
ASSISTANT: No changes are needed.
* Added gemini_api file and modified llm_import
* Works with Gemini, gemini_api class could use some tweaks
* Cleaned out some of the commented code
* fix: 🐛 fix default models used
✅Closes: #204
* feat: 🎸 support local LLMs with GPT4ALL
* fix lint issue
* style: format code with Black
This commit fixes the style issues introduced in 5eee6a0 according to the output
from Black.
Details: https://github.com/GreyDGL/PentestGPT/pull/217
---------
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
* Update chatgpt_config.py
Add base api environment variables
* Update README.md
Add guidance for API base changes
* Fix the problem that test-connection cannot run
* Update test_connection.py
Class variable read modification