Skip to content

Commit 5a45765

Browse files
committed
move tool parts to the right place
1 parent cf65d04 commit 5a45765

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/inferencesh/models/llm.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,11 @@ def merge_messages(messages: List[ContextMessage]) -> ContextMessage:
239239
return ContextMessage(role=messages[0].role, text=text, image=image)
240240

241241
def merge_tool_calls(messages: List[ContextMessage]) -> List[Dict[str, Any]]:
242-
return [msg.tool_calls for msg in messages if msg.tool_calls]
242+
tool_calls = []
243+
for msg in messages:
244+
if msg.tool_calls:
245+
tool_calls.extend(msg.tool_calls)
246+
return tool_calls
243247

244248
user_input_text = ""
245249
if hasattr(input_data, "text"):

0 commit comments

Comments
 (0)