Skip to content

Commit b986970

Browse files
committed
fix: skip reasoning tag preceded by text
1 parent dc4343f commit b986970

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

backend/open_webui/utils/middleware.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3538,6 +3538,10 @@ def set_last_text(out, text):
35383538
before_tag = item_text[: match.start()]
35393539
after_tag = item_text[match.end() :]
35403540

3541+
# Tag in prose text, skip it.
3542+
if before_tag.strip():
3543+
continue
3544+
35413545
# Keep only text before the tag in the message
35423546
set_last_text(output, before_tag)
35433547

0 commit comments

Comments
 (0)