pymllm.parsers.reasoning_parser =============================== .. py:module:: pymllm.parsers.reasoning_parser .. autoapi-nested-parse:: Reasoning / thinking content parser. Separates ``...`` (or model-specific markers) from normal assistant content. Supports both one-shot and incremental streaming modes. Usage:: # Non-streaming parser = ReasoningParser("qwen3") reasoning, content = parser.parse_non_stream(full_text) # Streaming parser = ReasoningParser("qwen3") for delta in deltas: reasoning_delta, content_delta = parser.parse_stream_chunk(delta) Classes ------- .. autoapisummary:: pymllm.parsers.reasoning_parser.ReasoningParser Module Contents --------------- .. py:class:: ReasoningParser(model_type, stream_reasoning = True) Model-agnostic reasoning content parser. :param model_type: Key into the detector registry (e.g. ``"qwen3"``, ``"deepseek-r1"``). :param stream_reasoning: If ``True``, stream reasoning content incrementally as it arrives. If ``False``, buffer reasoning until the end tag is found. .. py:attribute:: SUPPORTED .. py:method:: parse_non_stream(text) Parse complete text. Returns ``(reasoning_content, content)`` where either may be empty. .. py:method:: parse_stream_chunk(delta) Parse an incremental streaming delta. Returns ``(reasoning_delta, content_delta)``. Either may be ``""``.