Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
Rename repo - ChatGPT -> OpenAI (#20)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by openai -->
### Summary by OpenAI

**Release Notes:**

- Refactor: Updated import statements, added semicolons and removed
unnecessary whitespace in `src/options.ts`. Renamed repository from
ChatGPT to OpenAI and updated references to ChatGPT to OpenAI in
`README.md` and `src/bot.ts`. Added polyfill for `fetch` and related
classes in `src/fetch-polyfill.js` and removed previous implementation
of polyfill in `src/fetch-polyfill.ts`. Replaced references to `chatgpt`
with `openai` in `src/main.ts` and `src/bot.ts`.
<!-- end of auto-generated comment: release notes by openai -->
  • Loading branch information
harjotgill authored Mar 12, 2023
1 parent e230035 commit 9dab0f9
Show file tree
Hide file tree
Showing 15 changed files with 521 additions and 527 deletions.
36 changes: 16 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# ChatGPT-based PR reviewer and summarizer
# OpenAI GPT based PR reviewer and summarizer

![AI](./docs/images/ai.png)

## Overview

This [ChatGPT](https://platform.openai.com/docs/guides/chat) based GitHub Action
provides a summary, release notes and review of pull requests. The prompts have
been tuned for a concise response. To prevent excessive notifications, this
action can be configured to skip adding review comments when the changes look
good for the most part.
This [OpenAI Chat](https://platform.openai.com/docs/guides/chat) based GitHub
Action provides a summary, release notes and review of pull requests. The
prompts have been tuned for a concise response. To prevent excessive
notifications, this action can be configured to skip adding review comments when
the changes look good for the most part.

NOTES:

Expand All @@ -18,14 +18,14 @@ NOTES:
- OpenAI's API is used instead of ChatGPT session on their portal. OpenAI API
has a
[more conservative data usage policy](https://openai.com/policies/api-data-usage-policies)
compared to ChatGPT.
compared to their ChatGPT offering.

### Features

- Code review your pull requests

```yaml
- uses: fluxninja/chatgpt-pr-reviewer@main
- uses: fluxninja/openai-pr-reviewer@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
repository: ${{github.event.pull_request.head.repo.full_name}}
ref: ${{github.event.pull_request.head.ref}}
submodules: false
- uses: fluxninja/chatgpt-pr-reviewer@main
- uses: fluxninja/openai-pr-reviewer@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
Expand All @@ -66,11 +66,11 @@ jobs:
### Screenshots
![PR Summary](./docs/images/chatgpt-pr-summary.png)
![PR Summary](./docs/images/openai-pr-summary.png)
![PR Release Notes](./docs/images/chatgpt-pr-release-notes.png)
![PR Release Notes](./docs/images/openai-pr-release-notes.png)
![PR Review](./docs/images/chatgpt-pr-review.png)
![PR Review](./docs/images/openai-pr-review.png)
### Configuration
Expand All @@ -86,12 +86,12 @@ See also: [./action.yml](./action.yml)

#### Inputs

- `debug`: Enable debug mode, will show messages and responses between ChatGPT
- `debug`: Enable debug mode, will show messages and responses between OpenAI
server in CI logs.
- `review_comment_lgtm`: Leave comments even the patch is LGTM
- `path_filters`: Rules to filter files to be reviewed.
- `temperature`: Temperature of the GPT-3 model.
- `system_message`: The message to be sent to ChatGPT to start a conversation.
- `system_message`: The message to be sent to OpenAI to start a conversation.

### Prompt templates:

Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
ref: ${{github.event.pull_request.head.ref}}
submodules: false
- uses: fluxninja/chatgpt-pr-reviewer@main
- uses: fluxninja/openai-pr-reviewer@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
Expand All @@ -157,15 +157,11 @@ jobs:
See also:
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target

### Inspect the messages between ChatGPT server
### Inspect the messages between OpenAI server

Set `debug: true` in the workflow file to enable debug mode, which will show the
messages

[1]:
https://github.com/marketplace?type=&verification=&query=chatgpt-pr-reviewer+
[2]: https://www.npmjs.com/package/chatgpt

### Special Thanks

This GitHub Action is based on
Expand Down
53 changes: 24 additions & 29 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: 'ChatGPT PR Reviewer & Summarizer'
description: 'ChatGPT based PR reviewer and summarizer'
name: "OpenAI-based PR Reviewer & Summarizer"
description: "OpenAI-based PR Reviewer and Summarizer"
branding:
icon: 'aperture'
color: 'orange'
author: 'FluxNinja, Inc.'
icon: "aperture"
color: "orange"
author: "FluxNinja, Inc."
inputs:
debug:
required: false
description: 'Enable debug mode'
default: 'false'
description: "Enable debug mode"
default: "false"
temperature:
required: false
description: 'Temperature for ChatGPT model'
default: '0.0'
description: "Temperature for GPT model"
default: "0.0"
review_comment_lgtm:
required: false
description: 'Leave comments even if the patch is LGTM'
default: 'false'
description: "Leave comments even if the patch is LGTM"
default: "false"
path_filters:
required: false
description: |
Expand Down Expand Up @@ -44,21 +44,16 @@ inputs:
!**/vendor/**
system_message:
required: false
description: 'System message to be sent to ChatGPT'
description: "System message to be sent to OpenAI"
default: |
You are a very experienced software engineer. You are able to thoroughly review code and uncover
issues, such as bugs, potential data races, livelocks, starvation, suspension, order violation,
atomicity violation, consistency issues, complexity issues, error handling and so on.
We will be doing code reviews today. Please prefer markdown format in your responses.
chatgpt_reverse_proxy:
required: false
description: |
The URL of the chatgpt reverse proxy, see also https://github.com/transitive-bullshit/chatgpt-api#reverse-proxy
default: https://chat.duti.tech/api/conversation
summarize_beginning:
required: false
description: 'The prompt for the whole pull request'
description: "The prompt for the whole pull request"
default: |
$system_message
Expand All @@ -79,7 +74,7 @@ inputs:
Reply "OK" to confirm that you are ready to receive the diffs for summarization.
summarize_file_diff:
required: false
description: 'The prompt for each file diff'
description: "The prompt for each file diff"
default: |
Providing diff for `$filename`.
Expand All @@ -93,7 +88,7 @@ inputs:
```
summarize:
required: false
description: 'The prompt for final summarization response'
description: "The prompt for final summarization response"
default: |
This is the end of summarization session. Please provide the final response as follows in
the `markdown` format with the following content:
Expand All @@ -106,7 +101,7 @@ inputs:
request.
summarize_release_notes:
required: false
description: 'The prompt for generating release notes'
description: "The prompt for generating release notes"
default: |
Next, release notes in `markdown` format for this pull request that focuses on the purpose
of this PR. If needed, you can classify the changes as "New Feature", "Bug fix",
Expand All @@ -116,7 +111,7 @@ inputs:
used as is in our release notes.
review_beginning:
required: false
description: 'The beginning prompt of a code review dialog'
description: "The beginning prompt of a code review dialog"
default: |
$system_message
Expand All @@ -128,14 +123,14 @@ inputs:
> $description.
ChatGPT generated summary is as follows,
OpenAI generated summary is as follows,
> $summary
Reply "OK" to confirm that you are ready for further instructions.
review_file:
required: false
description: 'The prompt for each file'
description: "The prompt for each file"
default: |
Providing `$filename` content as context. Please use this context when reviewing patches.
Expand All @@ -144,7 +139,7 @@ inputs:
```
review_file_diff:
required: false
description: 'The prompt for each file diff'
description: "The prompt for each file diff"
default: |
Providing entire diff for `$filename` as context. Please use this context when reviewing patches.
Expand All @@ -153,7 +148,7 @@ inputs:
```
review_patch_begin:
required: false
description: 'The prompt for each file diff'
description: "The prompt for each file diff"
default: |
Next, I will send you a series of patches, each of them consists of a diff snippet, and you
need to do a brief code review for every patch, and tell me any bug risk or improvement
Expand All @@ -164,13 +159,13 @@ inputs:
preferred for your responses. Reply "OK" to confirm.
review_patch:
required: false
description: 'The prompt for each chunks/patches'
description: "The prompt for each chunks/patches"
default: |
$filename
```diff
$patch
```
runs:
using: 'node16'
main: 'dist/index.js'
using: "node16"
main: "dist/index.js"
Loading

0 comments on commit 9dab0f9

Please sign in to comment.