Skip to content

Commit 62d6f1b

Browse files
committed
fix: skip reasoning tag preceded by text
1 parent 4ddfaf2 commit 62d6f1b

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
@@ -3539,6 +3539,10 @@ def set_last_text(out, text):
35393539
before_tag = item_text[: match.start()]
35403540
after_tag = item_text[match.end() :]
35413541

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

0 commit comments

Comments
 (0)