mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-11 08:57:17 +00:00
fix: stop replaying empty assistant placeholders to the provider
Closes #25083
This commit is contained in:
parent
5caa91a493
commit
71810a9b3c
1 changed files with 5 additions and 0 deletions
|
|
@ -2096,6 +2096,11 @@ def process_messages_with_output(
|
|||
processed.extend(output_messages)
|
||||
continue
|
||||
|
||||
if message.get('role') == 'assistant' and not message.get('tool_calls'):
|
||||
content = message.get('content')
|
||||
if not (content.strip() if isinstance(content, str) else content):
|
||||
continue
|
||||
|
||||
# Strip 'output' field before adding (LLM shouldn't see it)
|
||||
clean_message = {k: v for k, v in message.items() if k != 'output'}
|
||||
processed.append(clean_message)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue