def from_watsonx_message(message: dict) -> ChatMessage:
    """Convert Watsonx message dict to generic message."""
    role = message.get("role", MessageRole.ASSISTANT)
    content = message.get("content")

    additional_kwargs: Dict[str, Any] = {}
    if message.get("tool_calls") is not None:
        tool_calls: List[dict] = message.get("tool_calls")
        additional_kwargs.update(tool_calls=tool_calls)

    return ChatMessage(role=role, content=content, additional_kwargs=additional_kwargs)
Convert Watsonx message dict to generic message.
llama-index-integrations/llms/llama-index-llms-ibm/llama_index/llms/ibm/utils.py