Skip to main content

is_context_overflow

Function is_context_overflow 

Source
pub fn is_context_overflow(
    message: &AssistantMessage,
    context_window: u64,
) -> bool
Expand description

Whether a response failed or was cut short because the input exceeded the context window: an overflow error text, input above context_window on a completed response, or a length stop with no output and a full window. A context_window of 0 checks the error text only.