You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-16Lines changed: 34 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,48 +31,66 @@ This bot **summarizes commits in the PR**. Alternatively, you can use [this bot]
31
31
32
32
## How it works
33
33
34
-
This flow function (or 🤖) will be triggered when a new PR is raised in the designated GitHub repo. The flow function collects the content in the PR, and asks ChatGPT/4 to review and summarize it. The result is then posted back to the PR as a comment. The flow functions are written in Rust and run in hosted [WasmEdge Runtimes](https://github.com/wasmedge) on [flows.network](https://flows.network/).
34
+
This flow function will be triggered when a new PR is raised in the designated GitHub repo. The flow function collects the content in the PR, and asks ChatGPT/4 to review and summarize it. The result is then posted back to the PR as a comment. The flow functions are written in Rust and run in hosted [WasmEdge Runtimes](https://github.com/wasmedge) on [flows.network](https://flows.network/).
35
35
36
-
* The code review comment is updated automatically every time a new commit is pushed to this PR.
37
-
* A new code review could be triggered when someone says a magic *trigger phrase* in the PR's comments section. The default trigger phrase is "flows summarize".
36
+
* The PR summary comment is updated automatically every time a new commit is pushed to this PR.
37
+
* A new summary could be triggered when someone says a magic *trigger phrase* in the PR's comments section. The default trigger phrase is "flows summarize".
38
38
39
-
## Deploy your own code review bot in 2 simple steps
39
+
## Deploy your own code review bot in 3 simple steps
40
40
41
-
1. Create a bot from a template
42
-
2. Configure the bot to review PRs on a specified GitHub repo
41
+
1. Create a bot from your own GitHub repo
42
+
2. Configure the bot to review PRs
43
+
3. Connect to GitHub for access to the target repo
43
44
44
45
### 0 Prerequisites
45
46
46
47
You will also need to sign into [flows.network](https://flows.network/) from your GitHub account. It is free.
Next, you will tell the bot which GitHub repo it needs to monitor for upcoming PRs to review.
59
63
60
-
*`github_owner`: GitHub org for the repo *you want to deploy the 🤖 on*.
61
-
*`github_repo` : GitHub repo *you want to deploy the 🤖 on*.
64
+
*`github_owner`: GitHub org for the repo *you want to review PRs*
65
+
*`github_repo` : GitHub repo *you want to review PRs*
66
+
*`trigger_phrase` : The magic words to write in a PR comment to summon the bot. It defaults to "flows summarize".
62
67
63
68
> Let's see an example. You would like to deploy the bot to review code in PRs on `WasmEdge/wasmedge_hyper_demo` repo. Here `github_owner = WasmEdge` and `github_repo = wasmedge_hyper_demo`.
64
69
65
-
Click on the **Connect** or **+ Add new authentication** button to give the function access to the GitHub repo to deploy the 🤖. You'll be redirected to a new page where you must grant [flows.network](https://flows.network/) permission to the repo.
70
+
And the LLM API service you want to use to review the PRs.
71
+
72
+
*`llm_api_endpoint` : The OpenAI compatible API service endpoint for the LLM to conduct code reviews.
73
+
*`llm_model_name` : The model name required by the API service.
74
+
*`llm_api_key` : Optional: The API key if required by the LLM service provider.
75
+
76
+
Click on the **Build** button.
77
+
78
+
### 3 Connect to GitHub for access to the target repo
79
+
80
+
Finally, the GitHub repo will need to give you access so that the flow function can
81
+
access and review its PRs! In this next screen, you will connect to GitHub and authorize access.
82
+
83
+
Click on the **Connect** or **+ Add new authentication** button to give the function access to the GitHub repo. You'll be redirected to a new page where you must grant [flows.network](https://flows.network/) permission to the repo.
Close the tab and go back to the flow.network page once you are done. Click on **Deploy**.
70
88
71
89
### Wait for the magic!
72
90
73
91
This is it! You are now on the flow details page waiting for the flow function to build. As soon as the flow's status became `running`, the bot is ready to give code reviews! The bot is summoned by every new PR, every new commit, as well as magic words (i.e., `trigger_phrase`) in PR comments.
let system = &format!("You are an experienced software developer. You will act as a reviewer for a GitHub Pull Request titled \"{}\". Please be as concise as possible while being accurate.", title);
0 commit comments