File tree Expand file tree Collapse file tree 2 files changed +267
-188
lines changed
sglang_helpers/function_call Expand file tree Collapse file tree 2 files changed +267
-188
lines changed Original file line number Diff line number Diff line change @@ -260,8 +260,15 @@ def _create_detector(
260260 DeepSeekV32Detector if tools are present, None otherwise
261261 """
262262 if request .tools :
263- # Pass the encoding module to use official parse_tool_calls
264- return DeepSeekV32Detector (encoding_module = self .encoding_module )
263+ # Determine thinking_mode based on whether request is in thinking mode
264+ thinking_mode = "thinking" if self .in_think_mode (request ) else "chat"
265+
266+ # Pass the encoding module and thinking_mode to detector
267+ # Detector is created fresh for each request (not singleton)
268+ return DeepSeekV32Detector (
269+ encoding_module = self .encoding_module ,
270+ thinking_mode = thinking_mode
271+ )
265272 return None
266273
267274 @override
You can’t perform that action at this time.
0 commit comments