Skip to content

Commit 484e506

Browse files
committed
fix: skip reasoning tag preceded by text
1 parent 75352f8 commit 484e506

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
@@ -3620,6 +3620,10 @@ def set_last_text(out, text):
36203620
before_tag = item_text[: match.start()]
36213621
after_tag = item_text[match.end() :]
36223622

3623+
# Tag in prose text, skip it.
3624+
if before_tag.strip():
3625+
continue
3626+
36233627
# Keep only text before the tag in the message
36243628
set_last_text(output, before_tag)
36253629

0 commit comments

Comments
 (0)