Skip to main content

normalize_user_text

Function normalize_user_text 

Source
pub fn normalize_user_text(raw: &str) -> String
Expand description

Truncate and lowercase a user message for keyword scanning.

500 chars is generous — intent keywords almost always appear in the first sentence or two. Truncating bounds the work per turn and the memory cost of the rolling last_user_text variable in the parser.