GreyDGL / PentestGPT

A GPT-empowered penetration testing tool
MIT License
6.66k stars 794 forks source link

Azure compability #77

Open joostgrunwald opened 1 year ago

joostgrunwald commented 1 year ago

OpenAI Azure is not working with this, quick workaround for people who want to use azure openai now is to adjust chatgpt_api.py (you could do this properly via config)

    openai.api_key = config.openai_key
    openai.api_type = "azure"  
    openai.api_base = "https://{deploymentname}azure.com/"  
    openai.api_version = "2023-03-15-preview"

    self.history_length = 3  # maintain 3 messages in the history. (3 chat memory)
    self.conversation_dict: Dict[str, Conversation] = {}

def chatgpt_completion(self, history: List, model="gpt-3.5-turbo") -> str:
    if self.config.model == "gpt-4":
        model = "gpt-4"
        engine = "{gpt4deployment}"
    else: 
        engine = "{gpt3.5deployment}"
GreyDGL commented 1 year ago

Sure this would be helpful:) I'll include it in the next commit.

delinecnlin commented 9 months ago

Hope it will be included soon, so that the model config: endpoint, type, model, engine name can be configured more easily.

GreyDGL commented 9 months ago

There is one Azure API endpoint in place, but I cannot test it further because I do not have Azure API. Will do further development when I have the access.

delinecnlin commented 9 months ago

We can test it, but how to configure to use that endpoint?

GreyDGL commented 9 months ago

@delinecnlin basically you can refer to issue #145 and follow the command pentestgpt --reasoning_model=azure-gpt-3.5 --parsing_model=azure-gpt-3.5

delinecnlin commented 9 months ago

Thank you! but where to change the API-key, endpoint, deployment name and model type(gpt3.5/4 or gpt3.5_16K)? Maybe I can also help you with one test key for a while, do you have your private mailbox?

GreyDGL commented 9 months ago

The tool documentation is in README.md. Also you could find me at gelei.deng@ntu.edu.sg

AkechiShiro commented 5 months ago

Any news on this @GreyDGL ? @delinecnlin ?

xXx-ericaburgess-xXx commented 3 months ago

would love to know more on this

gyanendrarawat commented 2 weeks ago

@GreyDGL can u update regarding Azure open AI configuration