Skip to content

vllm.reasoning.ernie45_reasoning_parser

Classes:

Ernie45ReasoningParser

Bases: BaseThinkingReasoningParser

Reasoning parser for Ernie45 thinking model. The Ernie45 thinking model output format is abc

def

or  abc

def

Methods:

Attributes:

end_token property

The token that ends reasoning content.

start_token property

The token that starts reasoning content.

extract_reasoning(model_output, request)

Extract reasoning content from the model output. The Ernie45 thinking model output format is abc

def

    or  abc

def - 'abc' goes to reasoning - 'def' goes to content Returns: tuple[Optional[str], Optional[str]]: reasoning content and content

extract_reasoning_streaming(previous_text, current_text, delta_text, previous_token_ids, current_token_ids, delta_token_ids)

Extract reasoning content from a delta message. Handles streaming output where previous + delta = current. Uses token IDs for faster processing. The Ernie45 thinking model output format is abc

def

    or  abc

def - 'abc' goes to reasoning - 'def' goes to content