Python class
ReasoningSpan
ReasoningSpan
class max.interfaces.ReasoningSpan(reasoning_with_delimiters, reasoning)
Bases: object
Identifies a reasoning span within a token ID sequence.
A reasoning span is a contiguous span of tokens near the start of a reasoning model’s output. In streaming mode with multiple chunks, the reasoning section may consist of one or more reasoning spans across multiple initial chunks.
Tracks both the delimited reasoning span (including delimiter tokens like
<think> and </think>) and the reasoning span (excluding
delimiters). Uses standard Python slice semantics: [start, end).
-
Parameters:
extract_content()
extract_content(seq)
Extracts the non-reasoning elements from a sequence.
extract_reasoning()
extract_reasoning(seq)
Extracts the reasoning elements from a sequence.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!