Skip to content

Commit 192b403

Browse files
committed
feat: support return raw prompt and input ids by parameters
1 parent 9a2dd94 commit 192b403

File tree

2 files changed

+267
-188
lines changed

2 files changed

+267
-188
lines changed

rtp_llm/openai/renderers/deepseekv32_renderer.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)