mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-05 02:41:34 +00:00
Merge a3f39d908b into a5bc78300e
This commit is contained in:
commit
8f83fd46ab
1 changed files with 3 additions and 0 deletions
|
|
@ -403,6 +403,9 @@ async def add_memory_context(request, form_data: dict, user, model: dict | None
|
|||
return form_data
|
||||
|
||||
memory_context = f'{MEMORY_CONTEXT_OPEN}\n{rendered}\n{MEMORY_CONTEXT_CLOSE}'
|
||||
if messages and messages[0].get('role') == 'system':
|
||||
# Without a blank line, models echo the block as part of the prompt
|
||||
memory_context = f'\n{memory_context}'
|
||||
form_data['messages'] = add_or_update_system_message(memory_context, messages, append=True)
|
||||
return form_data
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue