Skip to content

Commit 3345f99

Browse files
Algorithm5838github-actions[bot]
authored andcommitted
fix: skip reasoning tag preceded by text
1 parent 20e3361 commit 3345f99

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
@@ -3652,6 +3652,10 @@ def set_last_text(out, text):
36523652
before_tag = item_text[: match.start()]
36533653
after_tag = item_text[match.end() :]
36543654

3655+
# Tag in prose text, skip it.
3656+
if before_tag.strip():
3657+
continue
3658+
36553659
# Keep only text before the tag in the message
36563660
set_last_text(output, before_tag)
36573661

0 commit comments

Comments
 (0)