fn truncate_context(context: &str, max_chars: usize) -> String
Truncates context to fit within a character limit.