[Bugfix] [Parser] Fix empty tool block silently dropping subsequent content (#46091)
Signed-off-by: Ben Browning <bbrownin@redhat.com> Co-authored-by: Flora Feng <4florafeng@gmail.com>
This commit is contained in:
co-authored by
Flora Feng
parent
c3c6d723fd
commit
7f616c327d
@@ -672,7 +672,7 @@ class ParserEngine(Parser):
|
||||
if len(tool_call_deltas) > 1:
|
||||
tool_call_deltas = self._coalesce_tool_call_deltas(tool_call_deltas)
|
||||
|
||||
if self._deferred_content and not seen_tool_event:
|
||||
if self._deferred_content and (not seen_tool_event or not tool_call_deltas):
|
||||
content_parts.insert(0, self._deferred_content)
|
||||
self._deferred_content = ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user