add reasoning parser plugin (#3811)

* add reasoning parser plugin

* fix finish reason
This commit is contained in:
luukunn
2025-09-03 18:31:27 +08:00
committed by GitHub
parent 31313e0f3d
commit fc598d4c5a
5 changed files with 51 additions and 5 deletions
+11 -2
View File
@@ -71,8 +71,15 @@ class InputPreprocessor:
"""
reasoning_parser_obj = None
tool_parser_obj = None
if self.reasoning_parser:
reasoning_parser_obj = ReasoningParserManager.get_reasoning_parser(self.reasoning_parser)
try:
from fastdeploy.plugins.reasoning_parser import (
load_reasoning_parser_plugins,
)
reasoning_parser_obj = load_reasoning_parser_plugins()
except:
if self.reasoning_parser:
reasoning_parser_obj = ReasoningParserManager.get_reasoning_parser(self.reasoning_parser)
if self.tool_parser:
tool_parser_obj = ToolParserManager.get_tool_parser(self.tool_parser)
@@ -85,6 +92,8 @@ class InputPreprocessor:
Processor = load_input_processor_plugins()
self.processor = Processor(
model_name_or_path=self.model_name_or_path,
reasoning_parser_obj=reasoning_parser_obj,
tool_parser_obj=tool_parser_obj,
)
except:
if not self.enable_mm: