Skip to content

Commit ea0fe7f

Browse files
committed
Remove excessive logging
Signed-off-by: Michael Yuan <michael@secondstate.io>
1 parent 3bdbef4 commit ea0fe7f

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/github-pr-summary.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ async fn handler(payload: EventPayload) {
4242
// The soft character limit of the input context size
4343
// This is measured in chars. We set it to be 2x llm_ctx_size, which is measured in tokens.
4444
let ctx_size_char : usize = (2 * llm_ctx_size).try_into().unwrap_or(0);
45-
log::debug!("ctx_size_char={}", ctx_size_char);
4645

4746
let mut new_commit : bool = false;
4847
let (title, pull_number, _contributor) = match payload {
@@ -155,7 +154,7 @@ async fn handler(payload: EventPayload) {
155154
}
156155

157156
let chat_id = format!("PR#{pull_number}");
158-
let system = &format!("You are an experienced software developer. You will act as a reviewer for a GitHub Pull Request titled \"{}\". Please be concise while being accurate.", title);
157+
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);
159158
let mut lf = LLMServiceFlows::new(&llm_api_endpoint);
160159
lf.set_api_key(&llm_api_key);
161160
// lf.set_retry_times(3);
@@ -173,10 +172,8 @@ async fn handler(payload: EventPayload) {
173172
..Default::default()
174173
};
175174
let question = "The following is a GitHub patch. Please summarize the key changes in concise points. Start with the most important findings.\n\n".to_string() + truncate(commit, ctx_size_char);
176-
log::debug!("LLM request: {}", &question);
177175
match lf.chat_completion(&chat_id, &question, &co).await {
178176
Ok(r) => {
179-
log::debug!("LLM answer: {}", &r.choice);
180177
if reviews_text.len() < ctx_size_char {
181178
reviews_text.push_str("------\n");
182179
reviews_text.push_str(&r.choice);
@@ -207,10 +204,8 @@ async fn handler(payload: EventPayload) {
207204
..Default::default()
208205
};
209206
let question = "Here is a set of summaries for source code patches in this PR. Each summary starts with a ------ line. Write an overall summary. Present the potential issues and errors first, following by the most important findings, in your summary.\n\n".to_string() + &reviews_text;
210-
log::debug!("LLM request: {}", &question);
211207
match lf.chat_completion(&chat_id, &question, &co).await {
212208
Ok(r) => {
213-
log::debug!("LLM answer: {}", &r.choice);
214209
resp.push_str(&r.choice);
215210
resp.push_str("\n\n## Details\n\n");
216211
log::debug!("Received the overall summary");

0 commit comments

Comments
 (0)