vllm.reasoning.ernie45_reasoning_parser
¶
Classes:
-
Ernie45ReasoningParser–Reasoning parser for Ernie45 thinking model.
Ernie45ReasoningParser
¶
Bases: BaseThinkingReasoningParser
Reasoning parser for Ernie45 thinking model. The Ernie45 thinking model output format is abc
or abc
def
Methods:
-
extract_reasoning–Extract reasoning content from the model output.
-
extract_reasoning_streaming–Extract reasoning content from a delta message.
Attributes:
-
end_token(str) –The token that ends reasoning content.
-
start_token(str) –The token that starts reasoning content.
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
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
or abc
def - 'abc' goes to reasoning - 'def' goes to content