Skip to content

Commit

Permalink
chore: adding debug when including whole content trigger, also move s…
Browse files Browse the repository at this point in the history
…tart line to 1
  • Loading branch information
Sma1lboy committed Oct 23, 2024
1 parent 096dd20 commit ff08eda
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ee/tabby-webserver/src/service/answer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ use futures::stream::BoxStream;
use tabby_common::{
api::{
code::{
CodeSearch, CodeSearchError, CodeSearchHit, CodeSearchParams, CodeSearchQuery,
CodeSearchScores,
CodeSearch, CodeSearchDocument, CodeSearchError, CodeSearchHit, CodeSearchParams,
CodeSearchQuery, CodeSearchScores,
},
doc::{DocSearch, DocSearchError, DocSearchHit},
},
Expand All @@ -38,7 +38,7 @@ use tabby_schema::{
ThreadRunOptionsInput,
},
};
use tracing::{debug, error, warn};
use tracing::{debug, error, field::debug, warn};

use crate::bail;

Expand Down Expand Up @@ -544,6 +544,10 @@ pub async fn merge_code_snippets(
};

if !file_content.is_empty() {
debug!(
"file {} less than 200, it will be included whole file content",
file_hits[0].doc.filepath
);
let mut insert_hit = file_hits[0].clone();
insert_hit.scores =
file_hits
Expand All @@ -560,6 +564,7 @@ pub async fn merge_code_snippets(
insert_hit.scores.embedding /= num_files;
insert_hit.scores.rrf /= num_files;
insert_hit.doc.body = file_content;
insert_hit.doc.start_line = 1;
result.push(insert_hit);
}
} else {
Expand Down

0 comments on commit ff08eda

Please sign in to comment.