pub fn cap_output_tokens(
messages: &[Message],
tools: Option<&[ToolDefinition]>,
configured_max: u32,
context_window: u32,
) -> u32Expand description
Cap configured max output tokens so estimated input + output fits in the context window.