cirolini / genai-code-review

MIT License
321 stars 51 forks source link

Openai parameters #5

Closed cirolini closed 1 year ago

cirolini commented 1 year ago

Now you can use the new OpenAI parameters:

And a lot of better docs.

github-actions[bot] commented 1 year ago

ChatGPT's response to explain this code:

This code is a GitHub Action that uses the ChatGPT model to generate text completion suggestions for a given Pull Request. The Action is triggered when the Pull Request is opened or synchronized, and it uses the OpenAI API key and GitHub Token from the repository secrets. The Pull Request ID is obtained from the Github event, and the default engine is "text-davinci-002". The temperature and maximum number of tokens to generate can be optionally specified.

github-actions[bot] commented 1 year ago

ChatGPT's response to explain this code:

This code is written in Python and is designed to automate code review using the ChatGPT language model. It integrates with Github Actions, and upon receiving a Pull Request, it automatically sends each code review to ChatGPT for an explanation.

github-actions[bot] commented 1 year ago

ChatGPT's response to explain this code:

This is a Github Action that uses ChatGPT to do code review. It takes in six inputs:

github-actions[bot] commented 1 year ago

ChatGPT's response to explain this code:

The code above is a shell script that calls the Python script main.py with the following arguments:

--openai_api_key: the OpenAI API key

--github_token: the GitHub token

--github_pr_id: the GitHub pull request ID

--openai_engine: the OpenAI engine

--openai_temperature: the OpenAI temperature

--openai_max_tokens: the OpenAI maximum tokens

github-actions[bot] commented 1 year ago

ChatGPT's response to explain this code:

The code is using the ChatGPT language model to automatically review code and provide explanations.

The code starts by importing the necessary libraries and then adding command-line arguments. Next, the code authenticates with the OpenAI API and the Github API.

Then, the code selects the repository and gets the pull request. Next, the code loops through the commits in the pull request and gets the modified files in each commit.

For each file, the code gets the file name and content. The code then sends the code to ChatGPT and gets a response. Finally, the code adds a comment to the pull request with ChatGPT's response.

github-actions[bot] commented 1 year ago

ChatGPT's response to explain this code:

The code is a script that uses the OpenAI API and the Github API to automatically review code and provide explanations for it. The code first authenticates with the OpenAI API and then with the Github API. It then loops through the commits in a pull request and sends the code to ChatGPT for each commit. Finally, it adds a comment to the pull request with ChatGPT's response.