Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions crates/libsy/src/algorithms/llm_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ struct TaskInput {
recent_turn_window: Option<usize>,
}

impl ClassifierInput for TaskInput {
fn build_messages(&self, _state: &State, request: &Request) -> Vec<Message> {
impl TaskInput {
/// Selects conversation content without adding judge instructions.
fn messages(&self, request: &Request) -> Vec<Message> {
// The default preserves the whole-task anchor and latest user update. A
// configured window widens that to the surrounding conversation.
let mut messages = match self.recent_turn_window {
Expand All @@ -204,6 +205,13 @@ impl ClassifierInput for TaskInput {
.retain(|block| !matches!(block, ContentBlock::Reasoning { .. }));
}
messages.retain(|message| !message.content.is_empty());
messages
}
}

impl ClassifierInput for TaskInput {
fn build_messages(&self, _state: &State, request: &Request) -> Vec<Message> {
let mut messages = self.messages(request);
// Only the windowed path carries assistant turns and tool traffic for the judge
// to be distracted by. The default path is user task messages only — the anchor
// and the latest follow-up — so there is nothing there to outrank.
Expand Down
Loading