mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-02 02:12:25 +00:00
fix: stray <|end_of_solution|> marker left in the reply (#31436)
When a model wraps its answer in <|begin_of_solution|> and <|end_of_solution|>, only the opening marker was removed. The closing marker stayed visible in the reply and was saved with the message, and anything the model wrote after it was glued onto the answer. Now both markers are removed and text after the answer shows up as a normal part of the reply. Fixes #31434
This commit is contained in:
parent
25604d7070
commit
fe8b30438a
1 changed files with 1 additions and 1 deletions
|
|
@ -4540,7 +4540,7 @@ async def streaming_chat_response_handler(response, ctx):
|
|||
|
||||
last_type = output[-1].get('type', '') if output else ''
|
||||
|
||||
if last_type == 'message':
|
||||
if last_type == 'message' and output[-1].get('_tag_type') != content_type:
|
||||
# Use the output item's own text for tag detection
|
||||
item = output[-1]
|
||||
item_text = get_last_text(output)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue