Serializes the message into a provider-friendly map.
Map<String, dynamic> toMap() => { 'role': role, 'content': content, 'metadata': metadata, };