Skip to main content

cap_output_tokens

Function cap_output_tokens 

Source
pub fn cap_output_tokens(
    messages: &[Message],
    tools: Option<&[ToolDefinition]>,
    configured_max: u32,
    context_window: u32,
) -> u32
Expand description

Cap configured max output tokens so estimated input + output fits in the context window.