[Tool Call] Fix DeepSeekV32Detector skipping functions with no params in streaming mode (#14573)

This commit is contained in:
wentx
2025-12-08 10:32:10 +08:00
committed by GitHub
parent 6799847ebf
commit b7b7524e95
2 changed files with 144 additions and 7 deletions

View File

@@ -241,13 +241,8 @@ class DeepSeekV32Detector(BaseFormatDetector):
# This ensures each function returns at most once
calls_for_this_invoke: list[ToolCallItem] = []
# Check if invoke_content is empty or whitespace only
# If so, skip this tool call entirely (it's likely incomplete or malformed)
if not invoke_content.strip():
# Remove the incomplete tool call from buffer
self._buffer = current_text[invoke_match.end() :]
current_text = self._buffer
continue
# Note: invoke_content can be empty for functions with no parameters
# This is valid and should NOT be skipped
# Send tool name
calls_for_this_invoke.append(