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
+3-24Lines changed: 3 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,16 +36,13 @@ This flow function (or 🤖) will be triggered when a new PR is raised in the de
36
36
* The code review comment is updated automatically every time a new commit is pushed to this PR.
37
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".
38
38
39
-
## Deploy your own code review bot in 3 simple steps
39
+
## Deploy your own code review bot in 2 simple steps
40
40
41
41
1. Create a bot from a template
42
-
2. Add your OpenAI API key
43
-
3. Configure the bot to review PRs on a specified GitHub repo
42
+
2. Configure the bot to review PRs on a specified GitHub repo
44
43
45
44
### 0 Prerequisites
46
45
47
-
You will need to bring your own [OpenAI API key](https://openai.com/blog/openai-api). If you do not already have one, [sign up here](https://platform.openai.com/signup).
48
-
49
46
You will also need to sign into [flows.network](https://flows.network/) from your GitHub account. It is free.
50
47
51
48
### 1 Create a bot from a template
@@ -56,15 +53,7 @@ Review the `trigger_phrase` variable. It is the magic words you type in a PR com
56
53
57
54
Click on the **Create and Build** button.
58
55
59
-
### 2 Add your OpenAI API key
60
-
61
-
You will now set up OpenAI integration. Click on **Connect**, enter your key and give it a name.
Close the tab and go back to the flow.network page once you are done. Click on **Continue**.
66
-
67
-
### 3 Configure the bot to access GitHub
56
+
### 2 Configure the bot to access GitHub
68
57
69
58
Next, you will tell the bot which GitHub repo it needs to monitor for upcoming PRs to review.
70
59
@@ -87,16 +76,6 @@ This is it! You are now on the flow details page waiting for the flow function t
87
76
88
77
## FAQ
89
78
90
-
### Customize the bot
91
-
92
-
The bot's source code is available in the GitHub repo you cloned from the template. Feel free to make changes to the source code (e.g., model, context length, API key and prompts) to fit your own needs. If you need help, [ask in Discord](https://discord.gg/ccZn9ZMfFf)!
93
-
94
-
### Use GPT4
95
-
96
-
By default, the bot uses GPT3.5 for code review. If your OpenAI API key has access to GPT4, you can open the `src/github-pr-review.rs` file
97
-
in your cloned source code repo, and change `GPT35Turbo` to `GPT4` in the source code. Commit and push the change back to GitHub.
98
-
The flows.network platform will automatically detect and rebuild the bot from your updated source code.
99
-
100
79
### Use the bot on multiple repos
101
80
102
81
You can [manually create a new flow](https://flows.network/flow/new) and import the source code repo for the bot (i.e., the repo you cloned from the template). Then, you can use the flow config to specify the `github_owner` and `github_repo` to point to the target repo you need to deploy the bot on. Deploy and authorize access to that target repo.
log::debug!("Sending patch to OpenAI: {}", commit_hash);
173
180
let co = ChatOptions{
174
-
model:MODEL,
181
+
model:Some(&llm_model_name),
175
182
restart:true,
176
183
system_prompt:Some(system),
184
+
..Default::default()
177
185
};
178
186
let question = "The following is a GitHub patch. Please summarize the key changes and identify potential problems. Start with the most important findings.\n\n".to_string() + truncate(commit,CHAR_SOFT_LIMIT);
log::debug!("Sending all reviews to OpenAI for summarization");
203
211
let co = ChatOptions{
204
-
model:MODEL,
212
+
model:Some(&llm_model_name),
205
213
restart:true,
206
214
system_prompt:Some(system),
215
+
..Default::default()
207
216
};
208
217
let question = "Here is a set of summaries for software source code patches. Each summary starts with a ------ line. Please write an overall summary considering all the individual summary. Please present the potential issues and errors first, following by the most important findings, in your summary.\n\n".to_string() + &reviews_text;
0 commit comments