mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-05 02:41:34 +00:00
fix: prompt cache misses after a model calls tools one after another
When a model called one tool, got its result and then called a second tool with no text in between, the next request merged both calls into an earlier assistant message that the provider had already seen. That changed the conversation's beginning, so the provider's prompt cache stopped matching from there for the rest of the chat. Each tool call and its result are now sent as their own messages, so the start of the conversation stays identical from one request to the next. Fixes #31588
This commit is contained in:
parent
176d31d1db
commit
05b46934da
1 changed files with 1 additions and 1 deletions
|
|
@ -479,7 +479,7 @@ def convert_output_to_messages(
|
|||
|
||||
for item in output:
|
||||
item_type = item.get('type', '')
|
||||
if item_type not in {'function_call', 'function_call_output'}:
|
||||
if item_type != 'function_call_output':
|
||||
flush_tool_outputs()
|
||||
flush_tool_images()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue