def is_function(message: ChatMessage) -> bool:
    """Utility for ChatMessage responses from OpenAI models."""
    return (
        "tool_calls" in message.additional_kwargs
        and len(message.additional_kwargs["tool_calls"]) > 0
    )
Utility for ChatMessage responses from OpenAI models.
llama-index-core/llama_index/core/chat_engine/types.py