文件历史

提交图

53 次代码提交

作者 SHA1 备注 提交日期
Grey_D d91bad91fe feat: 🎸 [WIP] add search and whole refactoring 2024-10-26 02:31:58 +08:00
Gelei Deng 73dc741b9b feat: 🎸 [WIP] fix conversation bugs and update feature 2024-10-23 17:55:16 +08:00
Grey_D 7ac597a9a4 update prompts 2024-10-23 14:58:17 +08:00
Grey_D 92284f443c feat: 🎸 [WIP] update parser and UI 2024-10-22 01:11:04 +08:00
Gelei Deng b4783c5e9f feat: 🎸 [WIP] refactor codebase 2024-10-21 17:22:27 +08:00
Gelei Deng a6edb3053e Support gpt4o (#233)
* fix: 🐛 fix OPENAI key setting issue and update readme

* feat: 🎸 add visual parsing for GPT4o

* feat: 🎸 update default API model
2024-05-15 16:25:54 +08:00
Gelei Deng bb768c1f13 Openai compatability (#231)
* 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>
2024-05-15 14:57:46 +08:00
Gelei Deng f072f90293 Vision (#230)
* 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>
2024-05-14 17:58:18 +08:00
Gelei Deng 7fa106bedf Vision Model (#229)
* fix: 🐛 fix OPENAI key setting issue and update readme

* feat: 🎸 update gpt4o
2024-05-14 17:51:39 +08:00
Gelei Deng df4d330ce3 fix: 🐛 fix OPENAI key setting issue and update readme (#228) 2024-05-14 17:42:02 +08:00
davidbakerrobinson b0ce694ba4 Gemini dev (#225)
* 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
2024-05-11 16:11:54 +08:00
Kuromesi 279141fbe7 fix the issue of baseurl not working (#221)
Signed-off-by: Kuromesi <blackfacepan@163.com>
2024-04-21 01:10:17 +08:00
RainRat da3367528c fix typos (#216) 2024-04-21 01:09:21 +08:00
Gelei Deng 43f6e803e0 Gpt4all Dev (#217)
* 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>
2024-04-12 17:10:22 +08:00
Gelei Deng 0a557e917e fix: 🐛 fix default models used (#205)
 Closes: #204
2024-03-29 14:54:53 +08:00
Gelei Deng 3295953495 Poetry Upgrade (#201)
* chore: 🤖 update to poetry

* chore: 🤖 major poetry update and lint fix

 Closes: #200
2024-03-25 01:00:17 +08:00
Grey_D 07f38a5767 feat: 🎸 add feature for Google search (future RAG) 2024-03-19 22:58:37 +08:00
RainRat 9485326a15 fix typos 2024-01-02 03:42:54 -08:00
Wouter de Bruijn 2b79b47ef6 🐛 Changed default gpt4all model to mistral-7b
GPT4all uses a new format for models which generated a 404 error for the previous default model.
2023-11-27 13:40:18 +01:00
Grey_D e96d94be54 feat: 🎸 langfuse + gpt-4-turbo 2023-11-07 11:11:27 +01:00
Grey_D 6a49a603f2 feat: 🎸 add gpt-4-turbo 2023-11-07 01:54:51 +01:00
Grey_D e2bae40003 feat: 🎸 add support for langfuse feature 2023-11-01 21:06:06 +08:00
Grey_D 60f12cc04e feat: 🎸 support for vectorDB 2023-10-30 20:25:05 +08:00
Robb 77b60e2654 Typo fix 2023-10-17 15:04:46 +02:00
Gelei Deng bf565c06e5 Merge pull request #161 from GreyDGL/deepsource-transform-4b8a561e
style: format code with Black
2023-10-17 00:36:17 +08:00
Robb aa46a7b817 Add description for the "choose of information" selection 2023-10-16 12:47:41 +02:00
deepsource-autofix[bot] f51d8c652b style: format code with Black
This commit fixes the style issues introduced in b8854d2 according to the output
from Black.

Details: None
2023-10-12 04:08:54 +00:00
Robb 7814a55539 Fix session bug
- line 614
Allow to save session name from everywhere. (When saving the session it will look for the current position -> looking for "GPT-PenTesting/test_history/<session_name>")
FileNotFoundError: [Errno 2] No such file or directory
---
- line 640
Allow restore session from everywhere. 
FileNotFoundError: [Errno 2] No such file or directory: 'test_history/<session_name>'
---
- line 667
Allow restore session from everywhere. 
FileNotFoundError: [Errno 2] No such file or directory: 'test_history/<session_name>'
2023-10-10 18:04:53 +02:00
Robb 61248b1d54 Bugfix
Error raised = `AttributeError: 'ChatGPTAPI' object has no attribute 'token_compression'. Did you mean: '_token_compression'?`

When calling `pentestgpt-connection`
2023-10-05 19:07:51 +02:00
Robb 90d5843e0d Bugfix
Error raised = `AttributeError: 'ChatGPTAPI' object has no attribute 'config'`

When calling `pentestgpt-connection`
2023-10-05 19:05:59 +02:00
Grey_D 5dbd4c9e17 fix: 🐛 bug fix for generation module object 2023-09-07 22:58:03 +08:00
Grey_D b7b50c1942 feat: 🎸 add azure api support 2023-09-07 22:55:58 +08:00
Grey_D d7c5eb8301 fix: 🐛 fix the config error
Now the wait time set to 5; update later
2023-08-31 12:33:57 +08:00
Grey_D d6f8567eab feat: 🎸 Minor update on Titan usage
Note complete yet.
2023-08-25 22:16:31 +08:00
Grey_D ab6c840be6 feat: 🎸 add aws titan support 2023-08-24 21:47:43 +08:00
Grey_D 93d59bf340 feat: 🎸 update 2023-08-17 15:21:42 +08:00
deepsource-autofix[bot] a57e4afca2 style: format code with black
Format code with black

This commit fixes the style issues introduced in 988d464 according to the output
from Black.

Details: None
2023-08-17 07:19:05 +00:00
Grey_D 988d464f8a feat: 🎸 new version with new prompts and code structure 2023-08-17 15:18:35 +08:00
Grey_D dc7a67710f fix: 🐛 Fix the model import issue
 Closes: #139
2023-07-26 00:36:29 +08:00
deepsource-autofix[bot] fc94be252b style: Format code with black 2023-07-20 15:59:12 +00:00
Grey_D c271bc54a9 feat: 🎸 Local LLM 2023-07-20 23:58:43 +08:00
Grey_D f5469ca964 feat: 🎸 Local LLM
Add GPT4All; rebuild API usage; rebuild module import
2023-07-19 15:27:16 +08:00
Grey_D 949c75b47c feat: 🎸 Add gpt4all support
Testing local modules; rewrite API endpoint; support more API usage.

 Closes: #133
2023-07-16 23:52:55 +08:00
Grey_D bc7ef102b8 fix: 🐛 minor fix on default API usage and log 2023-07-09 17:38:28 +08:00
deepsource-autofix[bot] 4ba7e089ab style: format code with black
Format code with black

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

Details: https://app.deepsource.com/gh/GreyDGL/PentestGPT/transform/d5c867e1-bf42-4b26-aa4e-632a58df270a/
2023-06-30 15:15:40 +00:00
jiayuqi7813 62c7d279a5 User-defined log directory 2023-06-28 13:19:38 +00:00
Joe 26e473d0f0 Update chatgpt.py
changed completion model to 16k token support
2023-06-22 20:17:50 +01:00
deepsource-autofix[bot] afd9f6c6ba style: format code with black
Format code with black

This commit fixes the style issues introduced in 9e59fec according to the output
from Black.

Details: https://app.deepsource.com/gh/GreyDGL/PentestGPT/transform/4fe186cf-ae26-4340-86f8-ea999a00acff/
2023-06-21 03:55:42 +00:00
jiayuqi7813 534d1c90f8 add base_url 2023-06-19 19:55:20 +08:00
Grey_D 82cdd10415 fix: 🐛 Fix token limit and useAPI issue
Three main changes: (1) token compression when limit reached. (2) Use
API by default. (3) a minor update in prompt to improve performance.
2023-06-18 23:17:52 +08:00