Skip to main content

thinking_bool_from_args

Function thinking_bool_from_args 

Source
pub fn thinking_bool_from_args(
    args: Option<&HashMap<String, Value>>,
) -> Option<bool>
Expand description

Shared helper: extract a boolean thinking toggle from chat_template_args.

Reads the two equivalent keys (thinking, enable_thinking — vLLM’s canonical kwarg) in order and returns the first bool value found, or None if neither key is present (or neither carries a bool). Used by the V4 formatter’s resolve_thinking_mode and by reasoning-parser gating in consumers so both paths agree on the signal interpretation.