Skip to content

Commit c83fa9d

Browse files
committed
fix: skip reasoning tag preceded by text
1 parent ac608d3 commit c83fa9d

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
@@ -3672,6 +3672,10 @@ def set_last_text(out, text):
36723672
before_tag = item_text[: match.start()]
36733673
after_tag = item_text[match.end() :]
36743674

3675+
# Tag in prose text, skip it.
3676+
if before_tag.strip():
3677+
continue
3678+
36753679
# Keep only text before the tag in the message
36763680
set_last_text(output, before_tag)
36773681

0 commit comments

Comments
 (0)