Skip to content

Commit 4aad3b7

Browse files
committed
Add logging
Signed-off-by: Michael Yuan <[email protected]>
1 parent 3ff9073 commit 4aad3b7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/github-pr-summary.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ 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);
4546

4647
let mut new_commit : bool = false;
4748
let (title, pull_number, _contributor) = match payload {
@@ -174,6 +175,7 @@ async fn handler(payload: EventPayload) {
174175
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);
175176
match lf.chat_completion(&chat_id, &question, &co).await {
176177
Ok(r) => {
178+
log::debug!("LLM answer: {}", &r.choice);
177179
if reviews_text.len() < ctx_size_char {
178180
reviews_text.push_str("------\n");
179181
reviews_text.push_str(&r.choice);
@@ -206,6 +208,7 @@ async fn handler(payload: EventPayload) {
206208
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;
207209
match lf.chat_completion(&chat_id, &question, &co).await {
208210
Ok(r) => {
211+
log::debug!("LLM answer: {}", &r.choice);
209212
resp.push_str(&r.choice);
210213
resp.push_str("\n\n## Details\n\n");
211214
log::debug!("Received the overall summary");

0 commit comments

Comments
 (0)