Skip to content

Commit 67446eb

Browse files
committed
fix: skip reasoning tag preceded by text
1 parent fdee390 commit 67446eb

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
@@ -3638,6 +3638,10 @@ def set_last_text(out, text):
36383638
before_tag = item_text[: match.start()]
36393639
after_tag = item_text[match.end() :]
36403640

3641+
# Tag in prose text, skip it.
3642+
if before_tag.strip():
3643+
continue
3644+
36413645
# Keep only text before the tag in the message
36423646
set_last_text(output, before_tag)
36433647

0 commit comments

Comments
 (0)