Skip to content
Merged
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
14 changes: 8 additions & 6 deletions sidecar/src/agentic/tool/session/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{collections::HashMap, sync::Arc};

use color_eyre::owo_colors::OwoColorize;
use colored::Colorize;
use llm_client::broker::LLMBroker;
use llm_client::{broker::LLMBroker, clients::types::LLMType};
use tokio::sync::Mutex;
use tokio_util::sync::CancellationToken;

Expand Down Expand Up @@ -650,11 +650,13 @@ impl SessionService {
// if the input tokens are greater than 60k then do context crunching
// over here and lighten the context for the agent
// For custom LLMs, we use a higher token threshold
let token_threshold = if message_properties.llm_properties().llm().is_custom() {
120_000
} else {
60_000
};
let llm = message_properties.llm_properties().llm();
let token_threshold =
if llm.is_custom() || matches!(llm, &LLMType::ClaudeSonnet3_7) {
150_000
} else {
60_000
};
if input_tokens >= token_threshold {
println!("context_crunching");
// the right way to do this would be since the last reasoning node which was present here
Expand Down