mergeChatToolMetadata function
Null fields are omissions. Explicit empty collections replace prior values.
Implementation
Map<String, Object?> mergeChatToolMetadata(
Map<String, Object?> previous,
Map<String, Object?> update,
) => Map.unmodifiable({
...previous,
for (final entry in update.entries)
if (entry.value != null) entry.key: entry.value,
});