Skip to content

Commit c0cce1f

Browse files
Algorithm5838github-actions[bot]
authored andcommitted
fix: skip reasoning tag preceded by text
1 parent d504ae2 commit c0cce1f

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
@@ -3761,6 +3761,10 @@ def set_last_text(out, text):
37613761
before_tag = item_text[: match.start()]
37623762
after_tag = item_text[match.end() :]
37633763

3764+
# Tag in prose text, skip it.
3765+
if before_tag.strip():
3766+
continue
3767+
37643768
# Keep only text before the tag in the message
37653769
set_last_text(output, before_tag)
37663770

0 commit comments

Comments
 (0)