Skip to content

Commit 0749c95

Browse files
committed
fix: skip reasoning tag preceded by text
1 parent 34d3435 commit 0749c95

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
@@ -3589,6 +3589,10 @@ def set_last_text(out, text):
35893589
before_tag = item_text[: match.start()]
35903590
after_tag = item_text[match.end() :]
35913591

3592+
# Tag in prose text, skip it.
3593+
if before_tag.strip():
3594+
continue
3595+
35923596
# Keep only text before the tag in the message
35933597
set_last_text(output, before_tag)
35943598

0 commit comments

Comments
 (0)