Fix: pass tool_call_id through to watsonx API

watsonx requires tool_call_id on role=tool messages.
Added field to ChatMessage model and passthrough in transformer.
This commit is contained in:
norbert committed 2026-02-23 18:46:46 +00:00
1 parent 592b34cff0
commit c6232d262d
2 files changed
+5

No files matched your search

+3
View File
@@ -47,6 +47,9 @@ def transform_messages_to_watsonx(messages: List[ChatMessage]) -> List[Dict[str,
if msg.function_call:
watsonx_msg["function_call"] = msg.function_call
if msg.tool_call_id:
watsonx_msg["tool_call_id"] = msg.tool_call_id
watsonx_messages.append(watsonx_msg)
return watsonx_messages