add reasoning parser plugin (#3820)

This commit is contained in:
luukunn
2025-09-03 11:17:13 +08:00
committed by GitHub
parent 37cb37b7f2
commit 1968c65849
3 changed files with 45 additions and 3 deletions

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: