Map<String, Object?> toJson() => { 'type': 'function', 'id': id, 'function': {'name': name, 'arguments': argumentsJson}, };