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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user